+git:
+ depth: 10
language: c
dist: trusty
sudo: false
-#!/bin/sh
+#!/bin/bash
#
# MIT Alexander Couzens <lynxis@fe80.eu>
SDK=lede-sdk-ar71xx-generic_gcc-5.4.0_musl.Linux-x86_64
PACKAGES_DIR="$PWD"
+echo_red() { printf "\033[1;31m$*\033[m\n"; }
+echo_green() { printf "\033[1;32m$*\033[m\n"; }
+echo_blue() { printf "\033[1;34m$*\033[m\n"; }
+
+exec_status() {
+ PATTERN="$1"
+ shift
+ while :;do sleep 590;echo "still running (please don't kill me Travis)";done &
+ ("$@" 2>&1) | tee logoutput
+ R=${PIPESTATUS[0]}
+ kill $! && wait $! 2>/dev/null
+ if [ $R -ne 0 ]; then
+ echo_red "=> '$*' failed (return code $R)"
+ return 1
+ fi
+ if grep -qE "$PATTERN" logoutput; then
+ echo_red "=> '$*' failed (log matched '$PATTERN')"
+ return 1
+ fi
+
+ echo_green "=> '$*' successful"
+ return 0
+}
+
# download will run on the `before_script` step
# The travis cache will be used (all files under $HOME/sdk/). Meaning
# We don't have to download the file again
mkdir -p "$SDK_HOME"
cd "$SDK_HOME"
- echo "=== download SDK"
+ echo_blue "=== download SDK"
wget "$SDK_PATH/sha256sums" -O sha256sums
wget "$SDK_PATH/sha256sums.gpg" -O sha256sums.asc
# check again and fail here if the file is still bad
sha256sum -c ./sha256sums.small
- echo "=== SDK is up-to-date"
+ echo_blue "=== SDK is up-to-date"
}
# test_package will run on the `script` step.
-# test_package call make download check for very new/modified package in it's
-# own clean sdk directory
-test_packages() {
+# test_package call make download check for very new/modified package
+test_packages2() {
# search for new or modified packages. PKGS will hold a list of package like 'admin/muninlite admin/monit ...'
- PKGS=$(git diff --stat "$TRAVIS_COMMIT_RANGE" | grep Makefile | grep -v '/files/' | awk '{ print $1}' | awk -F'/Makefile' '{ print $1 }')
+ PKGS=$(git diff --diff-filter=d --name-only "$TRAVIS_COMMIT_RANGE" | grep 'Makefile$' | grep -v '/files/' | awk -F'/Makefile' '{ print $1 }')
if [ -z "$PKGS" ] ; then
- echo "No new or modified packages found!" >&2
- exit 0
+ echo_blue "No new or modified packages found!"
+ return 0
fi
- echo "=== Found new/modified packages:"
+ echo_blue "=== Found new/modified packages:"
for pkg in $PKGS ; do
echo "===+ $pkg"
done
+ echo_blue "=== Setting up SDK"
+ tmp_path=$(mktemp -d)
+ cd "$tmp_path"
+ tar Jxf "$SDK_HOME/$SDK.tar.xz" --strip=1
+
+ # use github mirrors to spare lede servers
+ cat > feeds.conf <<EOF
+src-git base https://github.com/lede-project/source.git
+src-link packages $PACKAGES_DIR
+src-git luci https://github.com/openwrt/luci.git
+EOF
+
+ # enable BUILD_LOG
+ sed -i '1s/^/config BUILD_LOG\n\tbool\n\tdefault y\n\n/' Config-build.in
+
+ ./scripts/feeds update -a > /dev/null
+ ./scripts/feeds install -a > /dev/null
+ make defconfig > /dev/null
+ echo_blue "=== Setting up SDK done"
+
+ RET=0
# E.g: pkg_dir => admin/muninlite
- # pkg_name => muninlite
+ # pkg_name => muninlite
for pkg_dir in $PKGS ; do
pkg_name=$(echo "$pkg_dir" | awk -F/ '{ print $NF }')
- tmp_path=$HOME/tmp/$pkg_name/
+ echo_blue "=== $pkg_name: Starting quick tests"
- echo "=== $pkg_name Testing package"
+ exec_status 'WARNING|ERROR' make "package/$pkg_name/download" V=s || RET=1
+ exec_status 'WARNING|ERROR' make "package/$pkg_name/check" V=s || RET=1
- # create a clean sdk for every package
- mkdir -p "$tmp_path"
- cd "$tmp_path"
- tar Jxf "$SDK_HOME/$SDK.tar.xz"
- cd "$SDK"
+ echo_blue "=== $pkg_name: quick tests done"
+ done
- cat > feeds.conf <<EOF
-src-git base https://git.lede-project.org/source.git
-src-link packages $PACKAGES_DIR
-src-git luci https://git.lede-project.org/project/luci.git
-src-git routing https://git.lede-project.org/feed/routing.git
-src-git telephony https://git.lede-project.org/feed/telephony.git
-EOF
- ./scripts/feeds update 2>/dev/null >/dev/null
- ./scripts/feeds install "$pkg_name"
-
- make defconfig
- make "package/$pkg_name/download" V=s
- make "package/$pkg_name/check" V=s | tee -a logoutput
- grep WARNING logoutput && exit 1
- rm -rf "$tmp_path"
- echo "=== $pkg_name Finished package"
+ [ $RET -ne 0 ] && return $RET
+
+ for pkg_dir in $PKGS ; do
+ pkg_name=$(echo "$pkg_dir" | awk -F/ '{ print $NF }')
+ echo_blue "=== $pkg_name: Starting compile test"
+
+ # we can't enable verbose built else we often hit Travis limits
+ # on log size and the job get killed
+ exec_status '^ERROR' make "package/$pkg_name/compile" -j3 || RET=1
+
+ echo_blue "=== $pkg_name: compile test done"
+
+ echo_blue "=== $pkg_name: begin compile logs"
+ for f in $(find logs/package/feeds/packages/$pkg_name/ -type f); do
+ echo_blue "Printing last 200 lines of $f"
+ tail -n200 "$f"
+ done
+ echo_blue "=== $pkg_name: end compile logs"
+
+ echo_blue "=== $pkg_name: begin packages sizes"
+ du -ba bin/
+ echo_blue "=== $pkg_name: end packages sizes"
done
+
+ return $RET
+}
+
+test_commits() {
+ RET=0
+ for commit in $(git rev-list ${TRAVIS_COMMIT_RANGE/.../..}); do
+ echo_blue "=== Checking commit '$commit'"
+ if git show --format='%P' -s $commit | grep -qF ' '; then
+ echo_red "Pull request should not include merge commits"
+ RET=1
+ fi
+
+ author="$(git show -s --format=%aN $commit)"
+ if echo $author | grep -q '\S\+\s\+\S\+'; then
+ echo_green "Author name ($author) seems ok"
+ else
+ echo_red "Author name ($author) need to be your real name 'firstname lastname'"
+ RET=1
+ fi
+
+ subject="$(git show -s --format=%s $commit)"
+ if echo "$subject" | grep -q -e '^[0-9A-Za-z,/-]\+: ' -e '^Revert '; then
+ echo_green "Commit subject line seems ok ($subject)"
+ else
+ echo_red "Commit subject line MUST start with '<package name>: ' ($subject)"
+ RET=1
+ fi
+
+ body="$(git show -s --format=%b $commit)"
+ sob="$(git show -s --format='Signed-off-by: %aN <%aE>' $commit)"
+ if echo "$body" | grep -qF "$sob"; then
+ echo_green "Signed-off-by match author"
+ else
+ echo_red "Signed-off-by is missing or doesn't match author (should be '$sob')"
+ RET=1
+ fi
+ done
+
+ return $RET
+}
+
+test_packages() {
+ test_commits && test_packages2 || return 1
}
-export
+echo_blue "=== Travis ENV"
+env
+echo_blue "=== Travis ENV"
+
+while true; do
+ # if clone depth is too small, git rev-list / diff return incorrect or empty results
+ C="$(git rev-list ${TRAVIS_COMMIT_RANGE/.../..} | tail -n1)" 2>/dev/null
+ [ -n "$C" -a "$C" != "a22de9b74cf9579d1ce7e6cf1845b4afa4277b00" ] && break
+ echo_blue "Fetching 50 commits more"
+ git fetch origin --deepen=50
+done
if [ "$TRAVIS_PULL_REQUEST" = false ] ; then
echo "Only Pull Requests are supported at the moment." >&2
PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap
-PKG_MD5SUM:=784f5754f3287ae80715d9100a4ed04e7895be5f7b81b7b2295d335dd69d79fb
+PKG_HASH:=784f5754f3287ae80715d9100a4ed04e7895be5f7b81b7b2295d335dd69d79fb
PKG_LICENSE:=Unique
PKG_LICENSE_FILES:=debian/copyright
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=a8cc86f0cc536a6c22dc298f4ed55339
+PKG_HASH:=736482dd6d6849d014d975b1f5794f20dda6e123dbba2d8c2f169c8e787e6f7e
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=LICENSE
include $(TOPDIR)/rules.mk
PKG_NAME:=netdata
-PKG_VERSION:=1.6.0
+PKG_VERSION:=1.8.0
PKG_RELEASE:=1
PKG_MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
PKG_LICENSE:=GPL-3.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/firehol/netdata/releases/download/v$(PKG_VERSION)
-PKG_HASH:=7839491f6e8b297cc8c28ca96845ff087f7961a12b92aa0eea1f66528da8bdaf
+PKG_HASH:=1624a3b02f07dc8881b8edd5899049d4d3d53e485424ffb2fb65a322e2ff82c3
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
CATEGORY:=Administration
DEPENDS:=+zlib +libuuid
TITLE:=Real-time performance monitoring tool
- URL:=http://netdata.firehol.org/
+ URL:=https://my-netdata.io/
endef
define Package/netdata/description
monitoring for Linux systems, applications and SNMP devices over the web.
endef
+TARGET_CFLAGS += -ffunction-sections -fdata-sections
+TARGET_LDFLAGS += -Wl,--gc-sections
+
+CONFIGURE_ARGS += --with-zlib --with-math --disable-x86-sse --disable-lto
+
define Package/netdata/conffiles
/etc/netdata/
endef
$(CP) ./files/netdata.conf $(1)/etc/netdata
mkdir -p $(1)/usr/share/netdata
$(CP) $(PKG_INSTALL_DIR)/usr/share/netdata $(1)/usr/share
- rm $(1)/usr/share/netdata/web/images/animated.gif
- rm -rf $(1)/usr/share/netdata/web/images/seo-*.png
- rm -rf $(1)/usr/share/netdata/web/images/post.png
+ rm -rf $(1)/usr/share/netdata/web/images
rm -rf $(1)/usr/share/netdata/web/old
rm $(1)/usr/share/netdata/web/demo*html
rm $(1)/usr/share/netdata/web/fonts/*.svg
mkdir -p $(1)/usr/lib/netdata
$(CP) $(PKG_INSTALL_DIR)/usr/lib/netdata $(1)/usr/lib
rm $(1)/usr/lib/netdata/python.d/python-modules-installer.sh
- rm -rf $(1)/usr/lib/netdata/python.d/python_modules/pyyaml2
- rm -rf $(1)/usr/lib/netdata/python.d/python_modules/pyyaml3
chmod 4755 $(1)/usr/lib/netdata/plugins.d/apps.plugin
mkdir -p $(1)/etc/init.d
$(INSTALL_BIN) ./files/netdata.init $(1)/etc/init.d/netdata
update every = 2
# pthread stack size = 8388608
run as user = nobody
+
+[web]
web files owner = root
web files group = root
- # http port listen backlog = 100
# default port = 19999
# bind to = *
- # multi threaded web server = yes
- # disconnect idle web clients after seconds = 60
- # respect web browser do not track policy = no
- enable web responses gzip compression = no
- # web compression strategy = default
- # web compression level = 3
[plugins]
# PATH environment variable = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
/proc/net/rpc/nfsd = no
/proc/net/rpc/nfs = no
# ipc = yes
+ /proc/spl/kstat/zfs/arcstats = no
[plugin:proc:/proc/stat]
# cpu utilization = yes
PKG_NAME:=openwisp-config
PKG_VERSION:=0.4.5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_PROTO:=git
Package/openwisp-config-openssl=$(call Package/openwisp-config/default,openssl,OpenSSL,+ca-certificates +libopenssl)
Package/openwisp-config-mbedtls=$(call Package/openwisp-config/default,mbedtls,mbedTLS,+ca-certificates +libmbedtls)
Package/openwisp-config-cyassl=$(call Package/openwisp-config/default,cyassl,CyaSSL,+ca-certificates +libcyassl)
-# deprecated on recent versions of OpenWRT (>= Designated Driver) and LEDE (>= 17.01)
-Package/openwisp-config-polarssl=$(call Package/openwisp-config/default,polarssl,PolarSSL,+ca-certificates +libpolarssl)
Package/openwisp-config-nossl=$(call Package/openwisp-config/default,nossl,No SSL)
define Build/Compile
ifeq ($(BUILD_VARIANT),cyassl)
CONFIG_OPENWISP_UCI:=ssl
endif
-ifeq ($(BUILD_VARIANT),polarssl)
-CONFIG_OPENWISP_UCI:=ssl
-endif
ifeq ($(BUILD_VARIANT),nossl)
CONFIG_OPENWISP_UCI:=nossl
endif
$(eval $(call BuildPackage,openwisp-config-openssl))
$(eval $(call BuildPackage,openwisp-config-mbedtls))
$(eval $(call BuildPackage,openwisp-config-cyassl))
-$(eval $(call BuildPackage,openwisp-config-polarssl))
$(eval $(call BuildPackage,openwisp-config-nossl))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.sudo.ws/dist
-PKG_MD5SUM:=93dbd1e47c136179ff1b01494c1c0e75
+PKG_HASH:=a8a697cbb113859058944850d098464618254804cf97961dee926429f00a1237
PKG_INSTALL:=1
PKG_NAME:=syslog-ng
PKG_VERSION:=3.9.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/balabit/syslog-ng/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
-PKG_MD5SUM:=1b48da9ef620cf06e55e481b5abb677a
PKG_HASH:=5678856a550ae790618fabde9d1447f932ce7a9080d55dca8fc5df1202c70a17
PKG_INSTALL:=1
endef
define Package/syslog-ng/conffiles
- /etc/syslog-ng.conf
+/etc/syslog-ng.conf
+/etc/syslog-ng.d/
endef
define Build/Configure
install-moduleLTLIBRARIES DESTDIR="$(1)"
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/syslog-ng.init $(1)/etc/init.d/syslog-ng
- $(INSTALL_DIR) $(1)/etc
$(INSTALL_DATA) ./files/syslog-ng.conf $(1)/etc
+ $(INSTALL_DIR) $(1)/etc/syslog-ng.d/
$(call libtool_remove_files,$(1))
endef
+++ /dev/null
-# place to put customization of logging
-
destination(messages);
};
-@include "/etc/custom-logs.conf"
+# put any customization files in this directory
+@include "/etc/syslog-ng.d/"
# Copyright (C) 2006-2016 OpenWrt.org
START=20
+PROG=/usr/sbin/syslog-ng
+PROG2=/usr/sbin/syslog-ng-ctl
SERVICE_USE_PID=1
+SERVICE_PID_FILE=/var/run/syslog-ng.pid
+
+config_file=/etc/syslog-ng.conf
start() {
- [ -f /etc/syslog-ng.conf ] || return 1
- service_start /usr/sbin/syslog-ng
+ [ -f $config_file ] || return 1
+
+ if ! $PROG -s 2>/dev/null ; then
+ echo "Couldn't parse $(basename $config_file)" >&2
+ exit 1
+ fi
+
+ service_start $PROG --process-mode background \
+ -p $SERVICE_PID_FILE
}
stop() {
- service_stop /usr/sbin/syslog-ng
+ service_stop $PROG
}
reload() {
- service_reload /usr/sbin/syslog-ng
+ $PROG2 reload
}
include $(TOPDIR)/rules.mk
PKG_NAME:=zabbix
-PKG_VERSION:=3.2.6
+PKG_VERSION:=3.2.7
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_HASH:=98f025b39515b196552b8a23e2fe20a8180b5e99e613ce7378725a46ed8b62d6
+PKG_HASH:=3ea0c299bd69bc728177128740f0476bc1a2c1de438330df5bbd8f5fc6090712
PKG_SOURCE_URL:=@SF/zabbix
PKG_LICENSE:=GPL-2.0
PKG_SOURCE_URL:=@GNU/autoconf
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=50f97f4159805e374639a73e2636f22e
+PKG_HASH:=64ebcec9f8ac5b2487125a86a7760d2591ac9e1d3dbd59489633f9de62a57684
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-3.0+
PKG_SOURCE_URL:=@GNU/automake
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=9a1ddb0e053474d9d1105cfe39b0c48d
+PKG_HASH:=9908c75aabd49d13661d6dcb1bc382252d22cc77bf733a2d55e87f2aa2db8636
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-3.0+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/diffutils
-PKG_MD5SUM:=99180208ec2a82ce71f55b0d7389f1b3
+PKG_HASH:=a25e89a8ab65fded1731e4186be1bb25cda967834b6df973599cdcd5abdfc19c
PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
PKG_LICENSE:=GPL-3.0
PKG_VERSION:=5.4.0
PKG_RELEASE:=2
PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
-PKG_MD5SUM:=4c626ac2a83ef30dfb9260e6f59c2b30
+PKG_HASH:=608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_INSTALL:=1
PKG_FIXUP:=libtool
define Download/gmp
URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
FILE:=$(GMPSRC).tar.bz2
- MD5SUM:=dd60683d7057917e34630b4a787932e8
+ HASH:=936162c0312886c21581002b79932829aa048cfaf9937c6265aeaa14f1cd1775
endef
$(eval $(call Download,gmp))
define Download/mpc
URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
FILE:=$(MPCSRC).tar.gz
- MD5SUM:=5b34aa804d514cc295414a963aedb6bf
+ HASH:=e664603757251fd8a352848276497a4c79b7f8b21fd8aedd5cc0598a38fee3e4
endef
$(eval $(call Download,mpc))
define Download/mpfr
URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
FILE:=$(MPFRSRC).tar.bz2
- MD5SUM:=89e59fe665e2b3ad44a6789f40b059a0
+ HASH:=c7e75a08a8d49d2082e4caee1591a05d11b9d5627514e678f02d66a124bcf2ba
endef
$(eval $(call Download,mpfr))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/libtool
-PKG_MD5SUM:=1bfb9b923f2c1339b4d2ce1807064aa5
+PKG_HASH:=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-2.0+
PKG_BUILD_DIR = $(BUILD_DIR)/libtool-bin/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/lpc21isp_$(PKG_VERSION)
PKG_SOURCE:=lpc21isp_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/lpc21isp
-PKG_MD5SUM:=0b286859a05a725647ecb1b3fe9ba606
+PKG_HASH:=9f7d80382e4b70bfa4200233466f29f73a36fea7dc604e32f05b9aa69ef591dc
PKG_CAT:=zcat
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://lttng.org/files/$(PKG_NAME)/
-PKG_MD5SUM:=ccfb50ad922cdaf54a809e2d9de23da4
+PKG_HASH:=0112d0646437163a0065022e5a788d049b690ec3fa99494c4ab6f61ced2a46af
PKG_LICENSE:=LGPL-2.1 GPL-2.0 MIT
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://lttng.org/files/$(PKG_NAME)/
-PKG_MD5SUM:=0478f60395f9564b4a19f45ce7b7f3df
+PKG_HASH:=128166445126d76da7d9f42a56dec12716732a1ed697a6cfdf40c9e135384f32
PKG_LICENSE:=LGPL-2.1 GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_URL:=@GNU/m4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
+PKG_HASH:=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-3.0+
PKG_SOURCE_URL:=@GNU/make
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=15b012617e7c44c0ed482721629577ac
+PKG_HASH:=d6e262bf3601b42d2b1e4ef8310029e1dcf20083c5446b4b7aa67081fdffc589
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-3.0+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/patch
-PKG_MD5SUM:=e3da7940431633fb65a01b91d3b7a27a
+PKG_HASH:=fd95153655d6b95567e623843a0e77b81612d502ecf78a489a4aed7867caa299
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_URL:=http://pkgconfig.freedesktop.org/releases/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=f739a28cae4e0ca291f82d1d41ef107d
+PKG_HASH:=beb43c9e064555469bd4390dcfd8030b1536e0aa103f08d7abf7ae8cac0cb001
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-2+
PKG_SOURCE:=tayga-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.litech.org/tayga/
-PKG_MD5SUM:=7a7b24165ce008df772f398d86fa280e
+PKG_HASH:=2b1f7927a9d2dcff9095aff3c271924b052ccfd2faca9588b277431a44f0009c
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_RELEASE:=1
PKG_SOURCE=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=80abb670a59dfa62413e600cee7d13fc65b9980e00579edaa2573fab8568fe93
PKG_SOURCE_URL:=https://github.com/dorimanx/exfat-nofuse.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=c44db17c3e05079116a1704f277642c9ce6f5ca4fa380c60f7e6d44509dc16be
PKG_SOURCE_URL:=https://github.com/jclehner/mtd-rw.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=e72ba0c9f5d8b8746fc306f6189a819dbb5cd0be
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_MIRROR_HASH:=e80673611e25ce63a95ea0f7a9c407868903fd78536d6c80f1763f2cf9488030
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= http://www.erlang.org/download/ \
http://erlang.mirror.su.se/
-PKG_MD5SUM:=346dd0136bf1cc28cebc140e505206bb
+PKG_HASH:=3c28820c981b30c50df8ac2a4a238e5813454fa3ed2ad530bc7948a282846474
PKG_LICENSE:=ErlPL-1.1
PKG_LICENSE_FILES:=EPLICENCE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=a6e3321ef4b3cfb4afc20bd75452e11e
+PKG_HASH:=76428e96df0ae9dd964c7a7c74c1e9a837e2f312c39e9a357fa8178f7eff80da
PKG_USE_MIPS16:=0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=61a9631784aa5d7dd8adfdfa149f0a45deaa4bf80b117e89722702c612afa081
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/amrhassan/json4lua.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.inf.puc-rio.br/~roberto/lpeg/
-PKG_MD5SUM:=fabb614eb46e370d4f6b8fd82d17ca7e
+PKG_HASH:=6aad270b91d1b1c6fd75f68e162329a04a644e50e917d55f46cc8384b7120004
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.kyne.com.au/~mark/software/download/
-PKG_MD5SUM:=24f270663e9f6ca8ba2a02cef19f7963
+PKG_HASH:=51bc69cd55931e0cba2ceae39e9efa2483f4292da3a88a1ed470eda829f6c778
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
HOST_BUILD_DEPENDS:=lua/host
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=a47a8b5f6c1cf0d9fff4770a28bf7a3efdd8f37415dde8e02528f3e63f8a7899
PKG_SOURCE_URL:=https://github.com/keplerproject/copas.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=f39a80add9f7c010ac979297652bbaaea0360a27
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=2a99faec759aeb858eca3691a40609dd2710255497011e5754c4a2282232154b
PKG_SOURCE_URL:=https://github.com/keplerproject/coxpcall.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=979257892884816c97391dfd7b0a7b30dcc8f479
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=http://lua.sqlite.org/index.cgi/zip/lsqlite3_fsl09w.zip
-PKG_MD5SUM:=8e16ef4fda82eb73295bf2f1050d14f1
+PKG_HASH:=b857df8b66d01a803378cc86e56b787958beffdc8b851ad304f4ce8c7f0e9dbb
PKG_LICENSE:=MIT
PKG_MAINTAINER:=Oskari Rauta <oskari.rauta@gmail.com>
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=b6ef5e3f04b7f2137b39931a175ee802489a2486e70537770919bcccca10e723
PKG_SOURCE_URL:=https://github.com/LuaDist/lzlib.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=79329a07d8f79c19eadd7ea2752b4c4e1574b015
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=89a186d9e8bb43a6d45207eeba2883600854ea05befda55b38f7ac215b0d5615
PKG_SOURCE_URL:=https://github.com/keplerproject/md5.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=024b65738b4434860777fc43d7cacaefea29ec60
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=947876d6b8e234a21d1e918523d66546282011718f2260d5e1f10ebf60c851cb
PKG_SOURCE_URL:=https://github.com/pkulchenko/MobDebug.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=9a03aa59696647ba3b7f9ae2f29a9f28532a4feb
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=c93aaf17c228917db2cc9ab1d9124971eecd818ec4da9d8f8609ca4a4e372beb
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/flukso/lua-mosquitto.git
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=33de8fa469f66bbf6df09c4ba4e3386c0613cc061f5adff0928d532af6905773
PKG_SOURCE_URL:=https://github.com/zhaozg/lua-openssl.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=1b950e6ff8617205cda1a1b612637ef21b9daf96
include $(TOPDIR)/rules.mk
PKG_NAME:=lua-penlight
-PKG_VERSION:=1.3.2
-PKG_RELEASE:=2
-PKG_BUILD_DIR:=$(BUILD_DIR)/Penlight-$(PKG_VERSION)
-PKG_SOURCE:=$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/stevedonovan/Penlight/archive/
-PKG_MD5SUM:=0315a39834bb6fab07741ec04ede1bf4
+PKG_VERSION:=1.5.4
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/stevedonovan/Penlight
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=cd9f25981b12022b66180a3b8df46840be1b3e2a857b8d9909b2d5601be0ead4
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE.md
TITLE:=Penlight
URL:=http://stevedonovan.github.io/Penlight/api/manual/01-introduction.md.html
DEPENDS:=+luafilesystem
- MAINTAINER:=Karl Palsson <karlp@remake.is>
+ MAINTAINER:=Karl Palsson <karlp@etactica.com>
endef
define Package/lua-penlight/description
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=7026ce5898d37a4175b7afad693d59ff1fff1a84adafcabfafd065956a03616c
PKG_SOURCE_URL:=https://github.com/keplerproject/rings.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=2b8a900f8b9dbde304859a3ac9d437795c3fdde3
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=fb2f6453537e10beb2cd99d30eb1b4259ab75452992ca8a65d621186cf320960
PKG_SOURCE_URL:=https://github.com/srdgame/librs232.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=a9d463181e7f7034fe6a55bc38e845fb04fa93ba
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=79e65bd7cb1b8ef64e125c9e57f40b7d38678599587c1894ce57838814403945
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/lgierth/lua-sha2.git
PKG_SOURCE_PROTO:=git
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=0e52ca377c135c8db1f824841e1a36c1ef7e4b4a594a5b70a2f402586901ca1f
PKG_SOURCE_URL:=https://github.com/keplerproject/wsapi.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=eed8338401196cc155e59280adbe58d78933ead0
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=0ab254d4bb8ce9556ad8fc2a1b4aef739ec3bb3e1f343400b20435e2ab8e686f
PKG_SOURCE_URL:=https://github.com/keplerproject/xavante.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=9825b905133e14d37a4c179f2d02367ab93f1ef6
PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
PKG_SOURCE:=$(_BASENAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://bitop.luajit.org/download/
-PKG_MD5SUM:=d0c1080fe0c844e8477279668e2d0d06
+PKG_HASH:=1207c9293dcd52eb9dca6538d1b87352bd510f4e760938f5048433f7f272ce99
PKG_BUILD_DIR:=$(BUILD_DIR)/$(_BASENAME)-$(PKG_VERSION)
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://matthewwild.co.uk/projects/luaexpat
-PKG_MD5SUM:=3c20b5795e7107f847f8da844fbfe2da
+PKG_HASH:=d060397960d87b2c89cf490f330508b7def1a0677bdc120531c571609fc57dc3
include $(INCLUDE_DIR)/package.mk
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=b366bce608e6f18f1b3cb32c6eb6a78d78d17c3598a0d54c493601f9aadefdd8
PKG_SOURCE_URL:=https://github.com/keplerproject/luafilesystem.git
PKG_SOURCE_VERSION:=2fd989cd6c777583be1c93616018c55b2cbb1bcf
PKG_SOURCE_PROTO:=git
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=1c25062e95064cda4866243ff6797ef597dd57260da559ca68129aa7a72a9cda
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/mrpace2/lua-i2c.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=71ff7ef8a7e0592dedb3527d4aacc68bf04af0bd
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=543994d0822515d9b7dc7cbaa7737c48258403d56a3b30e729267421265d4618
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_USE_MIPS16:=0
PKG_RELEASE=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_MIRROR_HASH:=e9b053e627edaf7ef229af176177bf2bd0edd31b69690ba7c1e6be41041ffd07
PKG_SOURCE_URL:=https://github.com/LuaLanes/lanes.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE:=release-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/luaposix/luaposix/archive/
-PKG_MD5SUM:=aa68b5c07ab1ecea81bb466c81e88056
+PKG_HASH:=4fb34dfea67f4cf3194cdecc6614c9aea67edc3c4093d34137669ea869c358e1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-release-$(PKG_VERSION)
PKG_REMOVE_FILES:=aclocal.m4
PKG_FIXUP:=autoreconf
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=e4cf874c9bce34a5accd41daaf51a3213763b8b6f7f658ca4d13a70a7ddb1c0c
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/keplerproject/luarocks.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/brunoos/luasec/archive/
-PKG_MD5SUM:=14e1aef6d2aae96bbf98afc6b6634af2
+PKG_HASH:=cef3a35c18beb8a54d9c8ce6260a4cabbd9a386de8711320d084daffad0aed5d
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION)
MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=af1e100281cee4b972df10121e37e51d53367a98
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_MIRROR_MD5SUM:=
+PKG_MIRROR_HASH:=839317e9a12c0723cf15eb5cea8d249e3f666a077585018fb8757aa1fb47d4e8
PKG_MAINTAINER:=Liu Peng <pengliu@credosemi.com>
PKG_LICENSE:=MIT
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MIRROR_HASH:=d2fa075d8bd026c41e0eb1a634ac2ad8115dee8abb070720e8e91fab51f86ee4
PKG_SOURCE_URL:=https://github.com/diegonehab/luasocket.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=b6251065656bf3e066d90d492dd06eec2c2cc76ab4b94187ce3ed9620d41f741
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/keplerproject/luasql.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/zeromq/lzmq/tar.gz/v$(PKG_VERSION)?
-PKG_MD5SUM:=c4e51a60a5a26987bdce59e45d674a9e
+PKG_HASH:=51ec00117b0570db82b1eba7b62e95d7e98c880a028584b195a98b433dd8edd1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
PKG_SOURCE_VERSION:=16e76007edf218d72df590adbd711ac6b7432845
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=b7a498ccf70e466503e72d38ae5b474e91416b6c9842fd167dff249357b0dc37
PKG_BUILD_DEPENDS:=node/host
PKG_NODE_VERSION:=4.4.5
PKG_SOURCE_VERSION:=0c37da77e48b3e2cc3a8d566822a17689de91b40
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=e531d3c92965518c60d52bc497bfa9be563ee68c3cf65c77fa55d5e9c2627367
PKG_BUILD_DEPENDS:=node/host
PKG_NODE_VERSION:=4.4.5
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=35d830b7810c87d32484d0a346621568c4849441
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=125f752d491ac10d32bab0f0d660f6f150c6a9a168b2b56bfddc2cb1d65166fc
PKG_BUILD_DEPENDS:=node/host
PKG_NODE_VERSION:=4.4.5
PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=http://registry.npmjs.org/$(PKG_NPM_NAME)/-/
-PKG_MD5SUM:=ea20a17746dd64e72d5f6f2019d9e28d
+PKG_HASH:=3bc75b4c2742f0efe8495feb28c5da1a4774df75d94836e43409ed352addfec7
PKG_BUILD_DEPENDS:=node/host
PKG_NODE_VERSION:=4.4.5
#
-# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=node
-PKG_VERSION:=v4.4.5
-PKG_RELEASE:=2
-
+PKG_VERSION:=v6.11.2
+PKG_RELEASE:=3
PKG_SOURCE:=node-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION}
-PKG_MD5SUM:=376140907bbe362f36065a30af04f020
+PKG_HASH:=04af4992238b19124ea56f1bcfda36827613a24eb3b00fc3b50f261a415a26e4
HOST_BUILD_DEPENDS:=python/host
PKG_BUILD_DEPENDS:=python/host
+
PKG_INSTALL:=1
PKG_USE_MIPS16:=0
HOST_BUILD_PARALLEL:=1
PKG_BUILD_PARALLEL:=1
-PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
-PKG_LICENSE:=
+PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>, Adrian Panella <ianchi74@outlook.com>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
SUBMENU:=Node.js
TITLE:=Node.js is a platform built on Chrome's JavaScript runtime
URL:=http://nodejs.org/
- DEPENDS:=+libpthread +librt +libstdcpp +libopenssl +zlib
+ DEPENDS:=+libstdcpp +libopenssl +zlib +USE_UCLIBC:libpthread +USE_UCLIBC:librt +NODEJS_ICU:icu
endef
define Package/node/description
NPM is the package manager for NodeJS
endef
-CPU:=$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH))))
+define Package/node/config
+ menu "Module Selection"
+
+ config NODEJS_ICU
+ bool "enable i18n features"
+ default n
+
+ endmenu
+endef
+
+NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
-MAKE_VARS += \
- DESTCPU=$(CPU)
+MAKE_VARS+= \
+ DESTCPU=$(NODEJS_CPU)
-CONFIGURE_ARGS= \
- --dest-cpu=$(CPU) \
+CONFIGURE_ARGS:= \
+ --dest-cpu=$(NODEJS_CPU) \
--dest-os=linux \
--without-snapshot \
--shared-zlib \
--shared-openssl \
--prefix=/usr
-ifneq ($(findstring arm,$(ARCH)),)
+ifneq ($(findstring arm,$(NODEJS_CPU)),)
+ifeq ($(CONFIG_SOFT_FLOAT),y)
+CONFIGURE_ARGS+= --with-arm-float-abi=softfp
+else
+
+CONFIGURE_ARGS+= --with-arm-float-abi=hard
+
+ifneq ($(findstring vfp,$(CONFIG_CPU_TYPE)),)
+ARM_FPU=vfp
+endif
+
+ifneq ($(findstring vfpv3,$(CONFIG_CPU_TYPE)),)
+ARM_FPU=vfpv3
+endif
+
+ifneq ($(findstring vfpv3-d16,$(CONFIG_CPU_TYPE)),)
+ARM_FPU=vfpv3-d16
+endif
+
+ifneq ($(findstring neon,$(CONFIG_CPU_TYPE)),)
+ARM_FPU=neon
+endif
+
+CONFIGURE_ARGS+= --with-arm-fpu=$(ARM_FPU)
+endif
+endif
+
+ifneq ($(findstring mips,$(NODEJS_CPU)),)
+ifeq ($(CONFIG_SOFT_FLOAT),y)
CONFIGURE_ARGS+= \
- $(if $(CONFIG_SOFT_FLOAT),--with-arm-float-abi=soft,--with-arm-float-abi=hard)
+ --with-mips-float-abi=soft
+endif
endif
-ifneq ($(findstring mips,$(ARCH)),)
+ifeq ($(CONFIG_NODEJS_ICU),y)
CONFIGURE_ARGS+= \
- $(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft,--with-mips-float-abi=hard)
+ --with-intl=system-icu
+else
+CONFIGURE_ARGS+= \
+ --with-intl=none
endif
HOST_CONFIGURE_VARS:=
HOST_CONFIGURE_ARGS:= \
--dest-os=linux \
--without-snapshot \
+ --shared-zlib \
--prefix=$(STAGING_DIR_HOSTPKG)
HOST_CONFIGURE_CMD:=python ./configure
--- a/lib/module.js
+++ b/lib/module.js
-@@ -453,7 +453,8 @@ Module._initPaths = function() {
- homeDir = process.env.HOME;
+@@ -625,7 +625,8 @@
+ } else {
+ prefixDir = path.resolve(process.execPath, '..', '..');
}
-
-- var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node')];
-+ var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node'),
-+ path.resolve(process.execPath, '..', '..', 'lib', 'node_modules')];
+- var paths = [path.resolve(prefixDir, 'lib', 'node')];
++ var paths = [path.resolve(prefixDir, 'lib', 'node'),
++ path.resolve(prefixDir, 'lib', 'node_modules')];
if (homeDir) {
paths.unshift(path.resolve(homeDir, '.node_libraries'));
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/L/LE/LEEJO
PKG_SOURCE:=CGI-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=48566d81f430a7f755bb4d8f426ce35d
PKG_HASH:=fefe84d4f2461e867f9be80f3f988e17bcbbcb4e306952cf2fd1dea7e4515490
PKG_LICENSE:=GPL Artistic-2.0
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/R/RU/RURBAN/
PKG_SOURCE:=Compress-Bzip2-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=d5ef04d1e51fe45743b3044abad967d2
+PKG_HASH:=7956ac627fb373fae6effede3d21b3157122800224491b124afdd7bb426c8c3f
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/T/TI/TIMB/
PKG_SOURCE:=DBI-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=4ad15a9c2cc9b68e3fe1f5cadf9cdb30
+PKG_HASH:=250712f385864818abfba409420d16d9ee61f1cc73ac85159d054a5ee86d1450
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/C/CO/COOK/
PKG_SOURCE:=Device-SerialPort-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=82c698151f934eb28c65d1838cee7d9e
+PKG_HASH:=d392567cb39b4ea606c0e0acafd8ed72320311b995336ece5fcefcf9b150e9d7
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Paul Oranje <por@xs4all.nl>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GW/GWADEJ/
PKG_SOURCE:=Device-USB-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=aa91bee777f7ed7a18225a84f8795344
+PKG_HASH:=fac2eb4f9e8db08b46d734ba8a2076598f974c274a91b248613fcecd7c9fc175
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
PKG_SOURCE:=Encode-Locale-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=fcfdb8e4ee34bcf62aed429b4a23db27
+PKG_HASH:=176fa02771f542a4efb1dbc2a4c928e8f4391bf4078473bd6040d8f11adb0ec1
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
PKG_SOURCE:=File-Listing-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=83f636b477741f3a014585bb9cc079a6
+PKG_HASH:=1e0050fcd6789a2179ec0db282bf1e90fb92be35d1171588bd9c47d52d959cf5
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GW/GWYN
PKG_SOURCE:=File-ShareDir-Install-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=37fb7fa72ce7184516dd022aba62f524
+PKG_HASH:=708af71dec4dfb5a8cf9a5e863b566714c3f65f0a76722302de5a07ee202e6f7
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
PKG_SOURCE:=HTML-Form-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=fa6c2680207ed4fef5ea2ef09c210614
+PKG_HASH:=68c01d94f005d5ca9c4d55ad2a1bf3a8d034a5fc6db187d91a4c42f3fdc9fc36
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS/
PKG_SOURCE:=HTML-Parser-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=eb7505e5f626913350df9dd4a03d54a8
+PKG_HASH:=ec28c7e1d9e67c45eca197077f7cdc41ead1bb4c538c7f02a3296a4bb92f608b
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/P/PE/PETDANCE/
PKG_SOURCE:=HTML-Tagset-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=d2bfa18fe1904df7f683e96611e87437
+PKG_HASH:=adb17dac9e36cd011f5243881c9739417fd102fce760f8de4e9be4c7131108e2
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_NAME:=perl-html-tree
PKG_VERSION:=3.23
PKG_RELEASE:=4
-PKG_MD5SUM:=6352f50be402301f79b580dd235d7762
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/P/PE/PETEK/
PKG_SOURCE:=HTML-Tree-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=6352f50be402301f79b580dd235d7762
+PKG_HASH:=f5175acf262f3710dce899796ea3e353049939400b100706d03df2f08803c8de
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
PKG_SOURCE:=HTTP-Cookies-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=ecfd0eeb88512033352c2f13c9580f03
+PKG_HASH:=f5d3ade383ce6389d80cb0d0356b643af80435bb036afd8edce335215ec5eb20
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
PKG_SOURCE:=HTTP-Daemon-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=ed0ae02d25d7f1e89456d4d69732adc2
+PKG_HASH:=43fd867742701a3f9fcc7bd59838ab72c6490c0ebaf66901068ec6997514adc2
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
PKG_SOURCE:=HTTP-Date-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=52b7a0d5982d61be1edb217751d7daba
+PKG_HASH:=e8b9941da0f9f0c9c01068401a5e81341f0e3707d1c754f8e11f42a7e629e333
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER
PKG_SOURCE:=HTTP-Message-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=4ed7add10daea3ab30abfeab6d03872f
+PKG_HASH:=e7b368077ae6a188d99920411d8f52a8e5acfb39574d4f5c24f46fd22533d81b
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
PKG_SOURCE:=HTTP-Negotiate-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=1236195250e264d7436e7bb02031671b
+PKG_HASH:=1c729c1ea63100e878405cda7d66f9adfd3ed4f1d6cacaca0ee9152df728e016
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/B/BP/BPS
PKG_SOURCE:=HTTP-Server-Simple-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=ef736daddc7a32a29207fa4ed5f5d62e
+PKG_HASH:=b9dc5c9f12c16ca39a96f0ede1e27a18a5594274ff8f583000788a7fca136dfb
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/I/IN/INGY
PKG_SOURCE:=Inline-C-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=c0fbfdd058075c9271a1384c822c9a87
+PKG_HASH:=22e9713b4d331d3c49e4a9a9f012dbf84cec25a01e5da4f57091be287f1a9a35
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/I/IN/INGY
PKG_SOURCE:=Inline-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=510bbac46e727bcaf240b7feac2646c9
+PKG_HASH:=7e2bd984b1ebd43e336b937896463f2c6cb682c956cbd2c311a464363d2ccef6
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/C/CJ/CJM
PKG_SOURCE:=IO-HTML-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=3f8958718844dc96b9f6946f21d70d22
+PKG_HASH:=ea78d2d743794adc028bc9589538eb867174b4e165d7d8b5f63486e6b828e7e0
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/S/SC/SCHWIGON/lockfile-simple/
PKG_SOURCE:=LockFile-Simple-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=4421283b4f32549e5299963734170044
+PKG_HASH:=45c77896b2a5a0a45f6202a6f813f437ff8b283f84a1c60d0c4f3730802af3a2
PKG_LICENSE:=GPL-2.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
PKG_SOURCE:=LWP-MediaTypes-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=8c5f25fb64b974d22aff424476ba13c9
+PKG_HASH:=18790b0cc5f0a51468495c3847b16738f785a2d460403595001e0b932e5db676
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER
PKG_SOURCE:=Net-HTTP-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=3d84d17f64c7316d69e7eb7b4e292b9a
+PKG_HASH:=52762b939d84806908ba544581c5708375f7938c3c0e496c128ca3fbc425e58d
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/J/JR/JROGERS/
PKG_SOURCE:=Net-Telnet-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=d2514080116c1b0fa5f96295c84538e3
+PKG_HASH:=e64d567a4e16295ecba949368e7a6b8b5ae2a16b3ad682121d9b007dc5d2a37a
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/J/JT/JTBRAUN
PKG_SOURCE:=Parse-RecDescent-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=98f582240556a4a92e5d57e480f9d39d
+PKG_HASH:=226590d3850cd1678deb0190d5207b3477fb9070a8ca6f18d8999daf44485930
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/D/DA/DAGOLDEN
PKG_SOURCE:=Sub-Uplevel-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=5d0752dbfa94d0c91b25a264f47f5675
+PKG_HASH:=2dcca582a7ea5bada576eb27c4be1d1b064fb22175bdbd6d696c45d083560505
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/L/LE/LEONT/
PKG_SOURCE:=Test-Harness-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=4c8d9c77e8e06ca96c7383c05c8f3616
+PKG_HASH:=e7566f13b041d028b56f184b77ec2545ec6f0bb5a0f8f5368f7e4a08b496b63e
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/C/CH/CHORNY
PKG_SOURCE:=Test-Warn-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=8306b998a96d2cc69266b5248d550472
+PKG_HASH:=8197555b94189d919349a03f7058f83861f145af9bee59f505bfe47562144e41
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
PKG_SOURCE:=URI-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=247c3da29a794f72730e01aa5a715daf
+PKG_HASH:=9c8eca0d7f39e74bbc14706293e653b699238eeb1a7690cc9c136fb8c2644115
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/S/SZ/SZBALINT/
PKG_SOURCE:=WWW-Curl-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=997ac81cd6b03b30b36f7cd930474845
+PKG_HASH:=52ffab110e32348d775f241c973eb56f96b08eedbc110d77d257cdb0a24ab7ba
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=WWW-Mechanize-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
-PKG_MD5SUM:=9a4b9c8827f519908ef0a0d2b8ae96fa
+PKG_HASH:=5310051feb66c6ef9f7a4c070c66ec6092932129fc9cd18bba009ce999b7930b
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS
PKG_SOURCE:=WWW-RobotRules-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=b7186e8b8b3701e70c22abf430742403
+PKG_HASH:=46b502e7a288d559429891eeb5d979461dd3ecc6a5c491ead85d165b6e03a51e
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
PKG_SOURCE:=libwww-perl-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=6888c9d8728cd6f3ea3c9754461c9f94
+PKG_HASH:=6f349d45c21b1ec0501c4437dfcb70570940e6c3d5bff783bd91d4cddead8322
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/T/TO/TODDR/
PKG_SOURCE:=XML-Parser-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=af4813fe3952362451201ced6fbce379
+PKG_HASH:=1ae9d07ee9c35326b3d9aad56eae71a6730a73a116b9fe9e8a4758b7cc033216
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
https://mirrors.sonic.net/cpan/src/5.0 \
https://www.cpan.org/src/5.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=af6a84c7c3e2b8b269c105a5db2f6d53
PKG_HASH:=03a77bac4505c270f1890ece75afc7d4b555090b41aa41ea478747e23b2afb3f
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_VERSION:=3.1.0
PKG_RELEASE:=3
-PKG_MD5SUM:=e3de67b156e7d5f6c2e5eb1e2b5f0acceb7004f1260d68c9f8b2c0f9629aabf0
+PKG_HASH:=e3de67b156e7d5f6c2e5eb1e2b5f0acceb7004f1260d68c9f8b2c0f9629aabf0
PKG_NAME:=php7-pecl-http
PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_VERSION:=9e72744ce6224beafc7b54ce2a3a990f1c552a5a
PKG_SOURCE_SUBDIR:=$(PECL_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PECL_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=b81f02ef7f990f4ce3f859e22a85b7430188fc6f1395cd8fba82ef237ba62d8b
PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
PKG_VERSION:=2.0.1
PKG_RELEASE:=2
-PKG_MD5SUM:=19f9517210a87e18cc09faed262e1522
+PKG_HASH:=ce136875650e22d28804a41a62a5325fff85318e559626d63c5b8875fb2e4529
PKG_NAME:=php7-pecl-propro
PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
PKG_VERSION:=2.0.0
PKG_RELEASE:=2
-PKG_MD5SUM:=bc465eb5caa9d0f09cced121a8ac2e8e
+PKG_HASH:=95a59ea0dc3fc172805a6acd8327b122dd159b0a85b253826166457a05efa411
PKG_NAME:=php7-pecl-raphf
PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
include $(TOPDIR)/rules.mk
PKG_NAME:=php
-PKG_VERSION:=7.1.6
-PKG_RELEASE:=2
+PKG_VERSION:=7.1.9
+PKG_RELEASE:=1
PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.php.net/distributions/
-PKG_MD5SUM:=eafc7a79cc8cc62c9292c96f9c9ccf90
-PKG_HASH:=01584dc521ab7ec84b502b61952f573652fe6aa00c18d6d844fb9209f14b245b
+PKG_HASH:=ec9ca348dd51f19a84dc5d33acfff1fba1f977300604bdac08ed46ae2c281e8c
PKG_FIXUP:=libtool autoreconf
PKG_BUILD_PARALLEL:=1
--- /dev/null
+commit 4d77af8d7d349b7b9e43082deb47c1469f450115
+Author: Philip Prindeville <philipp@redfish-solutions.com>
+Date: Fri Aug 18 12:05:44 2017 -0600
+
+ Backport of fix for Issue #74860
+
+diff --git a/configure.in b/configure.in
+index 9acf42b..559a274 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1470,7 +1470,7 @@ PHP_ADD_SOURCES(main, main.c snprintf.c spprintf.c php_sprintf.c \
+ php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
+ strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
+ network.c php_open_temporary_file.c \
+- output.c getopt.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
++ output.c getopt.c php_syslog.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
+
+ PHP_ADD_SOURCES_X(main, fastcgi.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, PHP_FASTCGI_OBJS, no)
+
+diff --git a/ext/standard/php_smart_string.h b/ext/standard/php_smart_string.h
+index adb78c0..8d90688 100644
+--- a/ext/standard/php_smart_string.h
++++ b/ext/standard/php_smart_string.h
+@@ -146,4 +146,8 @@
+ #define smart_string_sets(dest, src) \
+ smart_string_setl((dest), (src), strlen(src));
+
++#define smart_string_reset(dest) do { \
++ (dest)->len = 0; \
++} while (0)
++
+ #endif
+diff --git a/main/php_syslog.c b/main/php_syslog.c
+new file mode 100644
+index 0000000..43d1f56
+--- /dev/null
++++ b/main/php_syslog.c
+@@ -0,0 +1,80 @@
++/*
++ +----------------------------------------------------------------------+
++ | PHP Version 7 |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2017 The PHP Group |
++ +----------------------------------------------------------------------+
++ | This source file is subject to version 3.01 of the PHP license, |
++ | that is bundled with this package in the file LICENSE, and is |
++ | available through the world-wide-web at the following url: |
++ | http://www.php.net/license/3_01.txt |
++ | If you did not receive a copy of the PHP license and are unable to |
++ | obtain it through the world-wide-web, please send a note to |
++ | license@php.net so we can mail you a copy immediately. |
++ +----------------------------------------------------------------------+
++ | Author: Philip Prindeville <philipp@redfish-solutions.com> |
++ +----------------------------------------------------------------------+
++*/
++
++/* $Id$ */
++
++#include <stdio.h>
++#include <string.h>
++#include <assert.h>
++#include <stdlib.h>
++#include "php.h"
++#include "php_syslog.h"
++
++#include "zend.h"
++#include "ext/standard/php_smart_string.h"
++
++/*
++ * The SCO OpenServer 5 Development System (not the UDK)
++ * defines syslog to std_syslog.
++ */
++
++#ifdef HAVE_STD_SYSLOG
++#define syslog std_syslog
++#endif
++
++PHPAPI void php_syslog(int priority, const char *format, ...) /* {{{ */
++{
++ const char *ptr;
++ unsigned char c;
++ char *message = NULL;
++ smart_string sbuf = {0};
++ va_list args;
++
++ va_start(args, format);
++ vspprintf(&message, 0, format, args);
++ va_end(args);
++
++ for (ptr = message; ; ++ptr) {
++ c = *ptr;
++ if (c == '\0') {
++ syslog(priority, "%.*s", (int)sbuf.len, sbuf.c);
++ break;
++ }
++
++ if (c != '\n')
++ smart_string_appendc(&sbuf, c);
++ else {
++ syslog(priority, "%.*s", (int)sbuf.len, sbuf.c);
++ smart_string_reset(&sbuf);
++ }
++ }
++
++ efree(message);
++ smart_string_free(&sbuf);
++}
++
++/* }}} */
++
++/*
++ * Local variables:
++ * tab-width: 4
++ * c-basic-offset: 4
++ * End:
++ * vim600: sw=4 ts=4 fdm=marker
++ * vim<600: sw=4 ts=4
++ */
+diff --git a/main/php_syslog.h b/main/php_syslog.h
+index 33f52a3..a09f98c 100644
+--- a/main/php_syslog.h
++++ b/main/php_syslog.h
+@@ -21,6 +21,8 @@
+ #ifndef PHP_SYSLOG_H
+ #define PHP_SYSLOG_H
+
++#include "php.h"
++
+ #ifdef PHP_WIN32
+ #include "win32/syslog.h"
+ #else
+@@ -30,23 +32,8 @@
+ #endif
+ #endif
+
+-/*
+- * The SCO OpenServer 5 Development System (not the UDK)
+- * defines syslog to std_syslog.
+- */
+-
+-#ifdef syslog
+-
+-#ifdef HAVE_STD_SYSLOG
+-#define php_syslog std_syslog
+-#endif
+-
+-#undef syslog
+-
+-#endif
+-
+-#ifndef php_syslog
+-#define php_syslog syslog
+-#endif
++BEGIN_EXTERN_C()
++PHPAPI void php_syslog(int, const char *format, ...);
++END_EXTERN_C()
+
+ #endif
+diff --git a/win32/build/config.w32 b/win32/build/config.w32
+index 1269c6e..f766e53 100644
+--- a/win32/build/config.w32
++++ b/win32/build/config.w32
+@@ -237,7 +237,8 @@ ADD_FLAG("CFLAGS_BD_ZEND", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
+ ADD_SOURCES("main", "main.c snprintf.c spprintf.c getopt.c fopen_wrappers.c \
+ php_scandir.c php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
+ strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c network.c \
+- php_open_temporary_file.c output.c internal_functions.c php_sprintf.c");
++ php_open_temporary_file.c output.c internal_functions.c php_sprintf.c \
++ php_syslog.c");
+ ADD_FLAG("CFLAGS_BD_MAIN", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
+ ADD_SOURCES("win32", "inet.c fnmatch.c sockets.c");
+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/56/41/c095a77eb2dd69bf278dd664a97d3416af04e9ba1a00b8c138f772741d31/
-PKG_MD5SUM:=e385b2c5a7193cff24c689b31e1124dc
+PKG_HASH:=903a7b87b74635244548b30d30db4c8947fe64c5198f58899ddcd3a13c23bb26
PKG_BUILD_DEPENDS:=python python3
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://pypi.python.org/packages/source/c/chardet/
-PKG_MD5SUM:=25274d664ccb5130adae08047416e1a8
+PKG_HASH:=e53e38b3a4afe6d1132de62b7400a4ac363452dc5dfcf8d88e8e0cce663c68aa
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/34/b9/d07195652ab494b026f7cb0341dd6e5f2e6e39be177abe05e2cec8bd46e4/
-PKG_MD5SUM:=cc11511a47088bc56531df67cd5d6261
+PKG_HASH:=6a4d9aea683b4c224d97ab8ee11ad2d29a37072c0c6c509896dd9857466fb261
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=django_compressor-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/38/58/03098a826062b856956c7169a8f778ec2b8e2767ddc63da0629062df5621/
PKG_BUILD_DIR:=$(BUILD_DIR)/django_compressor-$(PKG_VERSION)/
-PKG_MD5SUM:=5e74141076b70272149ed07e6ce0ea56
+PKG_HASH:=9200400046ee00a5c1b4e2fbab97704fd2514f9b59d5649c8a365c3cf06c82e8
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/0c/19/74c6bbf29a7882bab377db7a4ca30b43e09173dc1e6cabe163dc8d6a3931/
-PKG_MD5SUM:=2e197701ed93082e5fa41df0f4742294
+PKG_HASH:=212eba25cc7d4690abd802ec81fb2a511f68bc3eab1dd45ea805296449377b48
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/e4/b2/a079f0a2218e0eb7892edbf404e0bbfbb281a6bbf06966b775f5142ed159/
-PKG_MD5SUM:=2e5e737a3f93f3b5d7ae6026b1340167
+PKG_HASH:=6c0afd5554739365b55d86e285cf966cc3a45682fff963463364ea1f6511ca3e
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://pypi.python.org/packages/source/d/django-picklefield/
-PKG_MD5SUM:=b2c17ca9e03704ce33890e6aefc7b2e5
+PKG_HASH:=fab48a427c6310740755b242128f9300283bef159ffee42d3231a274c65d9ae2
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=django-post_office-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/52/25/cc0cfe923f183d7c19b162cac3bf8430ddaed7bad28202b8f93a97d248a4/
PKG_BUILD_DIR:=$(BUILD_DIR)/django-post_office-$(PKG_VERSION)/
-PKG_MD5SUM:=437bf62cef06381d346ae2bc087c0e3c
+PKG_HASH:=bfb3ff26de5b668c91453ee8d930ff0bfe397849fd5508ff3e1216c3b46d6449
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=djangorestframework-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/e9/24/86dfe19fb82a40a3d7a4c50371a8bd85b9277d3506698bf332a6d41d08f6/
PKG_BUILD_DIR:=$(BUILD_DIR)/djangorestframework-$(PKG_VERSION)
-PKG_MD5SUM:=979808c387dad8d0ebb6025c39dc7b94
+PKG_HASH:=f995a35ae22f354d2a9a42ee6d2c059c101f826b1485ed46781677895ad25ee5
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/86/6b/2c2e86a7e144ba7b064119eaafb2c8c67665c2a0e722f0819daa9657e551/
-PKG_MD5SUM:=61e22a6f2399f9f829308e4d91b36ee0
+PKG_HASH:=f37cff511dd7d6f0c0b465c685026b660aea2ae178cc82a1b4c96c1b1e718c2a
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=d3d12fc11da56e4ea8af37a22a9a0aa6579ab2d5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=7d8c4e58486c3a539f17437b3a802b67d53401971eceac2be50c47bcc756c27b
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://pypi.python.org/packages/source/e/et_xmlfile/
-PKG_MD5SUM:=f47940fd9d556375420b2e276476cfaf
+PKG_HASH:=614d9722d572f6246302c4491846d2c393c199cfa4edc9af593437691683335b
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://pypi.python.org/packages/source/f/flup/
-PKG_MD5SUM:=24dad7edc5ada31dddd49456ee8d5254
+PKG_HASH:=4bad317a5fc1ce3d4fe5e9b6d846ec38a8023e16876785d4f88102f2c8097dd9
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/84/ce/7ea5396efad1cef682bbc4068e72a0276341d9d9d0f501da609fab9fcb80/
-PKG_MD5SUM:=338e5e8a83ea0f0625f768dba4597530
+PKG_HASH:=813f6916d18a4c8e90efde72f419308b357692f81333cb1125f80013d22fb618
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://pypi.python.org/packages/source/j/jdcal/
-PKG_MD5SUM:=ab8d5ba300fd1eb01514f363d19b1eb9
+PKG_HASH:=5ebedb58b95ebabd30f56abef65139c6f69ec1687cf1d2f3a7c503f9a2cdfa4d
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_MIRROR_HASH:=b9642fb3d01a7423d64ecc6ea81b4fac81a9112494727c8ca7744bd8e3ac120b
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_PARALLEL:=1
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_MIRROR_HASH:=cd431a94664277ac3f80a25b3f6ebc415b281c9265faad154bd0b3fbe638167e
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/56/c6/a2a7c36196e4732acceca093ce5961db907f5a855b557d6a727a7f59b8b4/
-PKG_MD5SUM:=28b6b5f74f01e6249e8c7f526c57a2e7
+PKG_HASH:=2fe9ba182b687acf7e4660b39bd91d703c0bf934f8295c182d04ecd2345c6e26
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=aab33141f381d5577cdef9033b7fdff79122a10c
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=e7c36bcf89614337d9abc4d07780da0b346a745be7a9aa55b398fa427549273c
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
--- /dev/null
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-asn1crypto
+PKG_VERSION:=0.22.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=asn1crypto-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/67/14/5d66588868c4304f804ebaff9397255f6ec5559e46724c2496e0f26e68d6
+PKG_HASH:=cbbadd640d3165ab24b06ef25d1dca09a3441611ac15f6a6b452474fdf0aed1a
+
+PKG_LICENSE:=MIT
+PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-asn1crypto-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+$(call include_mk, python3-package.mk)
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-asn1crypto/Default
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ URL:=https://github.com/wbond/asn1crypto
+endef
+
+define Package/python-asn1crypto
+$(call Package/python-asn1crypto/Default)
+ TITLE:=python-asn1crypto
+ DEPENDS:=+PACKAGE_python-asn1crypto:python-light
+ VARIANT:=python
+endef
+
+define Package/python3-asn1crypto
+$(call Package/python-asn1crypto/Default)
+ TITLE:=python3-asn1crypto
+ DEPENDS:=+PACKAGE_python3-asn1crypto:python3-light
+ VARIANT:=python3
+endef
+
+define Package/python-asn1crypto/description
+Fast ASN.1 parser and serializer with definitions for
+private keys, public keys, certificates, CRL, OCSP,
+CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP
+endef
+
+define Package/python3-asn1crypto/description
+$(call Package/python-asn1crypto/description)
+.
+(Variant for Python3)
+endef
+
+$(eval $(call PyPackage,python-asn1crypto))
+$(eval $(call BuildPackage,python-asn1crypto))
+$(eval $(call Py3Package,python3-asn1crypto))
+$(eval $(call BuildPackage,python3-asn1crypto))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/6b/71/1682316894ed80b362b9102e7a10997136d8dc1213c36a9f0515c451373a
-PKG_MD5SUM:=442b73d049af046ced010671b7bfd0e9
+PKG_HASH:=136f2ec0f94ec77ff2990830feee965d608cab1e8922370e3abdded383d52001
PKG_BUILD_DEPENDS:=python python-setuptools
include $(TOPDIR)/rules.mk
-PKG_NAME:=cffi
-PKG_VERSION:=1.8.3
-PKG_RELEASE:=2
+PKG_NAME:=python-cffi
+PKG_VERSION:=1.10.0
+PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/0a/f3/686af8873b70028fccf67b15c78fd4e4667a3da995007afc71e786d61b0a
-PKG_HASH:=c321bd46faa7847261b89c0469569530cad5a41976bb6dba8202c0159f476568
+PKG_SOURCE:=cffi-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/5b/b9/790f8eafcdab455bcd3bd908161f802c9ce5adbf702a83aa7712fcc345b7
+PKG_HASH:=b3b02911eb1f6ada203b0763ba924234629b51586f72a21faacc638269f4ced5
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
-PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
-
-HOST_BUILD_DEPENDS:=libffi/host python-pycparser/host
-ifdef CONFIG_PACKAGE_python-cffi
-HOST_BUILD_DEPENDS+=python/host
-endif
-ifdef CONFIG_PACKAGE_python3-cffi
-HOST_BUILD_DEPENDS+=python3/host
-endif
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-cffi-$(PKG_VERSION)
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+HOST_PYTHON_PACKAGE_BUILD_DEPENDS:="cffi==$(PKG_VERSION)"
+HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="cffi==$(PKG_VERSION)"
-include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
$(call include_mk, python3-package.mk)
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
define Package/python-cffi/Default
SECTION:=lang
CATEGORY:=Languages
define Package/python-cffi
$(call Package/python-cffi/Default)
TITLE:=python-cffi
- DEPENDS+=+python-light +python-pycparser
+ DEPENDS+=+PACKAGE_python-cffi:python-light +PACKAGE_python-cffi:python-pycparser
VARIANT:=python
endef
define Package/python3-cffi
$(call Package/python-cffi/Default)
TITLE:=python3-cffi
- DEPENDS+=+python3-light +python3-pycparser
+ DEPENDS+=+PACKAGE_python3-cffi:python3-light +PACKAGE_python3-cffi:python3-pycparser
VARIANT:=python3
endef
(Variant for Python3)
endef
-ifdef CONFIG_PACKAGE_python-cffi
-define Host/Compile/python-cffi
- $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
-endef
-endif
-
-ifdef CONFIG_PACKAGE_python3-cffi
-define Host/Compile/python3-cffi
- $(call Build/Compile/HostPy3Mod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
-endef
-endif
-
-define Host/Compile
-$(call Host/Compile/python-cffi)
-$(call Host/Compile/python3-cffi)
-endef
-
-define Host/Install
-endef
-
-$(eval $(call HostBuild))
-
$(eval $(call PyPackage,python-cffi))
$(eval $(call BuildPackage,python-cffi))
PKG_SOURCE:=crcmod-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://pypi.python.org/packages/source/c/crcmod/
-PKG_MD5SUM:=2d5b92117d958dcead94f9e17f54cd32
+PKG_HASH:=dc7051a0db5f2bd48665a990d3ec1cc305a466a77358ca4492826f41f283601e
PKG_BUILD_DIR:=$(BUILD_DIR)/crcmod-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=python
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/
-PKG_MD5SUM:=55a61a054aa66812daf5161a0d5d7eda
+PKG_HASH:=f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c
PKG_LICENSE:=Public Domain
PKG_LICENSE_FILES:=COPYRIGHT
include $(TOPDIR)/rules.mk
-PKG_NAME:=cryptography
-PKG_VERSION:=1.5.1
-PKG_RELEASE:=2
+PKG_NAME:=python-cryptography
+PKG_VERSION:=2.0.3
+PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/21/e1/37fc14f9d77924e84ba0dcb88eb8352db914583af229287c6c965d66ba0d
-PKG_MD5SUM:=66a3e01f5f436d2413ef47b7e6bb7729
-
-PKG_BUILD_DEPENDS:=python-cffi/host
+PKG_SOURCE:=cryptography-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/9c/1a/0fc8cffb04582f9ffca61b15b0681cf2e8588438e55f61403eb9880bd8e0
+PKG_HASH:=d04bb2425086c3fe86f7bc48915290b13e798497839fbb18ab7f6dffcf98cc3a
PKG_LICENSE:=Apache-2.0 BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE.APACHE LICENSE.BSD
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-cryptography-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
+$(call include_mk, python3-package.mk)
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-cryptography/Default
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ URL:=https://github.com/pyca/cryptography
+ DEPENDS:=+libopenssl
+endef
define Package/python-cryptography
- SECTION:=lang
- CATEGORY:=Languages
- SUBMENU:=Python
- TITLE:=python-cryptography
- URL:=https://github.com/pyca/cryptography
- DEPENDS:=+libopenssl +python +python-cffi +python-enum34 +python-idna +python-ipaddress +python-pyasn1 +python-six +python-setuptools
+$(call Package/python-cryptography/Default)
+ TITLE:=python-cryptography
+ DEPENDS+= \
+ +PACKAGE_python-cryptography:python \
+ +PACKAGE_python-cryptography:python-cffi \
+ +PACKAGE_python-cryptography:python-enum34 \
+ +PACKAGE_python-cryptography:python-idna \
+ +PACKAGE_python-cryptography:python-ipaddress \
+ +PACKAGE_python-cryptography:python-asn1crypto \
+ +PACKAGE_python-cryptography:python-six
+ VARIANT:=python
+endef
+
+define Package/python3-cryptography
+$(call Package/python-cryptography/Default)
+ TITLE:=python3-cryptography
+ DEPENDS+= \
+ +PACKAGE_python3-cryptography:python3 \
+ +PACKAGE_python3-cryptography:python3-cffi \
+ +PACKAGE_python3-cryptography:python3-idna \
+ +PACKAGE_python3-cryptography:python3-asn1crypto \
+ +PACKAGE_python3-cryptography:python3-six
+ VARIANT:=python3
endef
define Package/python-cryptography/description
standard library". It supports Python 2.6-2.7, Python 3.3+, and PyPy 2.6+.
endef
-define PyPackage/python-cryptography/filespec
-+|$(PYTHON_PKG_DIR)
--|$(PYTHON_PKG_DIR)/cryptography/hazmat/backends/commoncrypto
--|$(PYTHON_PKG_DIR)/cryptography/hazmat/bindings/commoncrypto
-endef
-
-define Build/Compile
- $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
+define Package/python3-cryptography/description
+$(call Package/python-cryptography/description)
+.
+(Variant for Python3)
endef
$(eval $(call PyPackage,python-cryptography))
$(eval $(call BuildPackage,python-cryptography))
+$(eval $(call Py3Package,python3-cryptography))
+$(eval $(call BuildPackage,python3-cryptography))
--- /dev/null
+diff --git a/src/_cffi_src/openssl/ssl.py b/src/_cffi_src/openssl/ssl.py
+index 8bda4e0..aa81060 100644
+--- a/src/_cffi_src/openssl/ssl.py
++++ b/src/_cffi_src/openssl/ssl.py
+@@ -595,9 +595,6 @@ static const long TLS_ST_OK = 0;
+
+ #if defined(OPENSSL_NO_DTLS) || CRYPTOGRAPHY_OPENSSL_LESS_THAN_102
+ static const long Cryptography_HAS_GENERIC_DTLS_METHOD = 0;
+-const SSL_METHOD *(*DTLS_method)(void) = NULL;
+-const SSL_METHOD *(*DTLS_server_method)(void) = NULL;
+-const SSL_METHOD *(*DTLS_client_method)(void) = NULL;
+ #else
+ static const long Cryptography_HAS_GENERIC_DTLS_METHOD = 1;
+ #endif
--- /dev/null
+#
+# This is free software, licensed under the GNU General Public License v2.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pycurl
+PKG_VERSION:=7.43.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Waldemar Konik <informatyk74@interia.pl>
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILE=COPYING-LGPL
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://dl.bintray.com/pycurl/pycurl/
+PKG_HASH:=aa975c19b79b6aa6c0518c0cc2ae33528900478f0b500531dbcdbf05beec584c
+
+PKG_BUILD_DEPENDS:=python libcurl
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-curl
+ CATEGORY:=Languages
+ SECTION:=lang
+ SUBMENU:=Python
+ TITLE:=Python module interface to the cURL library
+ URL:=http://pycurl.io/
+ DEPENDS:=+python +libcurl
+endef
+
+define Package/python-curl/description
+Python module interface to the cURL library.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/python-curl/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-curl))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/51/fc/39a3fbde6864942e8bb24c93663734b74e281b984d1b8c4f95d64b0c21f6/
-PKG_MD5SUM:=6e38f91e8c94c15a79ce22768dfeca87
+PKG_HASH:=62a2f8df3d66f878373fd0072eacf4ee52194ba302e00082828e0d263b0418d2
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_RELEASE:=2
PKG_VERSION:=1.15.0
PKG_SOURCE_URL:=http://www.dnspython.org/kits/$(PKG_VERSION)
-PKG_MD5SUM:=63a679089822fb86127867c315286dc5
+PKG_HASH:=11598ae5735746e63921f8eebdfdee4a2e7d0ba842ebd57ba02682d4aed8244b
PKG_SOURCE:=dnspython-$(PKG_VERSION).tar.gz
PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
PKG_LICENSE:=ISC
--- /dev/null
+#
+# Copyright (C) 2017 Andrew McConachie
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-dpkt
+PKG_VERSION:=1.91
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Andrew McConachie <andrew@depht.com>
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/kbandla/dpkt.git
+PKG_SOURCE_VERSION:=6cd0909d613a66033ecdefaca6cc07cfa7d46d6b
+PKG_MIRROR_HASH:=fe8657552b1dbaf8b9eba50168730e200567dc88a06932aa1cf60dc93211d16b
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-dpkt
+ SECTION:=language-python
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ TITLE:=python-dpkt
+ URL:=https://dpkt.readthedocs.io/en/latest/
+ DEPENDS:=+python
+endef
+
+define Package/python-dpkt/description
+ dpkt is a python module for fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols
+ https://pypi.python.org/pypi/dpkt
+ https://github.com/kbandla/dpkt
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,\
+ install --prefix=/usr --root="$(PKG_INSTALL_DIR)" \
+ )
+endef
+
+$(eval $(call PyPackage,python-dpkt))
+$(eval $(call BuildPackage,python-dpkt))
PKG_SOURCE:=egenix-mx-base-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.egenix.com/python/
-PKG_MD5SUM:=9d9d3a25f9dc051a15e97f452413423b
+PKG_HASH:=0da55233e45bc3f88870e62e60a79c2c86bad4098b8128343fd7be877f44a3c0
PKG_BUILD_DIR:=$(BUILD_DIR)/egenix-mx-base-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=python
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876
-PKG_MD5SUM:=5f13a0841a61f7fc295c514490d120d0
+PKG_HASH:=8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1
PKG_BUILD_DEPENDS:=python python-setuptools
--- /dev/null
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=python-evdev
+PKG_VERSION:=0.7.0
+PKG_RELEASE:=1
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_MAINTAINER:=Paulo Costa <me@paulo.costa.nom.br>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_SOURCE:=evdev-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/67/15/eac376f3e1fc1960a54439c21459b2582e68340001aff83b4ace9e5bd110
+PKG_HASH:=57edafc469a414f58b51af1bfb9ee2babb9f626dd2df530d71c1176871850aa1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-evdev-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+$(call include_mk, python3-package.mk)
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-evdev/Default
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ URL:=https://github.com/gvalkov/python-evdev
+endef
+
+define Package/python-evdev
+$(call Package/python-evdev/Default)
+ TITLE:=python-evdev
+ DEPENDS:= \
+ +PACKAGE_python-evdev:python-light \
+ +PACKAGE_python-evdev:python-ctypes
+ VARIANT:=python
+endef
+
+define Package/python3-evdev
+$(call Package/python-evdev/Default)
+ TITLE:=python3-evdev
+ DEPENDS:= \
+ +PACKAGE_python3-evdev:python3-light \
+ +PACKAGE_python3-evdev:python3-ctypes
+ VARIANT:=python3
+endef
+
+
+define Package/python-evdev/description
+ Bindings to the Linux input handling subsystem
+endef
+
+define Package/python3-evdev/description
+$(call Package/python-evdev/description)
+.
+(Variant for Python3)
+endef
+
+define PyBuild/Compile
+ $(call Build/Compile/PyMod,, build \
+ build_ecodes --evdev-headers="$(LINUX_DIR)/include/uapi/linux/input.h:$(LINUX_DIR)/include/uapi/linux/input-event-codes.h" \
+ build_ext \
+ install --root="$(PKG_INSTALL_DIR)" --prefix="/usr")
+endef
+
+define Py3Build/Compile
+ $(call Build/Compile/Py3Mod,, build \
+ build_ecodes --evdev-headers="$(LINUX_DIR)/include/uapi/linux/input.h:$(LINUX_DIR)/include/uapi/linux/input-event-codes.h" \
+ build_ext \
+ install --root="$(PKG_INSTALL_DIR)" --prefix="/usr")
+endef
+
+$(eval $(call PyPackage,python-evdev))
+$(eval $(call BuildPackage,python-evdev))
+$(eval $(call Py3Package,python3-evdev))
+$(eval $(call BuildPackage,python3-evdev))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
PKG_SOURCE_URL:=https://pypi.python.org/packages/90/f4/9a2e384b325b69bc5827b9a6510a8fb4a51698c915c06a3f25a86458892a
-PKG_MD5SUM:=56d40bddcf8f22be0a36d60f764f3241
+PKG_HASH:=dd233e3288b90f21b0bb384bcc7a7e73557bb112ccf0032ad52aa614eb373d3f
PKG_LICENSE:=LGPL-3.0+
PKG_LICENSE_FILES:=COPYING.LESSER
include $(TOPDIR)/rules.mk
PKG_NAME:=python-gnupg
-PKG_VERSION:=2.3.0
+PKG_VERSION:=0.4.1
PKG_RELEASE:=1
-PKG_SOURCE_NAME:=gnupg
-PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/fa/ea/58e0415e1e3c3a0649119158e036ca4a9af154c56ef80f3d6de986bf9cb2/
-PKG_MD5SUM:=b6ebde86093f262f8430eff8d8a4c82b
-PKG_HASH:=1d90e854dcc7790a7efc3aac5998159553cc34ec599ee2bc7927beb45fb564ec
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/fc/f1/df6c06da34939f67ea622e0b31dbc5bdb5121b271ab530d151df59974425/
+PKG_HASH:=ef47b02eaf41dee3cf4b02ddf83130827318de9fe3eae89d01a3f05859e20e1a
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_SOURCE_NAME)-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
include $(INCLUDE_DIR)/package.mk
(Variant for Python3)
endef
+define PyBuild/Compile
+ $(call Build/Compile/PyMod,,\
+ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
+ )
+endef
+
+define Py3Build/Compile
+ $(call Build/Compile/Py3Mod,,\
+ install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
+ )
+endef
+
+
$(eval $(call PyPackage,python-gnupg))
$(eval $(call BuildPackage,python-gnupg))
include $(TOPDIR)/rules.mk
-PKG_NAME:=idna
-PKG_VERSION:=2.1
+PKG_NAME:=python-idna
+PKG_VERSION:=2.5
PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/i/idna
-PKG_MD5SUM:=f6473caa9c5e0cc1ad3fd5d04c3c114b
-
-PKG_BUILD_DEPENDS:=python python-setuptools
+PKG_SOURCE:=idna-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/d8/82/28a51052215014efc07feac7330ed758702fc0581347098a81699b5281cb
+PKG_HASH:=3cb5ce08046c4e3a560fc02f138d0ac63e00f8ce5901a56b32ec8b7994082aab
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE.rst
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-idna-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
+$(call include_mk, python3-package.mk)
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-idna/Default
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ URL:=https://github.com/kjd/idna
+endef
define Package/python-idna
- SECTION:=lang
- CATEGORY:=Languages
- SUBMENU:=Python
- TITLE:=python-idna
- URL:=https://github.com/kjd/idna
- DEPENDS:=+python-light
+$(call Package/python-idna/Default)
+ TITLE:=python-idna
+ DEPENDS:=+PACKAGE_python-idna:python-light
+ VARIANT:=python
+endef
+
+define Package/python3-idna
+$(call Package/python-idna/Default)
+ TITLE:=python3-idna
+ DEPENDS:=+PACKAGE_python3-idna:python3-light
+ VARIANT:=python3
endef
define Package/python-idna/description
from the earlier standard from 2003.
endef
-define Build/Compile
- $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+define Package/python3-idna/description
+$(call define Package/python-idna/description)
+.
+(Variant for Python3)
endef
$(eval $(call PyPackage,python-idna))
$(eval $(call BuildPackage,python-idna))
+$(eval $(call Py3Package,python3-idna))
+$(eval $(call BuildPackage,python3-idna))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/bb/26/3b64955ff73f9e3155079b9ed31812afdfa5333b5c76387454d651ef593a
-PKG_MD5SUM:=8bbf0326719fafb1f453921ef96729fe
+PKG_HASH:=3a21c5a15f433710aaa26f1ae174b615973a25182006ae7f9c26de151cd51716
PKG_BUILD_DEPENDS:=python python-setuptools
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/67/d9/fa0ea70d1792875745116ad62ac8d4bcb07550b15cded591bb57df6a6d9a
-PKG_MD5SUM:=7c46c8a04acc227a778c7900c87cdfc7
+PKG_HASH:=5810f1b5a9ae9255df99fb9c2dcab7352fed325687efda56c0faae1a82c5e3cb
PKG_BUILD_DEPENDS:=python libopenldap
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/M/MySQL-python/
-PKG_MD5SUM:=654f75b302db6ed8dc5a898c625e030c
+PKG_HASH:=811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74
PKG_BUILD_DEPENDS:=python python-setuptools libmysqlclient
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/P/Parsley
-PKG_MD5SUM:=92bc256e5f73810a609dc7874637ad31
+PKG_HASH:=9444278d47161d5f2be76a767809a3cbe6db4db822f46a4fd7481d4057208d41
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_LICENSE:=Apache-1.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=05c8d6978baa3512070ff4c041e5931384e702bbc2ac2c8063760176035958f1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/CoreSecurity/pcapy.git
PKG_SOURCE_VERSION:=b91a418374d1636408c435f11799ef725ef70097
include $(TOPDIR)/rules.mk
-PKG_NAME:=ply
-PKG_VERSION:=3.9
-PKG_RELEASE:=2
+PKG_NAME:=python-ply
+PKG_VERSION:=3.10
+PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=ply-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.dabeaz.com/ply
-PKG_HASH:=0d7e2940b9c57151392fceaa62b0865c45e06ce1e36687fd8d03f011a907f43e
+PKG_HASH:=96e94af7dd7031d8d6dd6e2a8e0de593b511c211a86e28a9c9621c275ac8bacb
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
-PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
-
-HOST_BUILD_DEPENDS:=
-ifdef CONFIG_PACKAGE_python-ply
-HOST_BUILD_DEPENDS+=python/host
-endif
-ifdef CONFIG_PACKAGE_python3-ply
-HOST_BUILD_DEPENDS+=python3/host
-endif
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-ply-$(PKG_VERSION)
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=README.md
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
$(call include_mk, python3-package.mk)
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
define Package/python-ply/Default
SECTION:=lang
CATEGORY:=Languages
define Package/python-ply
$(call Package/python-ply/Default)
TITLE:=python-ply
- DEPENDS:=+python-light
+ DEPENDS:=+PACKAGE_python-ply:python-light
VARIANT:=python
endef
define Package/python3-ply
$(call Package/python-ply/Default)
TITLE:=python3-ply
- DEPENDS:=+python3-light
+ DEPENDS:=+PACKAGE_python3-ply:python3-light
VARIANT:=python3
endef
(Variant for Python3)
endef
-ifdef CONFIG_PACKAGE_python-ply
-define Host/Compile/python-ply
- $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
-endef
-endif
-
-ifdef CONFIG_PACKAGE_python3-ply
-define Host/Compile/python3-ply
- $(call Build/Compile/HostPy3Mod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
-endef
-endif
-
-define Host/Compile
-$(call Host/Compile/python-ply)
-$(call Host/Compile/python3-ply)
-endef
-
-define Host/Install
-endef
-
-$(eval $(call HostBuild))
-
$(eval $(call PyPackage,python-ply))
$(eval $(call BuildPackage,python-ply))
PKG_SOURCE:=psycopg2-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://initd.org/psycopg/tarballs/PSYCOPG-2-6/
-PKG_MD5SUM:=4a392949ba31a378a18ed3e775a4693f
+PKG_HASH:=70490e12ed9c5c818ecd85d185d363335cc8a8cbf7212e3c185431c79ff8c05c
PKG_BUILD_DIR:=$(BUILD_DIR)/psycopg2-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=python libpq python/host
#
-# Copyright (C) 2015 OpenWrt.org
+# Copyright (C) 2015-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
-PKG_NAME:=pyasn1-modules
-PKG_VERSION:=0.0.8
+PKG_NAME:=python-pyasn1-modules
+PKG_VERSION:=0.0.11
PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pyasn1-modules
-PKG_MD5SUM:=178129bc7fbf07215c25230c5f053f81
-
-PKG_BUILD_DEPENDS:=python python-setuptools
+PKG_SOURCE:=pyasn1-modules-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/de/5f/0c6a1a096bfc2831ee8e2e951f79e6ec23c853c17ab5ba655322bfcde20a
+PKG_HASH:=60d5c80bfee9b79b492d5d8a934b3ecfc523f2f83aaab4ffafa2bbb651d3c67a
PKG_LICENSE:=BSD-2-Clause
PKG_LICENSE_FILES:=LICENSE.txt
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-pyasn1-modules-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
+$(call include_mk, python3-package.mk)
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-pyasn1-modules/Default
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ URL:=http://sourceforge.net/projects/pyasn1/
+endef
define Package/python-pyasn1-modules
- SECTION:=lang
- CATEGORY:=Languages
- SUBMENU:=Python
- TITLE:=python-pyasn1-modules
- URL:=http://sourceforge.net/projects/pyasn1/
- DEPENDS:=+python-light +python-pyasn1
+$(call Package/python-pyasn1-modules/Default)
+ TITLE:=python-pyasn1-modules
+ VARIANT:=python
+ DEPENDS:= \
+ +PACKAGE_python-pyasn1-modules:python-light \
+ +PACKAGE_python-pyasn1-modules:python-pyasn1
+endef
+
+define Package/python3-pyasn1-modules
+$(call Package/python-pyasn1-modules/Default)
+ TITLE:=python3-pyasn1-modules
+ VARIANT:=python3
+ DEPENDS:= \
+ +PACKAGE_python3-pyasn1-modules:python3-light \
+ +PACKAGE_python3-pyasn1-modules:python3-pyasn1
endef
define Package/python-pyasn1-modules/description
expressed in Python terms using pyasn1 data model.
endef
-define Build/Compile
- $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
+define Package/python3-pyasn1-modules/description
+$(call Package/python-pyasn1-modules/description)
+.
+(Variant for Python3).
endef
$(eval $(call PyPackage,python-pyasn1-modules))
$(eval $(call BuildPackage,python-pyasn1-modules))
+$(eval $(call Py3Package,python3-pyasn1-modules))
+$(eval $(call BuildPackage,python3-pyasn1-modules))
include $(TOPDIR)/rules.mk
-PKG_NAME:=pyasn1
-PKG_VERSION:=0.1.9
+PKG_NAME:=python-pyasn1
+PKG_VERSION:=0.3.2
PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pyasn1
-PKG_MD5SUM:=f00a02a631d4016818659d1cc38d229a
-
-PKG_BUILD_DEPENDS:=python python-setuptools
+PKG_SOURCE:=pyasn1-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/17/a2/266818077dbd002d53ebe5aaaa05a04786256cea8dba1899ac0b832ef028
+PKG_HASH:=90bd82e0db59d4319eaf01c2549b34c817d645275fce9ad41bac7429aa380690
PKG_LICENSE:=BSD-2-Clause
PKG_LICENSE_FILES:=LICENSE.txt
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-pyasn1-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
+$(call include_mk, python3-package.mk)
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-pyasn1/Default
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ URL:=http://pyasn1.sourceforge.net/
+endef
define Package/python-pyasn1
- SECTION:=lang
- CATEGORY:=Languages
- SUBMENU:=Python
- TITLE:=python-pyasn1
- URL:=http://pyasn1.sourceforge.net/
- DEPENDS:=+python-light
+$(call Package/python-pyasn1/Default)
+ TITLE:=python-pyasn1
+ DEPENDS:=+PACKAGE_python-pyasn1:python-light
+ VARIANT:=python
+endef
+
+define Package/python3-pyasn1
+$(call Package/python-pyasn1/Default)
+ TITLE:=python3-pyasn1
+ DEPENDS:=+PACKAGE_python3-pyasn1:python3-light
+ VARIANT:=python3
endef
define Package/python-pyasn1/description
based on ASN.1 specification.
endef
-define Build/Compile
- $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+define Package/python3-pyasn1/description
+$(call Package/python-pyasn1/description)
+.
+(Variant for Python3)
endef
$(eval $(call PyPackage,python-pyasn1))
$(eval $(call BuildPackage,python-pyasn1))
+$(eval $(call Py3Package,python3-pyasn1))
+$(eval $(call BuildPackage,python3-pyasn1))
include $(TOPDIR)/rules.mk
-PKG_NAME:=pycparser
-PKG_VERSION:=2.14
-PKG_RELEASE:=4
+PKG_NAME:=python-pycparser
+PKG_VERSION:=2.17
+PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pycparser
-PKG_HASH:=7959b4a74abdc27b312fed1c21e6caf9309ce0b29ea86b591fd2e99ecdf27f73
+PKG_SOURCE:=pycparser-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/be/64/1bb257ffb17d01f4a38d7ce686809a736837ad4371bcc5c42ba7a715c3ac
+PKG_HASH:=0aac31e917c24cb3357f5a4d5566f2cc91a19ca41862f6c3c22dc60a629673b6
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
-PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
-
-HOST_BUILD_DEPENDS:=python-ply/host
-ifdef CONFIG_PACKAGE_python-pycparser
-HOST_BUILD_DEPENDS+=python/host
-endif
-ifdef CONFIG_PACKAGE_python3-pycparser
-HOST_BUILD_DEPENDS+=python3/host
-endif
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-pycparser-$(PKG_VERSION)
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
-include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
$(call include_mk, python3-package.mk)
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
define Package/python-pycparser/Default
SECTION:=lang
CATEGORY:=Languages
define Package/python-pycparser
$(call Package/python-pycparser/Default)
TITLE:=python-pycparser
- DEPENDS:=+python-light +python-ply
+ DEPENDS:=+PACKAGE_python-pycparser:python-light +PACKAGE_python-pycparser:python-ply
VARIANT:=python
endef
define Package/python3-pycparser
$(call Package/python-pycparser/Default)
TITLE:=python3-pycparser
- DEPENDS:=+python3-light +python3-ply
+ DEPENDS:=+PACKAGE_python3-pycparser:python3-light +PACKAGE_python3-pycparser:python3-ply
VARIANT:=python3
endef
(Variant for Python3)
endef
-ifdef CONFIG_PACKAGE_python-pycparser
-define Host/Compile/python-pycparser
- $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
-endef
-endif
-
-ifdef CONFIG_PACKAGE_python3-pycparser
-define Host/Compile/python3-pycparser
- $(call Build/Compile/HostPy3Mod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
-endef
-endif
-
-define Host/Compile
-$(call Host/Compile/python-pycparser)
-$(call Host/Compile/python3-pycparser)
-endef
-
-define Host/Install
-endef
-
-$(eval $(call HostBuild))
-
$(eval $(call PyPackage,python-pycparser))
$(eval $(call BuildPackage,python-pycparser))
#
-# Copyright (C) 2015-2016 OpenWrt.org
+# Copyright (C) 2015-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=pyOpenSSL
-PKG_VERSION:=16.1.0
+PKG_VERSION:=17.2.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/15/1e/79c75db50e57350a7cefb70b110255757e9abd380a50ebdc0cfd853b7450
-PKG_MD5SUM:=d8100b0c333f0eeadaf05914da8792a6
-
-PKG_BUILD_DEPENDS:=python python-setuptools
+PKG_SOURCE_URL:=https://pypi.python.org/packages/b0/9e/7088f6165c40c46416aff434eb806c1d64ad6ec6dbc201f5ad4d0484704e
+PKG_HASH:=5d617ce36b07c51f330aa63b83bf7f25c40a0e95958876d54d1982f8c91b4834
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-pyopenssl-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
+$(call include_mk, python3-package.mk)
+
+PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+
+define Package/python-pyopenssl/Default
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ URL:=https://github.com/pyca/pyopenssl
+endef
define Package/python-pyopenssl
- SECTION:=lang
- CATEGORY:=Languages
- SUBMENU:=Python
- TITLE:=python-pyopenssl
- URL:=https://github.com/pyca/pyopenssl
- DEPENDS:=+python-light +python-cryptography +python-six
+$(call Package/python-pyopenssl/Default)
+ TITLE:=python-pyopenssl
+ VARIANT:=python
+ DEPENDS:= \
+ +PACKAGE_python-pyopenssl:python-light \
+ +PACKAGE_python-pyopenssl:python-cryptography \
+ +PACKAGE_python-pyopenssl:python-six
+endef
+
+define Package/python3-pyopenssl
+$(call Package/python-pyopenssl/Default)
+ TITLE:=python3-pyopenssl
+ VARIANT:=python3
+ DEPENDS:= \
+ +PACKAGE_python3-pyopenssl:python3-light \
+ +PACKAGE_python3-pyopenssl:python3-cryptography \
+ +PACKAGE_python3-pyopenssl:python3-six
endef
define Package/python-pyopenssl/description
Python wrapper module around the OpenSSL library
endef
-define Build/Compile
- $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
+define Package/python3-pyopenssl/description
+$(call Package/python-pyopenssl/description)
+.
+(Variant for Python3).
endef
$(eval $(call PyPackage,python-pyopenssl))
$(eval $(call BuildPackage,python-pyopenssl))
+$(eval $(call Py3Package,python3-pyopenssl))
+$(eval $(call BuildPackage,python3-pyopenssl))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pyptlib
-PKG_MD5SUM:=2fc7b8803777451c1fad3d5e25f1b99c
+PKG_HASH:=b98472e3d9e8f4689d3913ca8f89afa5e6cc5383dcd8686987606166f9dac607
PKG_BUILD_DEPENDS:=python python-setuptools
PKG_SOURCE:=pyserial-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://pypi.python.org/packages/3c/d8/a9fa247ca60b02b3bebbd61766b4f321393b57b13c53b18f6f62cf172c08/
-PKG_MD5SUM:=2f72100de3e410b36d575e12e82e9d27
+PKG_HASH:=d657051249ce3cbd0446bcfb2be07a435e1029da4d63f53ed9b4cdde7373364c
PKG_BUILD_DIR:=$(BUILD_DIR)/pyserial-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=python
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/s/service_identity
-PKG_MD5SUM:=d52392597b9c44a740abf322bfdb21e6
+PKG_HASH:=0630e222f59f91f3db498be46b1d879ff220955d7bbad719a5cb9ad14e3c3036
PKG_BUILD_DEPENDS:=python python-setuptools
PKG_NAME:=python-six
PKG_VERSION:=1.10.0
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE:=six-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/s/six
-PKG_MD5SUM:=34eed507548117b2ab523ab14b2f8b55
+PKG_HASH:=105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a
HOST_BUILD_DEPENDS:=python/host
-PKG_BUILD_DEPENDS:=python
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-six-$(PKG_VERSION)
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
+$(call include_mk, python3-package.mk)
PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
HOST_UNPACK:=$(HOST_TAR) -C $(HOST_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+define Package/python-six/Default
+ SECTION:=lang
+ CATEGORY:=Languages
+ SUBMENU:=Python
+ URL:=https://pypi.python.org/pypi/six
+endef
+
define Package/python-six
- SECTION:=lang
- CATEGORY:=Languages
- SUBMENU:=Python
- TITLE:=python-six
- URL:=https://pypi.python.org/pypi/six
- DEPENDS:=+python-light
+$(call Package/python-six/Default)
+ TITLE:=python-six
+ DEPENDS:=+PACKAGE_python-six:python-light
+ VARIANT:=python
+endef
+
+define Package/python3-six
+$(call Package/python-six/Default)
+ TITLE:=python3-six
+ DEPENDS:=+PACKAGE_python3-six:python3-light
+ VARIANT:=python3
endef
define Package/python-six/description
documentation for more information on what is provided.
endef
-define Build/Compile
- $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+define Package/python3-six/description
+$(call Package/python-six/description)
+.
+(Variant for Python3)
endef
define Host/Compile
$(eval $(call PyPackage,python-six))
$(eval $(call BuildPackage,python-six))
+$(eval $(call Py3Package,python3-six))
+$(eval $(call BuildPackage,python3-six))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/t/txsocksx
-PKG_MD5SUM:=0266b9ae7b58f7550a49683afebf65ba
+PKG_HASH:=4f79b5225ce29709bfcee45e6f726e65b70fd6f1399d1898e54303dbd6f8065f
PKG_BUILD_DEPENDS:=python python-setuptools
PKG_SOURCE:=urllib3-$(PKG_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/urllib3-$(PKG_VERSION)/
PKG_SOURCE_URL:=https://pypi.python.org/packages/20/56/a6aa403b0998f857b474a538343ee483f5c02491bd1aebf61d42a3f60f77/
-PKG_MD5SUM:=34691d4e7e20a8e9cdb452ea24fc38e7
+PKG_HASH:=97ef2b6e2878d84c0126b9f4e608e37a951ca7848e4855a7f7f4437d5c34a72f
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_NAME:=python
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
-PKG_RELEASE:=6
+PKG_RELEASE:=7
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
$(call Build/Compile/python-pip)
endef
+define Build/InstallMkFiles
+ $(INSTALL_DIR) $(STAGING_DIR)/mk/
+ $(INSTALL_DATA) \
+ ./files/python-package.mk \
+ ./files/python-host.mk \
+ ./files/python-version.mk \
+ ./files/python-package-install.sh \
+ $(STAGING_DIR)/mk/
+endef
+
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/ $(1)/usr/lib/pkgconfig
$(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config \
$(1)/usr/lib/python$(PYTHON_VERSION)/
+ $(call Build/InstallMkFiles)
endef
PYTHON_BASE_LIB_FILES:= \
CONFIG_SITE=
define Host/Install
+ $(call Build/InstallMkFiles)
$(MAKE) -C $(HOST_BUILD_DIR) install
- $(INSTALL_DIR) $(HOST_PYTHON_DIR)/bin/ $(STAGING_DIR)/mk/
+ $(INSTALL_DIR) $(HOST_PYTHON_DIR)/bin/
$(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_PYTHON_DIR)/bin/pgen2
- # Install these mk files in the Host/Install phase ;
- # The Build/InstallDev rule is activated only for target builds.
- # But if someone needs only the host Python, then
- # these files need to be installed in this phase, and not Build/InstallDev
- $(INSTALL_DATA) \
- ./files/python-package.mk \
- ./files/python-host.mk \
- ./files/python-version.mk \
- ./files/python-package-install.sh \
- $(STAGING_DIR)/mk/
endef
$(eval $(call HostBuild))
$(HOST_PYTHON_BIN) $(2);
endef
+define host_python_settings
+ ARCH="$(HOST_ARCH)" \
+ CC="$(HOSTCC)" \
+ CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
+ CXX="$(HOSTCXX)" \
+ LD="$(HOSTCC)" \
+ LDSHARED="$(HOSTCC) -shared" \
+ CFLAGS="$(HOST_CFLAGS)" \
+ CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON_INC_DIR)" \
+ LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
+ _PYTHON_HOST_PLATFORM=linux2
+endef
+
# $(1) => commands to execute before running pythons script
# $(2) => python script and its arguments
# $(3) => additional variables
define Build/Compile/HostPyRunHost
$(call HostPython, \
$(if $(1),$(1);) \
- CC="$(HOSTCC)" \
- CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
- CXX="$(HOSTCXX)" \
- LD="$(HOSTCC)" \
- LDSHARED="$(HOSTCC) -shared" \
- CFLAGS="$(HOST_CFLAGS)" \
- CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON_INC_DIR)" \
- LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
- _PYTHON_HOST_PLATFORM=linux2 \
+ $(call host_python_settings) \
$(3) \
, \
$(2) \
# Note: I shamelessly copied this from Yousong's logic (from python-packages);
HOST_PYTHON_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON_VERSION)
define host_python_pip_install
+ $(call host_python_settings) \
$(HOST_PYTHON_PIP) install \
--root=$(1) \
--prefix=$(2) \
if [ "$mode" == "sources" ] ; then
# Copy only python source files
- find $dst_dir -type f -not -name "*\.py" | xargs rm -f
+ find $dst_dir -not -type d -not -name "*\.py" | xargs rm -f
# Delete empty folders (if the case)
if [ -d "$dst_dir/usr" ] ; then
Modules/Setup.dist | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/Modules/Setup.dist b/Modules/Setup.dist
-index 01fb85f..01ac492 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
-@@ -358,7 +358,7 @@ _symtable symtablemodule.c
+@@ -464,7 +464,7 @@ GLHACK=-Dclear=__GLclear
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See http://www.gzip.org/zlib/
# Interface to the Expat XML parser
#
---
-1.8.4.5
-
-diff --git a/setup.py b/setup.py
-index cbdeaf3..5154412 100644
--- a/setup.py
+++ b/setup.py
-@@ -480,7 +480,8 @@ class PyBuildExt(build_ext):
+@@ -497,7 +497,8 @@ class PyBuildExt(build_ext):
add_dir_to_list(dir_list, directory)
if os.path.normpath(sys.prefix) != '/usr' \
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 7f4ec2f..e270bf2 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -1038,6 +1038,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
+@@ -1116,6 +1116,7 @@ libinstall: build_all $(srcdir)/Lib/$(PL
done; \
done
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
-@@ -1064,6 +1065,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
+@@ -1142,6 +1143,7 @@ libinstall: build_all $(srcdir)/Lib/$(PL
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
-diff --git a/Python/pythonrun.c b/Python/pythonrun.c
-index 748a63b..cb6e291 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
-@@ -79,7 +79,7 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
+@@ -79,7 +79,7 @@ int Py_InteractiveFlag; /* Needed by Py_
int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */
int Py_NoSiteFlag; /* Suppress 'import site' */
int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
int Py_FrozenFlag; /* Needed by getpath.c */
int Py_UnicodeFlag = 0; /* Needed by compile.c */
-@@ -174,7 +174,7 @@ Py_InitializeEx(int install_sigs)
+@@ -185,7 +185,7 @@ Py_InitializeEx(int install_sigs)
if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
-diff --git a/setup.py b/setup.py
-index 54054c2..d043761 100644
--- a/setup.py
+++ b/setup.py
@@ -454,13 +454,8 @@ class PyBuildExt(build_ext):
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-Index: b/Lib/distutils/sysconfig.py
-===================================================================
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
-@@ -19,8 +19,13 @@
+@@ -19,8 +19,13 @@ import sys
from distutils.errors import DistutilsPlatformError
# These are needed in a couple of spots, so just compute them once.
# Path to the base directory of the project. On Windows the binary may
# live in project/PCBuild9. If we're dealing with an x64 Windows build,
-Index: b/Lib/distutils/command/build_ext.py
-===================================================================
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
-@@ -237,7 +237,10 @@
+@@ -240,7 +240,10 @@ class build_ext (Command):
if (sysconfig.get_config_var('Py_ENABLE_SHARED')):
if not sysconfig.python_build:
# building third party extensions
-diff --git a/setup.py b/setup.py
-index 7868b7b..10ec68f 100644
--- a/setup.py
+++ b/setup.py
-@@ -1067,6 +1067,7 @@ class PyBuildExt(build_ext):
+@@ -1083,6 +1083,7 @@ class PyBuildExt(build_ext):
if db_setup_debug: print "db lib: ", dblib, "not found"
except db_found:
if db_setup_debug:
print "bsddb using BerkeleyDB lib:", db_ver, dblib
print "bsddb lib dir:", dblib_dir, " inc dir:", db_incdir
-@@ -1081,7 +1082,7 @@ class PyBuildExt(build_ext):
+@@ -1097,7 +1098,7 @@ class PyBuildExt(build_ext):
exts.append(Extension('_bsddb', ['_bsddb.c'],
depends = ['bsddb.h'],
library_dirs=dblib_dir,
include_dirs=db_incs,
libraries=dblibs))
else:
-@@ -1292,10 +1293,11 @@ class PyBuildExt(build_ext):
+@@ -1308,10 +1309,11 @@ class PyBuildExt(build_ext):
break
elif cand == "bdb":
if db_incs is not None:
-diff --git a/setup.py b/setup.py
-index 7868b7b..544fa7e 100644
--- a/setup.py
+++ b/setup.py
-@@ -452,8 +452,9 @@ class PyBuildExt(build_ext):
+@@ -463,8 +463,9 @@ class PyBuildExt(build_ext):
# directly since an inconsistently reproducible issue comes up where
# the environment variable is not set even though the value were passed
# into configure and stored in the Makefile (issue found on OS X 10.3).
-diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
-index e478a57..eb297b4 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -117,7 +117,6 @@ char *PyCursesVersion = "2.2";
PKG_SOURCE:=bottle-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/f7/dd/8ceaa148eeed5371a83fa1fb5a54b01dfc95000799c649924ece23f9f0e1/
-PKG_MD5SUM:=3d4b6b0e22f67b421c273105b30d9a21fd147eaf0c1576172378ee034fbf5313
+PKG_HASH:=3d4b6b0e22f67b421c273105b30d9a21fd147eaf0c1576172378ee034fbf5313
PKG_BUILD_DIR:=$(BUILD_DIR)/bottle-$(PKG_VERSION)
PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
PKG_NAME:=python3
-PKG_RELEASE:=4
+# XXX: reset PKG_RELEASE to 1 only if Python's pip & setuptools versions have also bumped;
+# otherwise, keep bumping PKG_RELEASE
+PKG_RELEASE:=6
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
-PKG_HASH:=a01810ddfcec216bcdb357a84bfaafdfaa0ca42bbdaa4cb7ff74f5a9961e4041
+PKG_HASH:=9229773be41ed144370f47f0f626a1579931f5a390f1e8e3853174d52edd64a9
PKG_LICENSE:=PSF
PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
$(call Build/Compile/python3-pip)
endef
+define Build/InstallMkFiles
+ $(INSTALL_DIR) $(STAGING_DIR)/mk/
+ $(INSTALL_DATA) \
+ ./files/python3-package.mk \
+ ./files/python3-host.mk \
+ ./files/python3-version.mk \
+ ./files/python3-package-install.sh \
+ $(STAGING_DIR)/mk/
+endef
+
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
$(1)/usr/lib/python$(PYTHON_VERSION)/
+ $(call Build/InstallMkFiles)
endef
PYTHON3_BASE_LIB_FILES:= \
endef
define Host/Install
+ $(call Build/InstallMkFiles)
$(MAKE) -C $(HOST_BUILD_DIR) install
-
- $(INSTALL_DIR) $(HOST_PYTHON3_DIR)/bin/ $(STAGING_DIR)/mk/
+ $(INSTALL_DIR) $(HOST_PYTHON3_DIR)/bin/
$(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_PYTHON3_DIR)/bin/pgen3
- $(INSTALL_BIN) $(HOST_BUILD_DIR)/Programs/_freeze_importlib $(HOST_PYTHON3_DIR)/bin/_freeze_importlib
-
- # Install these mk files in the Host/Install phase ;
- # The Build/InstallDev rule is activated only for target builds.
- # But if someone needs only the host Python, then
- # these files need to be installed in this phase, and not Build/InstallDev
- $(INSTALL_DATA) \
- ./files/python3-package.mk \
- ./files/python3-host.mk \
- ./files/python3-version.mk \
- ./files/python3-package-install.sh \
- $(STAGING_DIR)/mk/
endef
$(eval $(call HostBuild))
$(HOST_PYTHON3_BIN) $(2);
endef
+define host_python3_settings
+ ARCH="$(HOST_ARCH)" \
+ CC="$(HOSTCC)" \
+ CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
+ CXX="$(HOSTCXX)" \
+ LD="$(HOSTCC)" \
+ LDSHARED="$(HOSTCC) -shared" \
+ CFLAGS="$(HOST_CFLAGS)" \
+ CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \
+ LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
+ _PYTHON_HOST_PLATFORM=linux2
+endef
+
# $(1) => commands to execute before running pythons script
# $(2) => python script and its arguments
# $(3) => additional variables
define Build/Compile/HostPy3RunHost
$(call HostPython3, \
$(if $(1),$(1);) \
- CC="$(HOSTCC)" \
- CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
- CXX="$(HOSTCXX)" \
- LD="$(HOSTCC)" \
- LDSHARED="$(HOSTCC) -shared" \
- CFLAGS="$(HOST_CFLAGS)" \
- CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \
- LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
- _PYTHON_HOST_PLATFORM=linux2 \
+ $(call host_python3_settings) \
$(3) \
, \
$(2) \
# Note: I shamelessly copied this from Yousong's logic (from python-packages);
HOST_PYTHON3_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON3_VERSION)
define host_python3_pip_install
+ $(call host_python3_settings) \
$(HOST_PYTHON3_PIP) install \
--root=$(1) \
--prefix=$(2) \
if [ "$mode" == "sources" ] ; then
# Copy only python source files
- find $dst_dir -type f -not -name "*\.py" | xargs rm -f
+ find $dst_dir -not -type d -not -name "*\.py" | xargs rm -f
# Delete empty folders (if the case)
if [ -d "$dst_dir/usr" ] ; then
# Note: keep in sync with setuptools & pip
PYTHON3_VERSION_MAJOR:=3
PYTHON3_VERSION_MINOR:=6
-PYTHON3_VERSION_MICRO:=1
+PYTHON3_VERSION_MICRO:=2
PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
Modules/Setup.dist | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/Modules/Setup.dist b/Modules/Setup.dist
-index 01fb85f..01ac492 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
-@@ -358,7 +358,7 @@ _symtable symtablemodule.c
+@@ -362,7 +362,7 @@ _symtable symtablemodule.c
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See http://www.gzip.org/zlib/
# Interface to the Expat XML parser
#
---
-1.8.4.5
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index ce2c0aa..b0c8322 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -1256,41 +1256,6 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
- done; \
- done
+@@ -1307,41 +1307,6 @@ libinstall: build_all $(srcdir)/Modules/
+ $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
+ $(DESTDIR)$(LIBDEST); \
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
- if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
- $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
- # Create the PLATDIR source directory, if one wasn't distributed..
- $(srcdir)/Lib/$(PLATDIR):
+ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
+ # Substitution happens here, as the completely-expanded BINDIR
-diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
-index a17adf7..415b3f6 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
-@@ -86,7 +86,7 @@ int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
+@@ -88,7 +88,7 @@ int Py_BytesWarningFlag; /* Warn on str(
int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
int Py_FrozenFlag; /* Needed by getpath.c */
int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
--int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
-+int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
+-int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.pyc) */
++int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.pyc) */
int Py_NoUserSiteDirectory = 0; /* for -s and site.py */
int Py_UnbufferedStdioFlag = 0; /* Unbuffered binary std{in,out,err} */
int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */
-@@ -309,7 +309,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
+@@ -329,7 +329,7 @@ _Py_InitializeEx_Private(int install_sig
if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
-diff --git a/setup.py b/setup.py
-index f04bf22..01b851e 100644
--- a/setup.py
+++ b/setup.py
@@ -487,16 +487,9 @@ class PyBuildExt(build_ext):
--- a/Lib/distutils/command/build_scripts.py
+++ b/Lib/distutils/command/build_scripts.py
-@@ -89,6 +89,7 @@ class build_scripts (Command):
- adjust = 1
- post_interp = match.group(1) or ''
+@@ -91,6 +91,7 @@ class build_scripts(Command):
+ adjust = True
+ post_interp = match.group(1) or b''
+ adjust = 0
if adjust:
-diff --git a/Lib/imp.py b/Lib/imp.py
-index 781ff23..beeac70 100644
--- a/Lib/imp.py
+++ b/Lib/imp.py
@@ -203,8 +203,9 @@ def load_package(name, path):
-diff --git a/setup.py b/setup.py
-index 7868b7b..544fa7e 100644
--- a/setup.py
+++ b/setup.py
-@@ -452,8 +452,9 @@ class PyBuildExt(build_ext):
+@@ -497,8 +497,9 @@ class PyBuildExt(build_ext):
# directly since an inconsistently reproducible issue comes up where
# the environment variable is not set even though the value were passed
# into configure and stored in the Makefile (issue found on OS X 10.3).
-diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
-index 3bf2ca7..c156964 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -116,7 +116,6 @@ char *PyCursesVersion = "2.2";
-diff --git a/configure b/configure
-index 274af7e..85bbf0e 100755
--- a/configure
+++ b/configure
-@@ -10555,7 +10555,7 @@ for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
+@@ -11271,7 +11271,7 @@ for ac_func in alarm accept4 setitimer g
sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \
sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \
-diff --git a/configure b/configure
-index e823a08..84c525f 100755
--- a/configure
+++ b/configure
-@@ -14365,7 +14365,7 @@ $as_echo_n "checking ABIFLAGS... " >&6; }
+@@ -14986,7 +14986,7 @@ $as_echo_n "checking ABIFLAGS... " >&6;
$as_echo "$ABIFLAGS" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
$as_echo_n "checking SOABI... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5
$as_echo "$SOABI" >&6; }
-diff --git a/configure.ac b/configure.ac
-index 56a73df..1855af5 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -4314,7 +4314,7 @@ AC_SUBST(SOABI)
+@@ -4639,7 +4639,7 @@ AC_SUBST(SOABI)
AC_MSG_CHECKING(ABIFLAGS)
AC_MSG_RESULT($ABIFLAGS)
AC_MSG_CHECKING(SOABI)
-diff --git a/setup.py b/setup.py
-index da67731..928e0de 100644
--- a/setup.py
+++ b/setup.py
-@@ -293,6 +293,7 @@ class PyBuildExt(build_ext):
+@@ -308,6 +308,7 @@ class PyBuildExt(build_ext):
print("Failed to build these modules:")
print_three_column(failed)
print()
-diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
-index 8bf1a70..c2708c3 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
-@@ -424,6 +424,7 @@ def _init_posix():
+@@ -421,6 +421,7 @@ def _init_posix():
platform=sys.platform,
multiarch=getattr(sys.implementation, '_multiarch', ''),
))
_temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
build_time_vars = _temp.build_time_vars
global _config_vars
-diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
-index 9314e71..4861261 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -343,6 +343,7 @@ def get_makefile_filename():
return os.environ.get('_PYTHON_SYSCONFIGDATA_NAME',
'_sysconfigdata_{abi}_{platform}_{multiarch}'.format(
abi=sys.abiflags,
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index cd7d33d..ad6572f 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -1301,7 +1301,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c
+@@ -1304,7 +1304,7 @@ libinstall: build_all $(srcdir)/Modules/
esac; \
done; \
done
+ $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata*.py \
$(DESTDIR)$(LIBDEST); \
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
- if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
-@@ -1436,7 +1436,7 @@ sharedinstall: sharedmods
+
+@@ -1404,7 +1404,7 @@ sharedinstall: sharedmods
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
--root=$(DESTDIR)/
-rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
# Here are a couple of targets for MacOSX again, to install a full
-diff --git a/configure b/configure
-index cf95b27..8203fbb 100755
--- a/configure
+++ b/configure
-@@ -14895,7 +14895,7 @@ LDVERSION='$(VERSION)$(ABIFLAGS)'
+@@ -15005,7 +15005,7 @@ LDVERSION='$(VERSION)$(ABIFLAGS)'
$as_echo "$LDVERSION" >&6; }
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
else
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
-diff --git a/configure.ac b/configure.ac
-index 1d63813..25f25ed 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -4600,7 +4600,7 @@ AC_MSG_RESULT($LDVERSION)
+@@ -4656,7 +4656,7 @@ AC_MSG_RESULT($LDVERSION)
dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
AC_SUBST(PY_ENABLE_SHARED)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/5d/8e/6635d8f3f9f48c03bb925fab543383089858271f9cfd1216b83247e8df94/
-PKG_MD5SUM:=b6c28a3b968bc1d8badfb61b93874e03
+PKG_HASH:=6f57732f0f8849817e9853eb9d50d85d1ebb1404f702dbc44ee627c642a486ca
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=4764e3bc47ca8d44be3198892e73c51d8a0a9970
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=a52728cc5653bf3c2a2f92954c6001338442a6e589bd364c497ba615c4365211
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/40/ad/52c1f3a562df3b210e8f165e1aa243a178c454ead65476a39fa3ce1847b6/
-PKG_MD5SUM:=426a9631d22851a7a970b1a677368b15
+PKG_HASH:=953be622e88323c6f43fad61ffd05bebe73b9fd9863a46d68b052d2aa7d71ce2
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=Twisted-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://pypi.python.org/packages/6b/23/8dbe86fc83215015e221fbd861a545c6ec5c9e9cd7514af114d1f64084ab \
http://twistedmatrix.com/Releases/Twisted/16.4
-PKG_MD5SUM:=c6d09bdd681f538369659111f079c29d
+PKG_HASH:=1d8d73f006c990744effb35588359fd44d43608649ac0b6b7edc71176e88e816
PKG_BUILD_DIR:=$(BUILD_DIR)/Twisted-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=python python-setuptools USE_MUSL:librpc
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/38/1b/d55c39f2cf442bd9fb2c59760ed058c84b57d25c680819c25f3aff741e1f
-PKG_MD5SUM:=5f7e15a5bcdfa3c6c0e93ffe45caf87c
+PKG_HASH:=6a0e224a052e3ce27b3a7b1300a24747513f7a507217fcc2a4cb02eb92945cee
PKG_BUILD_DEPENDS:=python python-setuptools
include $(TOPDIR)/rules.mk
PKG_NAME:=ruby
-PKG_VERSION:=2.4.1
+PKG_VERSION:=2.4.2
PKG_RELEASE:=1
# First two numbes
PKG_ABI_VERSION:=$(subst $(space),.,$(wordlist 1, 2, $(subst .,$(space),$(PKG_VERSION))))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://cache.ruby-lang.org/pub/ruby/$(PKG_ABI_VERSION)/
-PKG_HASH:=4fc8a9992de3e90191de369270ea4b6c1b171b7941743614cc50822ddc1fe654
+PKG_SOURCE_URL:=https://cache.ruby-lang.org/pub/ruby/$(PKG_ABI_VERSION)/
+PKG_HASH:=748a8980d30141bd1a4124e11745bb105b436fb1890826e0d2b9ea31af27f735
PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
PKG_LICENSE:=BSD-2-Clause
PKG_LICENSE_FILES:=COPYING
--- /dev/null
+diff -pU3 a/configure b/configure
+--- a/configure 2017-09-14 21:52:19.000000000 +0900
++++ b/configure 2017-09-15 07:03:12.000000000 +0900
+@@ -10614,6 +10614,7 @@ fi
+ ac_res=$ac_cv_search___gmpz_init
+ if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
++ $as_echo "#define HAVE_LIBGMP 1" >>confdefs.h
+
+ fi
+
+@@ -10683,6 +10684,7 @@ fi
+ ac_res=$ac_cv_search_malloc_conf
+ if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
++ $as_echo "#define HAVE_LIBJEMALLOC 1" >>confdefs.h
+
+ else
+ with_jemalloc=no
+diff -pU3 a/configure.in b/configure.in
+--- a/configure.in 2017-08-04 23:39:29.000000000 +0900
++++ b/configure.in 2017-09-15 07:20:40.000000000 +0900
+@@ -1403,13 +1403,15 @@ AC_ARG_WITH([gmp],
+ AS_IF([test "x$with_gmp" != xno],
+ [AC_CHECK_HEADERS(gmp.h)
+ AS_IF([test "x$ac_cv_header_gmp_h" != xno],
+- AC_SEARCH_LIBS([__gmpz_init], [gmp]))])
++ AC_SEARCH_LIBS([__gmpz_init], [gmp],
++ [AC_DEFINE(HAVE_LIBGMP, 1)]))])
+
+ AC_ARG_WITH([jemalloc],
+ [AS_HELP_STRING([--with-jemalloc],[use jemalloc allocator])],
+ [with_jemalloc=$withval], [with_jemalloc=no])
+ AS_IF([test "x$with_jemalloc" = xyes],[
+- AC_SEARCH_LIBS([malloc_conf], [jemalloc], [], [with_jemalloc=no])
++ AC_SEARCH_LIBS([malloc_conf], [jemalloc],
++ [AC_DEFINE(HAVE_LIBJEMALLOC, 1)], [with_jemalloc=no])
+ AC_CHECK_HEADER(jemalloc/jemalloc.h, [
+ AC_DEFINE(RUBY_ALTERNATIVE_MALLOC_HEADER, [<jemalloc/jemalloc.h>])
+ ])
PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION)-src.tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=d7cbb91f1ded1919370a30edd1534304
+PKG_HASH:=9e6ed94c981c1d0c5f5fefb8112d06c6bf4d050a7327e95e71d417c416519c8d
PKG_LICENSE:=TCL
PKG_LICENSE_FILES:=license.terms
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=142b60b266d90db6177eb07919d8b71ac4a3bb17859540d4655c02f395526962
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/Tieske/uuid.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNOME/vala/0.34/
-PKG_MD5SUM:=f9b4a0a10b76b56b0b6e914c506a6828
+PKG_HASH:=765e9c2b429a66db93247940f8588319b43f35c173d057bcae5717a97d765c41
PKG_BUILD_DEPENDS:=glib2 glib2/host vala/host
HOST_BUILD_DEPENDS:=glib2/host
include $(TOPDIR)/rules.mk
PKG_NAME:=apr-util
-PKG_VERSION:=1.5.4
-PKG_RELEASE:=2
+PKG_VERSION:=1.6.0
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@APACHE/apr/
-PKG_MD5SUM:=2202b18f269ad606d70e1864857ed93c
+PKG_HASH:=8474c93fa74b56ac6ca87449abe3e155723d5f534727f3f33283f6631a48ca4c
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
PKG_LICENSE:=Apache License
include $(TOPDIR)/rules.mk
PKG_NAME:=apr
-PKG_VERSION:=1.5.2
-PKG_RELEASE:=2
+PKG_VERSION:=1.6.2
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@APACHE/apr/
-PKG_MD5SUM:=4e9769f3349fe11fc0a5e1b224c236aa
+PKG_HASH:=09109cea377bab0028bba19a92b5b0e89603df9eab05c0f7dbd4dd83d48dcebd
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
PKG_LICENSE:=Apache License
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/lathiat/avahi/releases/download/v$(PKG_VERSION)
-PKG_MD5SUM:=22b5e705d3eabb31d26f2e1e7b074013
+PKG_HASH:=d54991185d514a0aba54ebeb408d7575b60f5818a772e28fa0e18b98bc1db454
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm intltool/host libpthread dbus
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@APACHE/avro/avro-$(PKG_VERSION)/c
-PKG_MD5SUM:=c2720c131307b84de71c8f147e73ecf6
+PKG_HASH:=4639982b2b8fbd91fc7128fef672207129c959bb7900dd64b077ce4206edf10e
PKG_MAINTAINER:=John Clark <inindev@gmail.com>
include $(INCLUDE_DIR)/target.mk
PKG_NAME:=boost
-PKG_VERSION:=1.64.0
-PKG_SOURCE_VERSION:=1_64_0
+PKG_VERSION:=1.65.0
+PKG_SOURCE_VERSION:=1_65_0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)_$(PKG_SOURCE_VERSION).tar.bz2
PKG_SOURCE_URL:=https://sourceforge.net/projects/boost/files/boost/$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_SOURCE_VERSION)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)_$(PKG_SOURCE_VERSION)
-PKG_MD5SUM:=7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332
+PKG_HASH:=ea26712742e2fb079c2a566a31f3266973b76e38222b9f88b387e3c8b2f9902c
PKG_LICENSE:=Boost Software License <http://www.boost.org/users/license.html>
PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com>
endef
define Package/boost/description
-This package provides the Boost v1.64 libraries.
+This package provides the Boost v1.65 libraries.
Boost is a set of free, peer-reviewed, portable C++ source libraries.
-----------------------------------------------------------------------------
- python3
- random
- regex
- - serialization
+ - serialization and wserialization
- signals
+ - stackstrace (new in 1.65.0)
- system
- thread
- timer
+ - type_erasure
- wave
There are many more header-only libraries supported by Boost.
-See more at http://www.boost.org/doc/libs/1_64_0/
+See more at http://www.boost.org/doc/libs/1_65_0/
endef
PKG_BUILD_DEPENDS:=boost/host PACKAGE_python:python PACKAGE_python3:python3
$(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
$(eval $(call DefineBoostLibrary,date_time,,))
#$(eval $(call DefineBoostLibrary,exception,,))
-$(eval $(call DefineBoostLibrary,fiber,coroutine,,))
+$(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,))
$(eval $(call DefineBoostLibrary,filesystem,system,))
$(eval $(call DefineBoostLibrary,graph,regex,))
-$(eval $(call DefineBoostLibrary,iostreams,,+zlib))
+$(eval $(call DefineBoostLibrary,iostreams,,+zlib +liblzma))
$(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS),BUILD_NLS))
$(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
$(eval $(call DefineBoostLibrary,math,,))
$(eval $(call DefineBoostLibrary,random,system,))
$(eval $(call DefineBoostLibrary,regex,,))
$(eval $(call DefineBoostLibrary,serialization,,))
+$(eval $(call DefineBoostLibrary,wserialization,serialization,))
$(eval $(call DefineBoostLibrary,signals,,))
+$(eval $(call DefineBoostLibrary,stacktrace,,))
$(eval $(call DefineBoostLibrary,system,,))
$(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
$(eval $(call DefineBoostLibrary,timer,chrono))
+$(eval $(call DefineBoostLibrary,type_erasure,chrono system thread,))
$(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
TARGET_CFLAGS += \
$(if $(CONFIG_PACKAGE_boost-python), -I$(STAGING_DIR)/usr/include/python2.7/) \
- $(if $(CONFIG_PACKAGE_boost-python3), -I$(STAGING_DIR)/usr/include/python3.5/) \
+ $(if $(CONFIG_PACKAGE_boost-python3), -I$(STAGING_DIR)/usr/include/python3.6/) \
$(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_VERSION_4_8),-std=gnu++11,-std=gnu++14)
( cd $(PKG_BUILD_DIR) ; \
echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS)\" <cxxflags>\"$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > tools/build/src/user-config.jam ; \
$(if $(CONFIG_PACKAGE_boost-python3), \
- echo "using python : 3.5 : $(STAGING_DIR_ROOT)/usr/bin/python3 : $(STAGING_DIR)/usr/include/python3.5/ ;" >> \
+ echo "using python : 3.6 : : $(STAGING_DIR)/usr/include/python3.6/ : $(STAGING_DIR)/usr/lib/libpython3.6.so ;" >> \
tools/build/src/user-config.jam; \
) \
$(if $(CONFIG_PACKAGE_boost-python), \
- echo "using python : 2.7 : $(STAGING_DIR_ROOT)/usr/bin/python : $(STAGING_DIR)/usr/include/python2.7/ ;" >> \
+ echo "using python : 2.7 : : $(STAGING_DIR)/usr/include/python2.7/ : $(STAGING_DIR)/usr/lib/libpython2.7.so ;" >> \
tools/build/src/user-config.jam; \
) \
b2 \
$(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
$(foreach lib,$(BOOST_LIBS), \
$(if $(findstring python,$(lib)), \
- $(if $(or $(CONFIG_PACKAGE_boost-python),$(CONFIG_PACKAGE_boost-python3)),,--without-python), \
+ $(if $(CONFIG_PACKAGE_boost-python),python=2.7,--without-python), \
$(if $(CONFIG_PACKAGE_boost-$(lib)),,--without-$(lib))) \
) \
$(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
\
$(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
-sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
- install \
+ install ;\
+ b2 \
+ $(CONFIGURE_ARGS) \
+ --ignore-site-config \
+ --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
+ --disable-long-double \
+ $(if $(CONFIG_boost-variant-release), variant=release,) \
+ $(if $(CONFIG_boost-variant-debug), variant=debug,) \
+ $(if $(CONFIG_boost-variant-profile), variant=profile,) \
+ $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
+ $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
+ $(if $(CONFIG_boost-shared-libs),link=shared,) \
+ $(if $(CONFIG_boost-static-libs),link=static,) \
+ $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
+ $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
+ $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
+ $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
+ $(if $(CONFIG_boost-single-thread),threading=single,) \
+ threading=multi \
+ $(if $(CONFIG_PACKAGE_boost-python3),--with-python python=3.6,) \
+ install ;\
)
endef
define BuildBoostLibrary
define Package/boost-$(1)/install
- $(call Package/boost/Default/install,$$(1),$(1))
+ $(call Package/boost/Default/install,$$(1),$(1))
endef
$$(eval $$(call BuildPackage,boost-$(1)))
--- /dev/null
+Index: boost_1_65_0/boost/context/continuation_fcontext.hpp
+===================================================================
+--- boost_1_65_0.orig/boost/context/continuation_fcontext.hpp
++++ boost_1_65_0/boost/context/continuation_fcontext.hpp
+@@ -95,7 +95,7 @@ transfer_t context_ontop( transfer_t t)
+ t.data = nullptr;
+ Ctx c{ t.fctx };
+ // execute function, pass continuation via reference
+- fn( std::move( c) );
++ c = fn( std::move( c) );
+ #if defined(BOOST_NO_CXX14_STD_EXCHANGE)
+ return { exchange( c.fctx_, nullptr), nullptr };
+ #else
+Index: boost_1_65_0/boost/context/continuation_ucontext.hpp
+===================================================================
+--- boost_1_65_0.orig/boost/context/continuation_ucontext.hpp
++++ boost_1_65_0/boost/context/continuation_ucontext.hpp
+@@ -84,18 +84,18 @@ static void entry_func( void * data) noe
+ struct BOOST_CONTEXT_DECL activation_record {
+ thread_local static activation_record * current_rec;
+
+- ucontext_t uctx{};
+- stack_context sctx{};
+- bool main_ctx{ true };
+- activation_record * from{ nullptr };
+- std::function< void(activation_record*&) > ontop{};
+- bool terminated{ false };
+- bool force_unwind{ false };
++ ucontext_t uctx{};
++ stack_context sctx{};
++ bool main_ctx{ true };
++ activation_record * from{ nullptr };
++ std::function< activation_record*(activation_record*&) > ontop{};
++ bool terminated{ false };
++ bool force_unwind{ false };
+ #if defined(BOOST_USE_ASAN)
+- void * fake_stack{ nullptr };
+- void * stack_bottom{ nullptr };
+- std::size_t stack_size{ 0 };
+- bool started{ false };
++ void * fake_stack{ nullptr };
++ void * stack_bottom{ nullptr };
++ std::size_t stack_size{ 0 };
++ bool started{ false };
+ #endif
+
+ static activation_record *& current() noexcept;
+@@ -168,20 +168,30 @@ struct BOOST_CONTEXT_DECL activation_rec
+ current()->ontop = std::bind(
+ [](typename std::decay< Fn >::type & fn, activation_record *& ptr){
+ Ctx c{ ptr };
+- fn( std::move( c) );
++ c = fn( std::move( c) );
+ if ( ! c) {
+ ptr = nullptr;
+ }
++#if defined(BOOST_NO_CXX14_STD_EXCHANGE)
++ return exchange( c.ptr_, nullptr);
++#else
++ return std::exchange( c.ptr_, nullptr);
++#endif
+ },
+ std::forward< Fn >( fn),
+ std::placeholders::_1);
+ #else
+ current()->ontop = [fn=std::forward<Fn>(fn)](activation_record *& ptr){
+ Ctx c{ ptr };
+- fn( std::move( c) );
++ c = fn( std::move( c) );
+ if ( ! c) {
+ ptr = nullptr;
+ }
++#if defined(BOOST_NO_CXX14_STD_EXCHANGE)
++ return exchange( c.ptr_, nullptr);
++#else
++ return std::exchange( c.ptr_, nullptr);
++#endif
+ };
+ #endif
+ #if defined(BOOST_USE_SEGMENTED_STACKS)
+@@ -408,7 +418,7 @@ public:
+ if ( BOOST_UNLIKELY( detail::activation_record::current()->force_unwind) ) {
+ throw detail::forced_unwind{ ptr};
+ } else if ( BOOST_UNLIKELY( nullptr != detail::activation_record::current()->ontop) ) {
+- detail::activation_record::current()->ontop( ptr);
++ ptr = detail::activation_record::current()->ontop( ptr);
+ detail::activation_record::current()->ontop = nullptr;
+ }
+ return continuation{ ptr };
+@@ -426,7 +436,7 @@ public:
+ if ( BOOST_UNLIKELY( detail::activation_record::current()->force_unwind) ) {
+ throw detail::forced_unwind{ ptr};
+ } else if ( BOOST_UNLIKELY( nullptr != detail::activation_record::current()->ontop) ) {
+- detail::activation_record::current()->ontop( ptr);
++ ptr = detail::activation_record::current()->ontop( ptr);
+ detail::activation_record::current()->ontop = nullptr;
+ }
+ return continuation{ ptr };
+Index: boost_1_65_0/boost/context/continuation_winfib.hpp
+===================================================================
+--- boost_1_65_0.orig/boost/context/continuation_winfib.hpp
++++ boost_1_65_0/boost/context/continuation_winfib.hpp
+@@ -65,13 +65,13 @@ static VOID WINAPI entry_func( LPVOID da
+ struct BOOST_CONTEXT_DECL activation_record {
+ thread_local static activation_record * current_rec;
+
+- LPVOID fiber{ nullptr };
+- stack_context sctx{};
+- bool main_ctx{ true };
+- activation_record * from{ nullptr };
+- std::function< void(activation_record*&) > ontop{};
+- bool terminated{ false };
+- bool force_unwind{ false };
++ LPVOID fiber{ nullptr };
++ stack_context sctx{};
++ bool main_ctx{ true };
++ activation_record * from{ nullptr };
++ std::function< activation_record*(activation_record*&) > ontop{};
++ bool terminated{ false };
++ bool force_unwind{ false };
+
+ static activation_record *& current() noexcept;
+
+@@ -142,20 +142,30 @@ struct BOOST_CONTEXT_DECL activation_rec
+ current()->ontop = std::bind(
+ [](typename std::decay< Fn >::type & fn, activation_record *& ptr){
+ Ctx c{ ptr };
+- fn( std::move( c) );
++ c = fn( std::move( c) );
+ if ( ! c) {
+ ptr = nullptr;
+ }
++#if defined(BOOST_NO_CXX14_STD_EXCHANGE)
++ return exchange( c.ptr_, nullptr);
++#else
++ return std::exchange( c.ptr_, nullptr);
++#endif
+ },
+ std::forward< Fn >( fn),
+ std::placeholders::_1);
+ #else
+ current()->ontop = [fn=std::forward<Fn>(fn)](activation_record *& ptr){
+ Ctx c{ ptr };
+- fn( std::move( c) );
++ c = fn( std::move( c) );
+ if ( ! c) {
+ ptr = nullptr;
+ }
++#if defined(BOOST_NO_CXX14_STD_EXCHANGE)
++ return exchange( c.ptr_, nullptr);
++#else
++ return std::exchange( c.ptr_, nullptr);
++#endif
+ };
+ #endif
+ // context switch
+@@ -336,7 +346,7 @@ public:
+ if ( BOOST_UNLIKELY( detail::activation_record::current()->force_unwind) ) {
+ throw detail::forced_unwind{ ptr};
+ } else if ( BOOST_UNLIKELY( nullptr != detail::activation_record::current()->ontop) ) {
+- detail::activation_record::current()->ontop( ptr);
++ ptr = detail::activation_record::current()->ontop( ptr);
+ detail::activation_record::current()->ontop = nullptr;
+ }
+ return continuation{ ptr };
+@@ -354,7 +364,7 @@ public:
+ if ( BOOST_UNLIKELY( detail::activation_record::current()->force_unwind) ) {
+ throw detail::forced_unwind{ ptr};
+ } else if ( BOOST_UNLIKELY( nullptr != detail::activation_record::current()->ontop) ) {
+- detail::activation_record::current()->ontop( ptr);
++ ptr = detail::activation_record::current()->ontop( ptr);
+ detail::activation_record::current()->ontop = nullptr;
+ }
+ return continuation{ ptr };
+Index: boost_1_65_0/boost/thread/win32/condition_variable.hpp
+===================================================================
+--- boost_1_65_0.orig/boost/thread/win32/condition_variable.hpp
++++ boost_1_65_0/boost/thread/win32/condition_variable.hpp
+@@ -211,7 +211,7 @@ namespace boost
+ {}
+ #endif
+
+- void remove_waiter()
++ void remove_waiter_and_reset()
+ {
+ if (entry) {
+ boost::lock_guard<boost::mutex> internal_lock(internal_mutex);
+@@ -221,7 +221,7 @@ namespace boost
+ }
+ ~entry_manager() BOOST_NOEXCEPT_IF(false)
+ {
+- remove_waiter();
++ remove_waiter_and_reset();
+ }
+
+ list_entry* operator->()
+@@ -250,7 +250,7 @@ namespace boost
+ woken=entry->woken();
+ }
+ // do it here to avoid throwing on the destructor
+- entry->remove_waiter();
++ entry.remove_waiter_and_reset();
+ locker.lock();
+ return woken;
+ }
+Index: boost_1_65_0/libs/context/doc/callcc.qbk
+===================================================================
+--- boost_1_65_0.orig/libs/context/doc/callcc.qbk
++++ boost_1_65_0/libs/context/doc/callcc.qbk
+@@ -176,6 +176,7 @@ return `void`.
+ c=c.resume_with([&data](ctx::continuation && c){
+ std::cout << "f2: entered: " << data << std::endl;
+ data=-1;
++ return std::move( c);
+ });
+ std::cout << "f1: returned third time" << std::endl;
+
+@@ -221,6 +222,7 @@ an exception.
+ c = c.resume_with(
+ [](ctx::continuation && c){
+ throw my_exception(std::move(c),"abc");
++ return std::move( c);
+ });
+
+ output:
+@@ -527,11 +529,11 @@ e.g. ['continuation::operator bool()] re
+
+ [variablelist
+ [[Effects:] [Captures current continuation and resumes `*this`.
+-The function `resume_with`, is used to execute function `fn` in continuation
++The function `resume_with`, is used to execute function `fn` in the execution context of
+ `*this` (e.g. the stack frame of `fn` is allocated on stack of `*this`).]]
+ [[Returns:] [The continuation representing the continuation that has been
+ suspended.]]
+-[[Note:] [Function `fn` needs to return void.]]
++[[Note:] [Function `fn` needs to return `continuation`.]]
+ [[Note:] [The returned continuation indicates if the suspended continuation has
+ terminated (return from context-function) via `bool operator()`.]]
+ ]
+Index: boost_1_65_0/libs/context/example/ontop.cpp
+===================================================================
+--- boost_1_65_0.orig/libs/context/example/ontop.cpp
++++ boost_1_65_0/libs/context/example/ontop.cpp
+@@ -32,6 +32,7 @@ int main() {
+ c = c.resume_with( [&data](ctx::continuation && c){
+ std::cout << "f2: entered: " << data << std::endl;
+ data = -1;
++ return std::move( c);
+ });
+ std::cout << "f1: returned third time" << std::endl;
+ std::cout << "main: done" << std::endl;
+Index: boost_1_65_0/libs/context/example/ontop_void.cpp
+===================================================================
+--- boost_1_65_0.orig/libs/context/example/ontop_void.cpp
++++ boost_1_65_0/libs/context/example/ontop_void.cpp
+@@ -21,8 +21,9 @@ ctx::continuation f1( ctx::continuation
+ return std::move( c);
+ }
+
+-void f2( ctx::continuation && c) {
++ctx::continuation f2( ctx::continuation && c) {
+ std::cout << "f2: entered" << std::endl;
++ return std::move( c);
+ }
+
+ int main() {
+Index: boost_1_65_0/libs/context/example/throw.cpp
+===================================================================
+--- boost_1_65_0.orig/libs/context/example/throw.cpp
++++ boost_1_65_0/libs/context/example/throw.cpp
+@@ -38,6 +38,7 @@ int main() {
+ c = c.resume_with(
+ [](ctx::continuation && c){
+ throw my_exception(std::move( c), "abc");
++ return std::move( c);
+ });
+
+ std::cout << "main: done" << std::endl;
+Index: boost_1_65_0/libs/context/test/test_callcc.cpp
+===================================================================
+--- boost_1_65_0.orig/libs/context/test/test_callcc.cpp
++++ boost_1_65_0/libs/context/test/test_callcc.cpp
+@@ -252,6 +252,7 @@ void test_ontop() {
+ c = c.resume_with(
+ [&i](ctx::continuation && c){
+ i -= 10;
++ return std::move( c);
+ });
+ BOOST_CHECK( c);
+ BOOST_CHECK_EQUAL( i, 200);
+@@ -266,6 +267,7 @@ void test_ontop() {
+ c = c.resume_with(
+ [&c1](ctx::continuation && c){
+ c1 = std::move( c);
++ return std::move( c);
+ });
+ }
+ }
+@@ -290,7 +292,8 @@ void test_ontop_exception() {
+ const char * what = "hello world";
+ c.resume_with(
+ [what](ctx::continuation && c){
+- throw my_exception( std::move( c), what);
++ throw my_exception( std::move( c), what);
++ return std::move( c);
+ });
+ BOOST_CHECK_EQUAL( 3, value1);
+ BOOST_CHECK_EQUAL( std::string( what), value2);
+Index: boost_1_65_0/libs/fiber/src/context.cpp
+===================================================================
+--- boost_1_65_0.orig/libs/fiber/src/context.cpp
++++ boost_1_65_0/libs/fiber/src/context.cpp
+@@ -145,6 +145,7 @@ context::resume() noexcept {
+ // pass pointer to the context that resumes `this`
+ c_.resume_with([prev](boost::context::continuation && c){
+ prev->c_ = std::move( c);
++ return boost::context::continuation{};
+ });
+ }
+
+@@ -158,6 +159,7 @@ context::resume( detail::spinlock_lock &
+ c_.resume_with([prev,&lk](boost::context::continuation && c){
+ prev->c_ = std::move( c);
+ lk.unlock();
++ return boost::context::continuation{};
+ });
+ }
+
+@@ -171,6 +173,7 @@ context::resume( context * ready_ctx) no
+ c_.resume_with([prev,ready_ctx](boost::context::continuation && c){
+ prev->c_ = std::move( c);
+ context::active()->schedule( ready_ctx);
++ return boost::context::continuation{};
+ });
+ }
+
+@@ -218,6 +221,7 @@ context::suspend_with_cc() noexcept {
+ // pass pointer to the context that resumes `this`
+ return c_.resume_with([prev](boost::context::continuation && c){
+ prev->c_ = std::move( c);
++ return boost::context::continuation{};
+ });
+ }
+
+++ /dev/null
-Index: boost_1_63_0/libs/fiber/build/Jamfile.v2
-===================================================================
---- boost_1_63_0.orig/libs/fiber/build/Jamfile.v2
-+++ boost_1_63_0/libs/fiber/build/Jamfile.v2
-@@ -44,20 +44,6 @@ lib boost_fiber
- recursive_timed_mutex.cpp
- timed_mutex.cpp
- scheduler.cpp
-- : <link>shared:<library>../../context/build//boost_context
-- [ requires cxx11_auto_declarations
-- cxx11_constexpr
-- cxx11_defaulted_functions
-- cxx11_final
-- cxx11_hdr_mutex
-- cxx11_hdr_tuple
-- cxx11_lambdas
-- cxx11_noexcept
-- cxx11_nullptr
-- cxx11_rvalue_references
-- cxx11_template_aliases
-- cxx11_thread_local
-- cxx11_variadic_templates ]
-- ;
-+ : <link>shared:<library>../../context/build//boost_context ;
-
- boost-install boost_fiber ;
--- /dev/null
+Index: boost_1_65_0/libs/fiber/src/numa/linux/pin_thread.cpp
+===================================================================
+--- boost_1_65_0.orig/libs/fiber/src/numa/linux/pin_thread.cpp
++++ boost_1_65_0/libs/fiber/src/numa/linux/pin_thread.cpp
+@@ -9,6 +9,7 @@
+ extern "C" {
+ #include <pthread.h>
+ #include <sched.h>
++#include <string.h>
+ }
+
+ #include <system_error>
+++ /dev/null
-Index: boost_1_64_0/boost/context/continuation.hpp
-===================================================================
---- boost_1_64_0.orig/boost/context/continuation.hpp 2017-04-24 12:36:55.987412031 +0100
-+++ boost_1_64_0/boost/context/continuation.hpp 2017-04-24 12:37:49.730416122 +0100
-@@ -56,7 +56,7 @@
- namespace context {
- namespace detail {
-
--template< int N >
-+template<typename U>
- struct helper {
- template< typename T >
- static T convert( T && t) noexcept {
-@@ -64,8 +64,8 @@
- }
- };
-
--template<>
--struct helper< 1 > {
-+template<typename U>
-+struct helper< std::tuple<U> > {
- template< typename T >
- static std::tuple< T > convert( T && t) noexcept {
- return std::make_tuple( std::forward< T >( t) );
-@@ -239,15 +239,16 @@
-
- }
-
--template< typename Ctx, typename Fn, typename ... Arg >
-+template< typename Ctx, typename Fn, typename Arg >
- detail::transfer_t context_ontop( detail::transfer_t t) {
-- auto p = static_cast< std::tuple< Fn, std::tuple< Arg ... > > * >( t.data);
-+ auto p = static_cast< Arg * >( t.data);
- BOOST_ASSERT( nullptr != p);
- typename std::decay< Fn >::type fn = std::forward< Fn >( std::get< 0 >( * p) );
- t.data = & std::get< 1 >( * p);
- Ctx c{ t };
- // execute function, pass continuation via reference
-- std::get< 1 >( * p) = detail::helper< sizeof ... (Arg) >::convert( fn( std::move( c) ) );
-+ typedef typename std::decay<decltype(std::get<1>(*p))>::type H;
-+ std::get< 1 >(* p) = detail::helper<H>::convert( fn( std::move( c) ) );
- #if defined(BOOST_NO_CXX14_STD_EXCHANGE)
- return { detail::exchange( c.t_.fctx, nullptr), & std::get< 1 >( * p) };
- #else
-@@ -275,7 +276,7 @@
- template< typename Ctx, typename StackAlloc, typename Fn >
- friend class detail::record;
-
-- template< typename Ctx, typename Fn, typename ... Arg >
-+ template< typename Ctx, typename Fn, typename Arg >
- friend detail::transfer_t
- context_ontop( detail::transfer_t);
-
-@@ -354,7 +355,7 @@
- template< typename Fn, typename ... Arg >
- continuation resume_with( Fn && fn, Arg ... arg) {
- BOOST_ASSERT( nullptr != t_.fctx);
-- auto tpl = std::make_tuple( std::forward< Fn >( fn), std::forward< Arg >( arg) ... );
-+ auto tpl = std::make_tuple( std::forward< Fn >( fn), std::make_tuple( std::forward< Arg >( arg) ... ));
- return detail::ontop_fcontext(
- #if defined(BOOST_NO_CXX14_STD_EXCHANGE)
- detail::exchange( t_.fctx, nullptr),
-@@ -362,7 +363,7 @@
- std::exchange( t_.fctx, nullptr),
- #endif
- & tpl,
-- context_ontop< continuation, Fn, Arg ... >);
-+ context_ontop< continuation, Fn, decltype(tpl) >);
- }
-
- continuation resume() {
-@@ -451,7 +452,8 @@
- template<
- typename Fn,
- typename ... Arg,
-- typename = detail::disable_overload< continuation, Fn >
-+ typename = detail::disable_overload< continuation, Fn >,
-+ typename = detail::disable_overload< std::allocator_arg_t, Fn >
- >
- continuation
- callcc( Fn && fn, Arg ... arg) {
include $(TOPDIR)/rules.mk
PKG_NAME:=c-ares
-PKG_VERSION:=1.12.0
+PKG_VERSION:=1.13.0
PKG_RELEASE:=1
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://c-ares.haxx.se/download
-PKG_HASH:=8692f9403cdcdf936130e045c84021665118ee9bfea905d1a76f04d4e6f365fb
+PKG_SOURCE_URL:=https://c-ares.haxx.se/download
+PKG_HASH:=03f708f1b14a26ab26c38abd51137640cb444d3ec72380b21b20f1a8d2861da7
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/classpath
-PKG_MD5SUM:=0ae1571249172acd82488724a3b8acb4
+PKG_HASH:=f929297f8ae9b613a1a167e231566861893260651d913ad9b6c11933895fecc8
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
define Download/antlr
URL:=http://www.antlr.org/download
FILE:=antlr-3.4-complete.jar
- MD5SUM:=1b91dea1c7d480b3223f7c8a9aa0e172
+ HASH:=9d3e866b610460664522520f73b81777b5626fb0a282a5952b9800b751550bf7
endef
$(eval $(call Download,antlr))
include $(TOPDIR)/rules.mk
PKG_NAME:=confuse
-PKG_VERSION:=3.2
+PKG_VERSION:=3.2.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/martinh/libconfuse/releases/download/v$(PKG_VERSION)
-PKG_HASH:=a46abb8696026d314197b6a70ae1a1c296342a9a68aa69b1935709c1477a4e48
+PKG_HASH:=23c63272baf2ef4e2cbbafad2cf57de7eb81f006ec347c00b954819824add25e
PKG_MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
PKG_LICENSE:=ISC
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://ftp.cyrusimap.org/cyrus-sasl/
-PKG_MD5SUM:=a7f4e5e559a0e37b3ffc438c9456e425
+PKG_HASH:=8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3
PKG_LICENSE:=BSD-4c BSD
PKG_LICENSE_FILES:=COPYING cmulocal/COPYING saslauthd/COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/db-$(BASE_VERSION).NC
PKG_SOURCE:=db-$(BASE_VERSION).NC.tar.gz
PKG_SOURCE_URL:=http://download.oracle.com/berkeley-db/
-PKG_MD5SUM:=073ab7f20d24b3872a51ca762f5090e7
+PKG_HASH:=cd39c711023ff44c01d3c8ff0323eef7318660772b24f287556e6bf676a12535
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
PKG_LICENSE:=Sleepycat
PKG_VERSION:=1.4.2
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_HASH:=13456ee9840abbbcb956d0711c580d28524e2ee17840e556e744311f2d8afaac
PKG_SOURCE_URL:=https://www.kernel.org/pub/software/utils/dtc
-PKG_SOURCE_MD5SUM:=3d5814e31b2046ef51fca8fece998db0
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=GPL
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.ibr.cs.tu-bs.de/projects/ibr-dtn/releases
-PKG_MD5SUM:=37c33910ac7e760aad4db81724aeb4fb
+PKG_HASH:=29749f6c4e1b79e6973dc7436bcc6e0aee86ce27e1786f32a60feab652af8898
PKG_MAINTAINER:=Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
PKG_LICENSE:=Apache-2.0
PKG_RELEASE:=1
# Use this for official releasees
-PKG_MD5SUM:=6669e765c834e259fb7570f126b85d7e
+PKG_HASH:=cc14f09539aa95623e884f28e8be7bd67c37550d25e08288108a54fd294fd2a8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://ftp.libelektra.org/ftp/elektra/releases
PKG_SOURCE_URL:=https://my.balabit.com/downloads/eventlog/0.2/
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=3d6ebda8a161d36cb40d09328f78786b
+PKG_HASH:=494dac8e01dc5ce323df2ad554d94874938dab51aa025987677b2bc6906a9c66
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=expat
-PKG_VERSION:=2.2.2
+PKG_VERSION:=2.2.4
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/expat
-PKG_HASH:=4376911fcf81a23ebd821bbabc26fd933f3ac74833f74924342c29aad2c86046
+PKG_HASH:=03ad85db965f8ab2d27328abcf0bc5571af6ec0a414874b2066ee3fdd372019e
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>, \
Ted Hess <thess@kitschensync.net>
+++ /dev/null
-config FAAD2_ALWAYS_USE_FLOATING_POINT
- depends on PACKAGE_libfaad2
- bool "Build FAAD2 to use floating-point math even if using soft floats."
- default n
- help
- By default, libfaad2 will be built to use fixed point rather
- than floating point math if emulated floating point operations
- are being used. (See the CONFIG_SOFT_FLOAT option.) Set this
- option if you would like to use floating point math regardless
- of whether floating point emulation is in use.
-
- For the best real-time decoding ability, leave this option off.
include $(TOPDIR)/rules.mk
PKG_NAME:=faad2
-PKG_VERSION:=2.8.0~cvs20161113
+PKG_VERSION:=2.8.1
PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.xz
-PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/f/$(PKG_NAME)
-PKG_HASH:=de34bce327eac8a89cd58b7d44dfb58988033de6fda0ab9582ed0585fc3fd07e
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/faac/faad2-src/$(PKG_NAME)-2.8.0
+PKG_HASH:=f4042496f6b0a60f5ded6acd11093230044ef8a2fd965360c1bbd5b58780933d
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
-PKG_CONFIG_DEPENDS := \
- CONFIG_SOFT_FLOAT \
- CONFIG_FAAD2_ALWAYS_USE_FLOATING_POINT
-
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
MENU:=1
endef
-define Package/libfaad2/config
- source "$(SOURCE)/Config.in"
-endef
-
define Package/libfaad2/description
$(call Package/faad2/Default/description)
This package contains the library.
TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS+= --without-xmms
-# Use fixed point math, if we're using soft floats, and the user didn't
-# specifically ask to use floats anyways.
-#ifeq ($(CONFIG_SOFT_FLOAT)-$(CONFIG_FAAD2_ALWAYS_USE_FLOATING_POINT),y-)
-TARGET_CFLAGS+= -DFIXED_POINT
-CONFIGURE_ARGS+= -nfp
-#endif
+ifeq ($(CONFIG_SOFT_FLOAT),y)
+ TARGET_CFLAGS+= -DFIXED_POINT
+ CONFIGURE_ARGS+= -nfp
+endif
-CONFIGURE_VARS+= CPPFLAGS="-fno-builtin-cos -fno-builtin-sin -fno-builtin-log"
+ifeq ($(CONFIG_USE_UCLIBC),y)
+ CONFIGURE_VARS+= CPPFLAGS="-fno-builtin-cos -fno-builtin-sin -fno-builtin-log"
+endif
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.fastcgi.com/dist/
-PKG_MD5SUM:=d15060a813b91383a9f3c66faf84867e
+PKG_HASH:=66fc45c6b36a21bf2fbbb68e90f780cc21a9da1fffbae75e76d2b4402d3f05b9
PKG_FIXUP:=libtool-ucxx
PKG_SOURCE:=fftw-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.fftw.org
-PKG_MD5SUM:=927e481edbb32575397eb3d62535a856
+PKG_HASH:=a5de35c5c824a78a058ca54278c706cdf3d4abba1c56b63531c2cb05f5d57da2
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/fftw-$(PKG_VERSION)
PKG_FIXUP:=autoreconf
PKG_NAME:=file
PKG_VERSION:=5.25
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/file/
-PKG_MD5SUM:=e6a972d4e10d9e76407a432f4a63cd4c
+PKG_SOURCE_URL:=https://sources.lede-project.org/ \
+ http://pkgs.fedoraproject.org/lookaside/pkgs/file/ \
+ http://download.openpkg.org/components/cache/file/ \
+ ftp://ftp.astron.com/pub/file/
+PKG_HASH:=3735381563f69fb4239470b8c51b876a80425348b8285a7cded8b61d6b890eca
PKG_LICENSE:=BSD-2c
PKG_LICENSE_FILES:=COPYING
define Package/file/Default
TITLE:=File type determination
URL:=ftp://ftp.astron.com/pub/file/
- MAINTAINER:=Luka Perkov <luka@openwrt.org>
+ MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
endef
define Package/file
define Package/libmagic/install
$(INSTALL_DIR) $(1)/usr/lib
- $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,file))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://downloads.xiph.org/releases/flac/
-PKG_MD5SUM:=454f1bfa3f93cc708098d7890d0499bd
PKG_HASH:=91cfc3ed61dc40f47f050a109b08610667d73477af6ef36dcad31c31a4a8d53f
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/gdbm
-PKG_MD5SUM:=72c832680cf0999caedbe5b265c8c1bd
+PKG_HASH:=8d912f44f05d0b15a4a5d96a76f852e905d051bb88022fcdfd98b43be093e3c3
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/giflib
-PKG_MD5SUM:=323a9f11ab56c8a2d1715376410ce376
+PKG_HASH:=76c0a084c3b02f9315ff937b8be6096186002fea26f33e2123081ba2be6e2a7c
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
include $(TOPDIR)/rules.mk
PKG_NAME:=glib2
-PKG_VERSION:=2.52.3
+PKG_VERSION:=2.53.7
PKG_RELEASE:=1
PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz
PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
-PKG_SOURCE_URL:=@GNOME/glib/2.52
-PKG_HASH:=25ee7635a7c0fcd4ec91cbc3ae07c7f8f5ce621d8183511f414ded09e7e4e128
+PKG_SOURCE_URL:=@GNOME/glib/2.53
+PKG_HASH:=028efbf6df4d88d7725314456524b923169f4d4f8503347194b2baf2222f3e33
PKG_BUILD_PARALLEL:=1
HOST_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=096e4be3f83878ccf70e1fdb62ad1c178715ef8c0d244254c29e2f9f0c1afa70
-PKG_MD5SUM:=ad4f681463db1b78ad88b956b736fa25
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
#
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=gperf
-PKG_VERSION:=3.0.4
+PKG_VERSION:=3.1
PKG_RELEASE:=1
-PKG_MD5SUM:=c1f1db32fb6598d6a93e6e88796a8632
+PKG_HASH:=588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/gperf
--- /dev/null
+diff --git a/lib/Makefile.in b/lib/Makefile.in
+index 29bbf92..cf2bf3c 100644
+--- a/lib/Makefile.in
++++ b/lib/Makefile.in
+@@ -61,7 +61,7 @@ SHELL = /bin/sh
+ VPATH = $(srcdir)
+
+ OBJECTS = getopt.$(OBJEXT) getopt1.$(OBJEXT) getline.$(OBJEXT) hash.$(OBJEXT)
+-CPPFLAGS = @CPPFLAGS@ -I$(srcdir)
++CPPFLAGS = -I$(srcdir) @CPPFLAGS@
+
+ TARGETLIB = libgp.a
+
+diff --git a/src/Makefile.in b/src/Makefile.in
+index 6866ffd..bd4df14 100644
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -64,7 +64,7 @@ VPATH = $(srcdir)
+ OBJECTS = version.$(OBJEXT) positions.$(OBJEXT) options.$(OBJEXT) keyword.$(OBJEXT) keyword-list.$(OBJEXT) \
+ input.$(OBJEXT) bool-array.$(OBJEXT) hash-table.$(OBJEXT) search.$(OBJEXT) output.$(OBJEXT) main.$(OBJEXT)
+ LIBS = ../lib/libgp.a @GPERF_LIBM@
+-CPPFLAGS = @CPPFLAGS@ -I. -I$(srcdir)/../lib
++CPPFLAGS = -I. -I$(srcdir)/../lib @CPPFLAGS@
+
+ TARGETPROG = gperf$(EXEEXT)
+
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=hidapi-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=95b39035f94c35b0c360ec2e02a01fe25e971490135d7137f163974d4a88471f
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE-bsd.txt
PKG_SOURCE_VERSION:=010756025e8cefd1bc66c6d4ed3b1648ef6f1f95
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=ac774e318215cbfad4b8e493a84b4fe9a03f9882828ea01eac5357f28b5e9cd4
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.ibr.cs.tu-bs.de/projects/ibr-dtn/releases
-PKG_MD5SUM:=0104763ede969c470f32244d76c234b8
+PKG_HASH:=9c457c1ebc01e6216524636628c647bef34ab11bd96f0e0788be8749374fdc20
PKG_MAINTAINER:=Johannes Morgenroth <jm@m-network.de>
PKG_LICENSE:=Apache-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.ibr.cs.tu-bs.de/projects/ibr-dtn/releases
-PKG_MD5SUM:=37208be202f199f1790983ff78b2fa8f
+PKG_HASH:=288b14ccbaefb5e3234065c2778c247797ccb3c7afbb6746bb37dc12c620d360
PKG_MAINTAINER:=Johannes Morgenroth <jm@m-network.de>
PKG_LICENSE:=Apache-2.0
PKG_SOURCE:=$(PKG_NAME)-59_1-src.tgz
PKG_SOURCE_URL:=http://download.icu-project.org/files/$(PKG_NAME)/$(PKG_VERSION)
-PKG_MD5SUM:=54923fa9fab5b2b83f235fb72523de37
PKG_HASH:=7132fdaf9379429d004005217f10e00b7d2319d0fea22bdfddef8991c45b75fe
PKG_LICENSE:=ICU-1.8.1+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@GNOME/intltool/$(PKG_LIBVER)
-PKG_MD5SUM:=69bc0353323112f42ad4f9cf351bc3e5
+PKG_HASH:=4d1e5f8561f09c958e303d4faa885079a5e173a61d28437d0013ff5efc9e3b64
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_HOST_ONLY:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.nlnetlabs.nl/downloads/ldns
-PKG_MD5SUM:=a79423bcc4129e6d59b616b1cae11e5e
+PKG_HASH:=8b88e059452118e8949a2752a55ce59bc71fa5bc414103e17f5b6b06f9bcc8cd
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/liba/libaio/
-PKG_MD5SUM:=2a35602e43778383e2f4907a4ca39ab8
+PKG_HASH:=e019028e631725729376250e32b473012f7cb68e1f7275bfc1bbcdd0f8745f7e
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_LICENSE:=LGPL-2.1
PKG_NAME:=libantlr3c
PKG_VERSION:=3.2
PKG_RELEASE:=1
-PKG_MD5SUM:=674646e1d1bf5c6015435480cead725a
+PKG_HASH:=2ccfb8a8bdd3d6c1d60742ff3a5a954af6d5a8d7f8901c87229fc6fa540ac99a
PKG_SOURCE_URL:=http://www.antlr3.org/download/C
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.xiph.org/releases/ao/
-PKG_MD5SUM:=9f5dd20d7e95fd0dd72df5353829f097
+PKG_HASH:=03ad231ad1f9d64b52474392d63c31197b0bc7bd416e58b1c10a329a5ed89caf
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
include $(TOPDIR)/rules.mk
PKG_NAME:=libarchive
-PKG_VERSION:=3.3.1
+PKG_VERSION:=3.3.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.libarchive.org/downloads
-PKG_HASH:=29ca5bd1624ca5a007aa57e16080262ab4379dbf8797f5c52f7ea74a3b0424e7
+PKG_HASH:=ed2dbd6954792b2c054ccf8ec4b330a54b85904a80cef477a1c74643ddafa0ce
PKG_MAINTAINER:=Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
PKG_LICENSE:=BSD-2-Clause
--enable-bsdtar=shared \
--disable-acl \
--disable-xattr \
- --without-lzo2 \
--without-nettle \
--without-xml2 \
--without-lz4 \
+ --without-cng \
ifeq ($(BUILD_VARIANT),noopenssl)
CONFIGURE_ARGS += --without-openssl
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/OpenLightingProject/libartnet/releases/download/1.1.2
-PKG_MD5SUM:=dcceab3efe3dae4c18fa549dbd198e71
+PKG_HASH:=19cdda434e208a81ddd138377f11046364438e40e34542ae101d6aa3fcaec696
PKG_MAINTAINER:=Martijn Zilverschoon <martijn@friedzombie.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNOME/$(PKG_NAME)/0.3
-PKG_MD5SUM:=ea2449ad3f201ec590d811db9da6d02ffc5e87a677d06b92ab15363d8cb59782
+PKG_HASH:=ea2449ad3f201ec590d811db9da6d02ffc5e87a677d06b92ab15363d8cb59782
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_NAME:=libavl
PKG_VERSION:=0.3.5
PKG_RELEASE:=1
-PKG_MD5SUM:=882c68ea7f71876ca110f3b84d7ab12d
+PKG_HASH:=4497b9e22cdd61ae2fa893b9d5fd6213dc306726d7c4be08c29e173622dca8a0
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/liba/libavl
PKG_SOURCE_VERSION:=8bfe0ac00cdb
PKG_SOURCE_URL:=http://dev.automforge.net/CanFestival-3/archive/$(PKG_SOURCE_VERSION).tar.bz2?_dummyfilename=
PKG_SOURCE:=CanFestival-3-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_HASH:=0bee7aaef266fc579922ca159b7acbe9cdc9a936ac1f30402814844b007f7185
PKG_SOURCE_SUBDIR:=CanFestival-3-$(PKG_SOURCE_VERSION)
-PKG_MIRROR_HASH:=0bee7aaef266fc579922ca159b7acbe9cdc9a936ac1f30402814844b007f7185
PKG_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2
-PKG_MD5SUM:=6666b839e5d46c2ad33fc8aa2ceb5f77
+PKG_HASH:=693c8ac51e983ee678205571ef272439d83afe62dd8e424ea14ad9790bc35162
PKG_MAINTAINER:=Paul Wassi <p.wassi@gmx.at>
PKG_INSTALL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=libcoap
-PKG_RELEASE:=3
+PKG_VERSION:=v4.1.2
+PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/obgm/libcoap
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
-PKG_SOURCE_VERSION:=2da31de732c0e51a9bc9e1d4aea21e25da89cf87
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_SOURCE_VERSION:=fa5248603049ddf95cc84608aad569120763bf2b
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=0ab4bc9569a78904743cc3074fd1c0fc9c78c85fd510fef5145dd872523619e6
PKG_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
PKG_LICENSE:=GPL-2.0+ BSD-2-Clause
Constrained Application Protocol (RFC 7252) library
endef
+define Package/coap-client
+ SECTION:=utils
+ CATEGORY:=Utilities
+ DEPENDS:=+libcoap
+ TITLE:=CoAP (RFC 7252) client tool
+endef
+
+define Package/coap-client/description
+ Constrained Application Protocol (RFC7252) client tool
+endef
+
+define Package/coap-server
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=+libcoap
+ TITLE:=CoAP (RFC 7252) server programs
+endef
+
+define Package/coap-server/description
+ Constrained Application Protocol (RFC 7252) server and resource directory server
+endef
+
TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
- --disable-examples \
+ --enable-examples \
--disable-documentation
ifeq ($(CONFIG_BIG_ENDIAN),y)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcoap-1.so* $(1)/usr/lib/
endef
+define Package/coap-client/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/coap-client $(1)/usr/bin/
+endef
+
+define Package/coap-server/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/coap-server $(1)/usr/bin/
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/coap-rd $(1)/usr/bin/
+endef
+
$(eval $(call BuildPackage,libcoap))
+$(eval $(call BuildPackage,coap-client))
+$(eval $(call BuildPackage,coap-server))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://0pointer.de/lennart/projects/libdaemon/
-PKG_MD5SUM:=509dc27107c21bcd9fbf2f95f5669563
+PKG_HASH:=fd23eb5f6f986dcc7e708307355ba3289abe03cc381fc47a80bca4a50aa6b834
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=https://www.snort.org/downloads/snort/ \
@SF/snort
PKG_SOURCE:=daq-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=65e51d72e9d5d8b397e192e4e5857eff
+PKG_HASH:=a294aa3d01cd8902bf842d320e7f2c043af9ead95d0e7198c3b71a0dbc9d253c
PKG_BUILD_DIR:=$(BUILD_DIR)/daq-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/libdbi-drivers
-PKG_MD5SUM:=9f47b960e225eede2cdeaabf7d22f59f
+PKG_HASH:=43d2eacd573a4faff296fa925dd97fbf2aedbf1ae35c6263478210c61004c854
PKG_LICENSE:=LGPL-2.1
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/libdbi
-PKG_MD5SUM:=05e2ceeac4bc85fbe40de8b4b22d9ab3
+PKG_HASH:=dafb6cdca524c628df832b6dd0bf8fabceb103248edb21762c02d3068fca4503
PKG_LICENSE:=LGPL-2.1
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=libdmapsharing-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.flyn.org/projects/libdmapsharing/
-PKG_MD5SUM:=2494161340c4c3c36907359eeddc4da3
+PKG_HASH:=165952dced0d0561dd7d3f2db5d40605d9ecff999ab7530db63e8a60343b0615
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/dugsong/libdnet/archive
-PKG_MD5SUM:=d2f1b72eac2a1070959667e9e61dcf20
+PKG_HASH:=b6360659c93fa2e3cde9e0a1fc9c07bc4111f3448c5de856e095eb98315dd424
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=0d25506a2e7fb52928963313343e0237e890059e
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=7466f634421f3136174cbc2b00635788509a3312894de28367f31d891fd401ad
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/google/double-conversion.git
-PKG_MD5SUM:=8dd6ac234054f9a6fe7f62ef1c9b5c20
PKG_LICENSE_FILES:=COPYING LICENSE
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE_URL:=http://dri.freedesktop.org/libdrm
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=920957cfe25a80efb02be9bd90bf3c1e
+PKG_HASH:=b17d4b39ed97ca0e4cffa0db06ff609e617bac94646ec38e8e0579d530540e7b
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://thrysoee.dk/editline/
-PKG_MD5SUM:=b6e60f326a3fce91bea1a6fe4700af58
+PKG_HASH:=b6b159c0c6ec8a7f349ea2a75d8b960efa346c462c1ac4921f1ac0de85a9f5d6
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL:=1
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libedit.{a,so*} $(1)/usr/lib/
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libedit.pc $(1)/usr/lib/pkgconfig
endef
define Package/libedit/install
PKG_SOURCE_VERSION=10e9a6df9f76da610941addf71b9a3cbf94f2e9f
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=6f703766be05cc0cd861790ee041d1c2910b6d6e7bb8805ed739839c7801bfcc
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_SOURCE_URL:=http://libestr.adiscon.com/files/download/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=f4c9165a23587e77f7efe65d676d5e8e
+PKG_HASH:=bd655e126e750edd18544b88eb1568d200a424a0c23f665eb14bbece07ac703c
PKG_MAINTAINER:=Dov Murik <dmurik@us.ibm.com>
PKG_LICENSE:=LGPL-2.1+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://dist.schmorp.de/libev/Attic/
-PKG_MD5SUM:=bf0007e37240103d3c2be80ca9bee3f9
+PKG_HASH:=736079e8ac543c74d59af73f9c52737b3bfec9601f020bf25a87a4f4d0f01bd6
PKG_LICENSE:=BSD-2-Clause
PKG_MAINTAINER:=Karl Palsson <karlp@tweak.net.au>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-release-$(PKG_VERSION)-stable
PKG_SOURCE:=release-$(PKG_VERSION)-stable.tar.gz
PKG_SOURCE_URL:=https://github.com/libevent/libevent/archive/
-PKG_MD5SUM:=6dce6fe39f133c09ffe63de895805f7f
+PKG_HASH:=e9a32238a98954081d7ed9918d8f799eb4c743fd570749c0721585140dd5de21
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_FIXUP:=autoreconf
PKG_LICENSE:=BSD-3-Clause
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/ellzey/libevhtp.git
+PKG_SOURCE_URL:=https://chromium.googlesource.com/external/github.com/ellzey/libevhtp
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=91071e2f20749cd469b87ac2ef1c158dc2a6806f
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=c9c4415539e78ac9021a8507cd16b9101564dd03286bc84428cc1ee11f0df1fd
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/libexif
-PKG_MD5SUM:=27339b89850f28c8f1c237f233e05b27
+PKG_HASH:=16cdaeb62eb3e6dfab2435f7d7bccd2f37438d21c5218ec4e58efa9157d4d41a
PKG_LICENSE:=LGPL-2.1
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=226e77c58f09acb6b595ea6c6b93f673
PKG_HASH:=84128170a4a9aa3a19942dd53fdf30ed17b56d7fae79b5f6e7e17a0d65d1f66c
PKG_LICENSE:=GPL-3.0
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=66676a4c8de8c5399dfe1cfd064d140afca58e3d8187bae0a3dccdf83165d9d1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/rsyslog/libfastjson.git
PKG_NAME:=libffi
PKG_VERSION:=3.2.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://sourceware.org/pub/libffi/
-PKG_MD5SUM:=83b89587607e3eb65c70d361f13bab43
+PKG_HASH:=d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
$(1)/usr/lib/
endef
+define Host/Install
+ $(call Host/Install/Default)
+ # Adjust host libffi headers ; the default rule does
+ # not seem to install them to the proper include folder
+ $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/include
+ $(CP) \
+ $(STAGING_DIR_HOSTPKG)/lib/libffi-$(PKG_VERSION)/include/*.h \
+ $(STAGING_DIR_HOSTPKG)/include
+endef
+
$(eval $(call HostBuild))
$(eval $(call BuildPackage,libffi))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.intra2net.com/en/developer/libftdi/download/
-PKG_MD5SUM:=355d4474e3faa81b485d6a604b06951f
+PKG_HASH:=3176d5b5986438f33f5208e690a8bfe90941be501cc0a72118ce3d338d4b838e
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=LGPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.intra2net.com/en/developer/libftdi/download/
-PKG_MD5SUM:=156cdf40cece9f8a3ce1582db59a502a
+PKG_HASH:=9a8c95c94bfbcf36584a0a58a6e2003d9b133213d9202b76aec76302ffaa81f4
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=LGPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.gnupg.org/gcrypt/libgcrypt
-PKG_MD5SUM:=944cf6595021d0c33478148a315b335b
+PKG_HASH:=f9461b4619bb78b273a88d468915750d418e89a3ea3b641bab0563a9af4b04d0
PKG_FIXUP:=patch-libtool
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNOME/libgee/0.18/
-PKG_MD5SUM:=29ea6125e653d7e60b49a9a9544abc96
+PKG_HASH:=4ad99ef937d071b4883c061df40bfe233f7649d50c354cf81235f180b4244399
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.gnupg.org/gcrypt/libgpg-error
-PKG_MD5SUM:=8f0eb41a344d19ac2aa9bd101dfb9ce6
+PKG_HASH:=cafc9ed6a87c53a35175d5a1220a96ca386696eef2fa059cc0306211f246e55f
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_LICENSE_FILES:=LICENSE-MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MIRROR_HASH:=721ee45b09e8d999e814afe60508bcf0c8d35940cb71417ee96c0db5cdc161ff
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=git://github.com/joyent/http-parser.git
PKG_SOURCE_PROTO:=git
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=7c39b3448e4927a2de2775d853f52b3aaeb42400970a3db0b01a78987e6ec0b7
PKG_SOURCE_URL:=@SF/freeassociation
-PKG_MD5SUM:=
PKG_LICENSE:=LGPL-2.1 MPL-1.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/mad
-PKG_MD5SUM:=e5808ad997ba32c498803822078748c3
+PKG_HASH:=63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/libidn
-PKG_MD5SUM:=a9aa7e003665de9c82bd3f9fc6ccf308
+PKG_HASH:=44a7aab635bb721ceef6beecc4d49dfd19478325e1b47f3196f7d2acc4930e19
PKG_LICENSE:=GPL-2.0+ GPL-3.0+ LGPL-2.1+ LGPL-3.0+ Apache-2.0
PKG_LICENSE_FILES:=COPYING COPYINGv2 COPYINGv3 COPYING.LESSERv2 COPYING.LESSERv3 java/LICENSE-2.0.txt
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=13bf235cac2201747de11652cf14fe2714ca0718
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=4e8892b27f20216f86d69b36ad2229fca87cdf0a10f8d3e145d01841a492562a
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)src.v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.ijg.org/files
-PKG_MD5SUM:=3353992aecaee1805ef4109aadd433e7
+PKG_HASH:=3a753ea48d917945dd54a2d97de388aa06ca2eb1066cbfdc6652036349fe05a7
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=IJG
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/liblo
-PKG_MD5SUM:=e2a4391a08b49bb316c03e2034e06fa2
+PKG_HASH:=da94a9b67b93625354dd89ff7fe31e5297fc9400b6eaf7378c82ee1caf7db909
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Darik Horn <dajhorn@vanadac.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=afb362b970816e06dac4997d26dd7d2cdb83168510228d174d25b1044b271e18
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/lz4/lz4.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/mad \
ftp://ftp.mars.org/pub/mpeg/
-PKG_MD5SUM:=1be543bc30c56fb6bea1d7bf6a64e66c
+PKG_HASH:=bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPLv2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/mcrypt
-PKG_MD5SUM:=c4f491dd411a09e9de3b8702ea6f73eb
+PKG_HASH:=bf2f1671f44af88e66477db0982d5ecb5116a5c767b0a0d68acb34499d41b793
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
#
-# Copyright (C) 2010-2014 OpenWrt.org
-#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
PKG_NAME:=libmms
PKG_VERSION:=0.6.4
-PKG_RELEASE:=2
+PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/libmms
-PKG_MD5SUM:=d6b665b335a6360e000976e770da7691
+PKG_HASH:=3c05e05aebcbfcc044d9e8c2d4646cd8359be39a3f0ba8ce4e72a9094bee704f
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=LGPLv2.1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
define Package/libmms
SECTION:=libs
CATEGORY:=Libraries
- DEPENDS:=+glib2
TITLE:=MMS stream protocol library
URL:=http://libmms.sourceforge.net
- DEPENDS:=$(ICONV_DEPENDS)
endef
define Package/libmms/description
endef
TARGET_CFLAGS += $(FPIC)
-TARGET_LDFLAGS += $(if $(ICONV_FULL),-liconv)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
--- /dev/null
+--- a/pkgconfig/libmms.pc.in
++++ b/pkgconfig/libmms.pc.in
+@@ -5,7 +5,6 @@ includedir=@includedir@/
+
+ Name: libmms
+ Description: Library implementing the MMS protocol
+-Requires: glib-2.0
+ Version: @VERSION@
+ Libs: -L${libdir} -lmms -lm
+ Cflags: -I${includedir}
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://libmodbus.org/releases
-PKG_MD5SUM:=b1a8fd3a40d2db4de51fb0cbcb201806
+PKG_HASH:=c8c862b0e9a7ba699a49bc98f62bdffdfafd53a5716c0e162696b4bf108d3637
PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_HASH:=15fe693893c0d7ea3f4c35c4016fbd0332836164178b20983eec9b470846baf6
PKG_SOURCE_URL:=http://www.musicpd.org/download/libmpdclient/2/
PGK_HASH:=15fe693893c0d7ea3f4c35c4016fbd0332836164178b20983eec9b470846baf6
PKG_SOURCE:=libmpeg2-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://libmpeg2.sourceforge.net/files/
-PKG_MD5SUM:=0f92c7454e58379b4a5a378485bbd8ef
+PKG_HASH:=dee22e893cb5fc2b2b6ebd60b88478ab8556cb3b93f9a0d7ce8f3b61851871d4
PKG_INSTALL:=1
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=70600dece4138b0c0dbaff42f57828f1559cd840
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=9cbda58e7c7790db3d62cee62f399975effcdc2d9688d3d6bb2b4a86748faff9
PKG_BUILD_DEPENDS:=node python/host swig/host node/host
CMAKE_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://miniupnp.free.fr/files
-PKG_MD5SUM:=7c9a7c76e200ead4e6447fe4b105f676
+PKG_HASH:=b2ce5e626a21c795cba2d118f26e54aaa89de29d4611c440fafc49a2a5bedabb
PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
PKG_LICENSE:=BSD-3c
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=4e8fe352bd739c76c980f52904a4a2eefbc17ad68e55603c6c19598d7ccfba3c
PKG_LICENSE:=LGPLv3
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://sourceforge.net/projects/libnet-dev/files/
-PKG_MD5SUM:=f051e6e5bdecddb90f77c701c2ca1804
+PKG_HASH:=72c380785ad44183005e654b47cc12485ee0228d7fa6b0a87109ff7614be4a63
PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE:=BSD-3-Clause
PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
-PKG_VERSION:=0.8.56
+PKG_VERSION:=0.9.15
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=4d13eca938085298edbad6a731d77dfd55c8d514
-PKG_MIRROR_HASH:=88d1ab14a945c8c8c9fadfb248568294ac5f62dea3b8d99e60dbb8262f7107bc
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_SOURCE_VERSION:=cea46db1edb72231c9e009d7e6d6799256676eb8
+PKG_MIRROR_HASH:=a686754cef2ef29a511b8ea06d121f0ce562b570d6cea6c6a7562ff47b91d2a2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/cesnet/libnetconf2/
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_BUILD_ROOT:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)
http://www.netfilter.org/projects/libnetfilter_acct/files/ \
ftp://ftp.netfilter.org/pub/libnetfilter_acct/ \
http://mirrors.evolva.ro/netfilter.org/libnetfilter_acct/
-PKG_MD5SUM:=2118d9514c079839ebd9cb3144ad2ad7
+PKG_HASH:=0128f19c3419fbd84f7e6d46b13a33ef7bda9b9f5e493bc5ae1882d087514b71
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=60a81fbd199551ac5dd017b9a44fb46e8530680b
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=ce67b91ea54dda6678321e05a3e584648032a31323409a76df5dd60e7bfd17de
PKG_MAINTAINER:=John Clark <inindev@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://downloads.xiph.org/releases/ogg/
-PKG_MD5SUM:=5c3a34309d8b98640827e5d0991a4015
+PKG_HASH:=3f687ccdd5ac8b52d76328fbbfebc70c459a40ea891dbf3dccb74a210826e79b
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=BSD-3-Clause
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://liboil.freedesktop.org/download/
-PKG_MD5SUM:=47dc734f82faeb2964d97771cfd2e701
+PKG_HASH:=105f02079b0b50034c759db34b473ecb5704ffa20a5486b60a8b7698128bfc69
PKG_LICENSE:=FREE
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://noping.cc/files
-PKG_MD5SUM:=9c9f65bfd297d7e7092c7f219c31f66a
+PKG_HASH:=44bb1d88b56b88fda5533edb3aa005c69b3cd396f20453a157d7e31e536f3530
PKG_FIXUP:=autoreconf
PKG_SOURCE:=Linux-PAM-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.linux-pam.org/library/
-PKG_MD5SUM:=ee4a480d77b341c99e8b1375f8f180c0
+PKG_HASH:=cd8beac5961e942e9c73b32a3cd1a3457755f8fb35d07c9ec64511e19e135ea4
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=62ec804736435fa34e37e66e228e17e2aacee1d7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=0b6a7656b431f78b0f11370938e577bc16f30d2255ad675bf4b63a96876fb290
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE:=radcli-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/radcli/radcli/releases/download/$(PKG_VERSION)/
-PKG_MD5SUM:=b94e46e37668cc562ea5420d095a836b
+PKG_HASH:=be7551bcf0c210b8efffe4d2952d61feb8591edc922660910488bfaab040e82c
PKG_BUILD_DIR:=$(BUILD_DIR)/radcli-$(PKG_VERSION)
PKG_INSTALL:=1
--- /dev/null
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libredblack
+PKG_VERSION:=0.2.3
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_LICENSE:=GPL-2.0+
+PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=a399310d99b61eec4d3c0677573ab5dddcf9395d
+PKG_MIRROR_HASH:=71b05e70988b97865f734c698dd5564e349680556ccb8634a5bddf344012f22a
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/sysrepo/libredblack.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
+
+PKG_BUILD_ROOT:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+define Package/libredblack
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=RedBlack tree library
+ URL:=$(PKG_SOURCE_URL)
+endef
+
+define Package/libredblack/description
+ RedBlack Balanced Tree Searching and Sorting Library.
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libredblack.{so*,a,la} $(1)/usr/lib/
+
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/redblack.h $(1)/usr/include/
+endef
+
+define Package/libredblack/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libredblack.{so*,a,la} $(1)/usr/lib/
+
+ $(INSTALL_DIR) $(1)/usr/include
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/include/redblack.h $(1)/usr/include
+endef
+
+$(eval $(call BuildPackage,libredblack))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.mega-nerd.com/SRC/
-PKG_MD5SUM:=1c7fb25191b4e6e3628d198a66a84f47
+PKG_HASH:=93b54bdf46d5e6d2354b7034395fe329c222a966790de34520702bb9642f1c06
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=8998e7b2c5587f0b94c48db24e2952d08def5add
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=125f40beb7d310e65571cb0d93f157b196e83423fde69bebf9880ca1cfac6c46
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/seccomp/libseccomp/releases/download/v$(PKG_VERSION)/
-PKG_MD5SUM:=068af8e1bc36fcd4b326ee83875ab4fd
+PKG_HASH:=0ba1789f54786c644af54cdffc9fd0dd0a8bb2b2ee153933f658855d2851a740
PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
PKG_INSTALL:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/libshout/
-PKG_MD5SUM:=89cebf8cb0197f639cde69c95177fe47
PKG_HASH:=f3acb8dec26f2dbf6df778888e0e429a4ce9378a9d461b02a7ccbf2991bbf24d
PKG_LICENSE:=LGPL-2.0+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNOME/libsigc++/2.5
-PKG_MD5SUM:=0b74492da5f640ab69888a984c6520d7
+PKG_HASH:=ecf55f53d6058ba6e41985b862f2e95fb5c2b31c008caa16984e790547337ea7
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_LICENSE:=LGPL-2.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNOME/$(PKG_NAME)/2.54
-PKG_MD5SUM:=73b1fb774de16c29b380f87016f9f9dd
+PKG_HASH:=47b42c232034734d66e5f093025843a5d8cc4b2357c011085a2fd04ef02dd633
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_VERSION:=$(PKG_VERSION)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=939259d5c02bbe55cf8329e7bd05ce4d660e37d5c97fcbb0fdeef04f11a63e7f
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
Mike Brady <mikebrady@eircom.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://red.libssh.org/attachments/download/218/
-PKG_MD5SUM:=d3fc864208bf607ad87cdee836894feb
+PKG_HASH:=54e86dd5dc20e5367e58f3caab337ce37675f863f80df85b6b1614966a337095
CMAKE_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.libssh2.org/download
-PKG_MD5SUM:=b01662a210e94cccf2f76094db7dac5c
+PKG_HASH:=e4561fd43a50539a8c2ceb37841691baf03ecb7daf043766da1b112e4280d584
PKG_INSTALL:=1
PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=9931ad4fa2aa7f204c608010eb2ebf84bcf7d542
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MIRROR_MD5SUM:=6a499bcfc7c52db6765957ff38f48a344ad121ac0b665fd3d4adb7d8deadc427
+PKG_MIRROR_HASH:=6a499bcfc7c52db6765957ff38f48a344ad121ac0b665fd3d4adb7d8deadc427
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.samba.org/ftp/talloc/
-PKG_MD5SUM:=d6763d65d03d627816ae1d50c74576fe
+PKG_HASH:=19154e728e48d29c7398f470b0a59d093edc836156b41ffe20d247d6ec9fa006
PKG_MAINTAINER:=Lucile Quirion <lucile.quirion@savoirfairelinux.com>
PKG_LICENSE:=LGPL-3.0+
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://downloads.xiph.org/releases/theora/
-PKG_MD5SUM:=292ab65cedd5021d6b7ddd117e07cd8e
+PKG_HASH:=b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=COPYING LICENSE
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=14e793b75dac95c51ad64ff9cd2dc6772b68c625
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=0971c21d0e6b7028bc319e97c82bdb213c17dfc503fc0f89b809e5ed7ce98142
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_SOURCE_VERSION:=1f21323b817e70253d3c04bc8bedd61c477d0544
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=cc885851c97dcaef65d7f4fb0899ed1a01412b02e44851476ac47ce4da024d0b
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/jiixyj/libudev-fbsd.git
PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/85
-PKG_MD5SUM:=5cd543cb8e7bce83a22c07a0579c95a1
+PKG_HASH:=b94aef08eab5359d0facaa7ead2ce81b193eef0c61379d9835213ebc0a46257a
PKG_LICENSE:=BSD-2-Clause
PKG_LICENSE_FILES:=COPYRIGHT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/mhei/libugpio/releases/download/v$(PKG_VERSION)
-PKG_MD5SUM:=09c35abbc25f7ebff125bc43ff21ac35
+PKG_HASH:=07d96b46560f42843e46869f45f53d48afee71f9bbcf06f43267fafad0d50b05
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=COPYING.LESSER
PKG_NAME:=libunistring
PKG_VERSION:=0.9.6
PKG_RELEASE:=1
-PKG_MD5SUM:=dfae4ff5583649ed24d8f368f1d0543b
+PKG_HASH:=9625eec2507f4789ebb6fc48ebda98be0e0168979a2f68aa8b680bf8eeabbd47
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/libunistring
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=04dc6df4297a7766d6f1a8fef9699d586e7e0d92
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=26bc9c32eea0b8aa6218735e30a3d2317431518f0b2a055c0f21e78e6d92ca4f
CMAKE_INSTALL:=1
PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/pupnp
-PKG_MD5SUM:=ee16e5d33a3ea7506f38d71facc057dd
+PKG_HASH:=b3142b39601243b50532eec90f4a27dba85eb86f58d4b849ac94edeb29d9b22a
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_FIXUP:=autoreconf
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.lesbonscomptes.com/upmpdcli/downloads
-PKG_MD5SUM:=1b10905a365fc6277e1d8ced77278666
+PKG_HASH:=13027f8e2b5341d00370ccf34eb8845f1bce73ec58890c02a38dc639e9f91b13
PKG_MAINTAINER:=Petko Bordjukov <bordjukov@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=userspace-rcu-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://lttng.org/files/urcu/
-PKG_MD5SUM:=49f86e68c1e2f41d303381a271b791d1
+PKG_HASH:=8f7fa313b1e0a3f742cea24ce63a39c0efe63e615a769e2961e55bd2663ecaa3
PKG_BUILD_DIR:=$(BUILD_DIR)/userspace-rcu-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=4397b3376dc4e4cb1c991d0aed61ce6482614196
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=e145b567cdefb1d2536f3eec863769c77474ce9a5d9c4c81ab0a75dc6fe3056a
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=libuv
-PKG_VERSION:=1.11.0
+PKG_VERSION:=1.14.0
PKG_RELEASE:=1
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://dist.libuv.org/dist/v$(PKG_VERSION)/
-PKG_MD5SUM:=29bdf5e00fb8e0c8392aac53a2cc380a
+PKG_HASH:=7267f1564fc6bd84e1721ad7e3cdd7b5da06faab9fa09522f33589dc08d3edf9
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=93f33620e00276989211d9c129a6d8b5e0f45df8d23235ff0c53c823c52a5ef5
PKG_LICENSE:=BSD
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.linuxtv.org/downloads/v4l-utils
-PKG_MD5SUM:=945a38979138997e805828a4a53e53ec
+PKG_HASH:=78ead27ee58a701d7c6342303cf4520bdd4a2b88a7813bc99a0b389307e4336b
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://downloads.xiph.org/releases/vorbis/
-PKG_MD5SUM:=28cb28097c07a735d6af56e598e1c90f
+PKG_HASH:=54f94a9527ff0a88477be0a71c0bab09a4c3febe0ed878b24824906cd4b0e1d1
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=BSD-3-Clause
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=b56ffce0c0773ec5ca04c466bc00b1bbcaf65aef
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=45a3ae74fffa32a9e0255132ec2cc4d5413af32699562a89278bc0e561bfbed7
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_REV:=v$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_MIRROR_HASH:=3c1e9ef2b40f71daa5c75e83dc682dc50acce597a34cd17d167f46ff2f6d08b7
PKG_SOURCE_URL:=https://chromium.googlesource.com/webm/libvpx
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_NAME:=libwebsockets
PKG_VERSION:=2.2.1
-PKG_RELEASE:=1
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
VARIANT:=openssl
endef
-define Package/libwebsockets-cyassl
+define Package/libwebsockets-wolfssl
$(call Package/libwebsockets/Default)
- TITLE += (CyaSSL)
+ TITLE += (WolfSSL)
DEPENDS += +libcyassl
- VARIANT:=cyassl
+ VARIANT:=wolfssl
endef
define Package/libwebsockets-full
CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
endif
-ifeq ($(BUILD_VARIANT),cyassl)
+ifeq ($(BUILD_VARIANT),wolfssl)
CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
-# for cyassl, edit package/libs/cyassl/Makefile to include --enable-opensslextra
+# for wolfssl, edit package/libs/wolfssl/Makefile to include --enable-opensslextra
# NOTE: it will compile without it, untested whether it it's needed?!
- CMAKE_OPTIONS += -DLWS_USE_CYASSL=ON
- CMAKE_OPTIONS += -DLWS_CYASSL_LIBRARIES=$(STAGING_DIR)/usr/lib/libcyassl.so
- CMAKE_OPTIONS += -DLWS_CYASSL_INCLUDE_DIRS=$(STAGING_DIR)/usr/include
+ CMAKE_OPTIONS += -DLWS_USE_WOLFSSL=ON
+ CMAKE_OPTIONS += -DLWS_WOLFSSL_LIBRARIES=$(STAGING_DIR)/usr/lib/libwolfssl.so
+ CMAKE_OPTIONS += -DLWS_WOLFSSL_INCLUDE_DIRS=$(STAGING_DIR)/usr/include
endif
ifeq ($(BUILD_VARIANT),full)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets.so* $(1)/usr/lib/
endef
-Package/libwebsockets-cyassl/install = $(Package/libwebsockets/install)
+Package/libwebsockets-wolfssl/install = $(Package/libwebsockets/install)
Package/libwebsockets-openssl/install = $(Package/libwebsockets/install)
Package/libwebsockets-full/install = $(Package/libwebsockets/install)
$(eval $(call BuildPackage,libwebsockets-openssl))
-$(eval $(call BuildPackage,libwebsockets-cyassl))
+$(eval $(call BuildPackage,libwebsockets-wolfssl))
$(eval $(call BuildPackage,libwebsockets-full))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@APACHE/xerces/c/3/sources
-PKG_MD5SUM:=9973cc79481803f8b6652c52faf5195d963f50d209d4f681ec97e2aa014b6241
+PKG_HASH:=9973cc79481803f8b6652c52faf5195d963f50d209d4f681ec97e2aa014b6241
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=Apache-2.0
include $(TOPDIR)/rules.mk
PKG_NAME:=libxml2
-PKG_VERSION:=2.9.4
+PKG_VERSION:=2.9.5
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://gd.tuwien.ac.at/languages/libxml/ \
http://xmlsoft.org/sources/ \
ftp://fr.rpmfind.net/pub/libxml/
-PKG_MD5SUM:=ae249165c173b1ff386ee8ad676815f5
+PKG_HASH:=4031c1ecee9ce7ba4f313e91ef6284164885cdb69937a123f6a83bb6a72dcd38
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_URL:= \
http://xmlsoft.org/sources/ \
ftp://fr.rpmfind.net/pub/libxml/
-PKG_MD5SUM:=9667bf6f9310b957254fdcf6596600b7
+PKG_HASH:=5fc7151a57b89c03d7b825df5a0fae0a8d5f05674c0e7cf2937ecec4d54a028c
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING
include $(TOPDIR)/rules.mk
PKG_NAME:=libyang
-PKG_VERSION:=0.12.174
+PKG_VERSION:=0.13.46
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_LICENSE:=GPL-2.0+
PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=d1556e0ae3872d676dfd63bd6073fe7e72d0130f
+PKG_MIRROR_HASH:=4a23a3854ceca147e113ab65ecdce3371e30b59436680e7d981b0bab6dbe751d
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/CESNET/libyang.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=7e811613b335afc8e1b2c0ee77e7b3f371bc9175
-PKG_MIRROR_HASH:=860865b294c628ad66ca5ef6848aae8df93e46325302914dbfb14264866f1678
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
+
+PKG_BUILD_ROOT:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
CATEGORY:=Libraries
TITLE:=YANG data modeling language library
URL:=$(PKG_SOURCE_URL)
- DEPENDS:=+libpcre
+ DEPENDS:=+libpcre +libpthread
endef
define Package/yanglint
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.tildeslash.com/libzdb/dist/
-PKG_MD5SUM:=01d8519a596d62f6b43559cc29ecd36d
+PKG_HASH:=0f01abb1b01d1a1f4ab9b55ad3ba445d203fc3b4757abdf53e1d85e2b7b42695
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=46a3f1a13a6ec5ff5377c028ce25bc723ab86247af40e686aa2b24718a5cd0d1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/mcabber/loudmouth.git
PKG_SOURCE_VERSION:=$(PKG_VERSION)
-PKG_MD5SUM:=7616cf124a8d72d007e7475b5aeb20ad
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://lttng.org/files/$(PKG_NAME)/
-PKG_MD5SUM:=5c7de27a9968e01ac0b08c7c9cf554d0
+PKG_HASH:=a75c3ea6cbfa3a89107a2141b27ebabf13964e628855566571f09459bbbc8cb3
PKG_LICENSE:=LGPL-2.1 GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://bitmath.org/code/mtdev/
-PKG_MD5SUM:=52c9610b6002f71d1642dc1a1cca5ec1
+PKG_HASH:=6677d5708a7948840de734d8b4675d5980d4561171c5a8e89e54adf7a13eba7f
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_URL:=https://github.com/pullmoll/musl-fts.git
PKG_SOURCE_VERSION:=0bde52df588e8969879a2cae51c3a4774ec62472
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=29c62a600128e9189b1b2e1aea568546178eedf739527f657873b3b773072ecb
PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
#
-# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=mxml
PKG_VERSION:=2.10
PKG_RELEASE:=1
-PKG_MD5SUM:=8804c961a24500a95690ef287d150abe
+PKG_HASH:=267ff58b64ddc767170d71dab0c729c06f45e1df9a9b6f75180b564f09767891
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.msweet.org/files/project3/
+PKG_SOURCE_URL:=https://github.com/michaelrsweet/mxml/releases/download/release-$(PKG_VERSION)/
PKG_FIXUP:=autoreconf
PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com>
PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://hyperelliptic.org/nacl
-PKG_MD5SUM:=7efb5715561c3d10dafd3fa97b4f2d20
+PKG_HASH:=4f277f89735c8b0b8a6bbd043b3efb3fa1cc68a9a5da6a076507d067fc3b3bf8
PKG_LICENSE:=PublicDomain
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.webdav.org/neon
-PKG_MD5SUM:=e28d77bf14032d7f5046b3930704ef41
+PKG_HASH:=db0bd8cdec329b48f53a6f00199c92d5ba40b0f015b153718d1b15d3d967fbca
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
PKG_SOURCE_URL:=http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/$(PKG_VERSION)/
-PKG_MD5SUM:=6082ee2124d4066581a7386972bfd52a
+PKG_HASH:=1f6990249fdb82804fff40e96fa6d99949023ab0e3277eae4bd459b374e622a4
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/ \
ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/ \
ftp://ftp.plig.org/pub/OpenLDAP/openldap-release/
-PKG_MD5SUM:=00ff8301277cdfd0af728a6927042a13
+PKG_HASH:=cdd6cffdebcd95161a73305ec13fc7a78e9707b46ca9f84fb897cd5626df3824
PKG_FIXUP:=autoreconf
PKG_MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=96f073270c489c9a594e1c9413f42db8
+PKG_HASH:=e57371669f3b157141b86c429bd9c29741994b2f5ff115fcb8a03e751b0f6ac4
PKG_SOURCE_URL:=http://p11-glue.freedesktop.org/releases/
PKG_INSTALL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=pcre
-PKG_VERSION:=8.40
+PKG_VERSION:=8.41
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
-PKG_MD5SUM:=41a842bf7dcecd6634219336e2167d1d
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
+PKG_HASH:=e62c7eac5ae7c0e7286db61ff82912e1c0b7a0c13706616e94a7dd729321b530
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
PKG_LICENSE:=BSD-3-Clause
--enable-utf8 \
--enable-unicode-properties \
--enable-pcre16 \
+ --with-match-limit-recursion=16000 \
ifneq ($(CONFIG_PACKAGE_libpcrecpp),)
CONFIGURE_ARGS+= --enable-cpp
+++ /dev/null
-#CVE-2017-7186 patch
---- trunk/pcre_internal.h 2016/05/21 13:34:44 1649
-+++ trunk/pcre_internal.h 2017/02/24 17:30:30 1688
-@@ -2772,6 +2772,9 @@
- extern const pcre_uint16 PRIV(ucd_stage2)[];
- extern const pcre_uint32 PRIV(ucp_gentype)[];
- extern const pcre_uint32 PRIV(ucp_gbtable)[];
-+#ifdef COMPILE_PCRE32
-+extern const ucd_record PRIV(dummy_ucd_record)[];
-+#endif
- #ifdef SUPPORT_JIT
- extern const int PRIV(ucp_typerange)[];
- #endif
-@@ -2780,9 +2783,15 @@
- /* UCD access macros */
-
- #define UCD_BLOCK_SIZE 128
--#define GET_UCD(ch) (PRIV(ucd_records) + \
-+#define REAL_GET_UCD(ch) (PRIV(ucd_records) + \
- PRIV(ucd_stage2)[PRIV(ucd_stage1)[(int)(ch) / UCD_BLOCK_SIZE] * \
- UCD_BLOCK_SIZE + (int)(ch) % UCD_BLOCK_SIZE])
-+
-+#ifdef COMPILE_PCRE32
-+#define GET_UCD(ch) ((ch > 0x10ffff)? PRIV(dummy_ucd_record) : REAL_GET_UCD(ch))
-+#else
-+#define GET_UCD(ch) REAL_GET_UCD(ch)
-+#endif
-
- #define UCD_CHARTYPE(ch) GET_UCD(ch)->chartype
- #define UCD_SCRIPT(ch) GET_UCD(ch)->script
---- trunk/pcre_ucd.c 2014/06/19 07:51:39 1490
-+++ trunk/pcre_ucd.c 2017/02/24 17:30:30 1688
-@@ -38,6 +38,20 @@
- const pcre_uint32 PRIV(ucd_caseless_sets)[] = {0};
- #else
-
-+/* If the 32-bit library is run in non-32-bit mode, character values
-+greater than 0x10ffff may be encountered. For these we set up a
-+special record. */
-+
-+#ifdef COMPILE_PCRE32
-+const ucd_record PRIV(dummy_ucd_record)[] = {{
-+ ucp_Common, /* script */
-+ ucp_Cn, /* type unassigned */
-+ ucp_gbOther, /* grapheme break property */
-+ 0, /* case set */
-+ 0, /* other case */
-+ }};
-+#endif
-+
- /* When recompiling tables with a new Unicode version, please check the
- types in this structure definition from pcre_internal.h (the actual
- field names will be different):
include $(TOPDIR)/rules.mk
PKG_NAME:=pcre2
-PKG_VERSION:=10.23
+PKG_VERSION:=10.30
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
-PKG_MD5SUM:=b2cd00ca7e24049040099b0a46bb3649
-PKG_HASH:=dfc79b918771f02d33968bd34a749ad7487fa1014aeb787fad29dd392b78c56e
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
+PKG_HASH:=90bd41c605d30e3745771eb81928d779f158081a51b2f314bbcc1f73de5773db
PKG_MAINTAINER:=Shane Peelar <lookatyouhacker@gmail.com>
PKG_LICENSE:=BSD-3-Clause
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://pocoproject.org/releases/$(PKG_NAME)-$(PKG_VERSION)
-PKG_MD5SUM:=17783e30f5ef9c852544ac0e9d1fd316c4804317026059a9d6aad798b61c77f8
+PKG_HASH:=17783e30f5ef9c852544ac0e9d1fd316c4804317026059a9d6aad798b61c77f8
PKG_LICENSE:=BSL-1.0
PKG_LICENSE_FILES:=LICENSE
include $(TOPDIR)/rules.mk
PKG_NAME:=postgresql
-PKG_VERSION:=9.6.3
-PKG_RELEASE:=3
+PKG_VERSION:=9.6.4
+PKG_RELEASE:=1
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=PostgreSQL
http://ftp.postgresql.org/pub/source/v$(PKG_VERSION) \
ftp://ftp.postgresql.org/pub/source/v$(PKG_VERSION)
-PKG_HASH:=1645b3736901f6d854e695a937389e68ff2066ce0cde9d73919d6ab7c995b9c6
+PKG_HASH:=2b3ab16d82e21cead54c08b95ce3ac480696944a68603b6c11b3205b7376ce13
PKG_USE_MIPS16:=0
PKG_FIXUP:=autoreconf
$(CP) $(PKG_INSTALL_DIR)/usr/include/postgresql $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpq.{a,so*} $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpq.pc $(1)/usr/lib/pkgconfig/
endef
$(eval $(call HostBuild))
PKG_RELEASE:=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MIRROR_HASH:=2ebe48454fe454d118cf952655a24477c4bed892cee7ae085dc56d05ac711a8a
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=git://github.com/protobuf-c/protobuf-c.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_NAME)-cpp-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/google/protobuf/releases/download/v$(PKG_VERSION)
-PKG_MD5SUM:=2d45f7ad84eb2b1883ae2096b3b1f18a
+PKG_HASH:=578a2589bf9258adb03245dec5d624b61536867ebb732dbb8aeb30d96b0ada1f
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_LICENSE_FILES:=license.txt
PKG_INSTALL:=1
+PKG_BUILD_DEPENDS:=unixodbc/host
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.auto.tuwien.ac.at/~mkoegler/pth/
-PKG_MD5SUM:=9144b26dcc27e67498d63dd5456f934c
+PKG_HASH:=4024cafdd5d4bce2b1778a6be5491222c3f6e7ef1e43971264c451c0012c5c01
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://fukuchi.org/works/qrencode/
-PKG_MD5SUM:=be545f3ce36ea8fbb58612d72c4222de
+PKG_HASH:=e794e26a96019013c0e3665cb06b18992668f352c5553d0a553f5d144f7f2a72
PKG_MAINTAINER:=Jonathan Bennett <JBennett@incomsystems.biz>
PKG_LICENSE:=LGPL-2.1+
PKG_INSTALL:=1
PKG_SOURCE_URL:=https://github.com/phhusson/QuasselC
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_MIRROR_HASH:=80ca463c20f934a3730fb51c69f5299e2d35ca53a06f0ca746d3de97dbfc360b
PKG_MAINTAINER:=Ben Rosser <rosser.bjr@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
PKG_SOURCE_URL:=http://rxtx.qbang.org/pub/rxtx/
-PKG_MD5SUM:=7eedb18e3f33a427e2b0e9be8ce3f94c
+PKG_HASH:=3c30373e760f444def3650c76c5a00ae12fb1d860ec008750d084f4880495b03
PKG_FIXUP:=patch-libtool
PKG_CHECK_FORMAT_SECURITY:=0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.kernel.org/pub/linux/bluetooth/
-PKG_MD5SUM:=2d8b7841f2c11ab287718d562f2b981c
+PKG_HASH:=e61022cf576f14190241e7071753fdacdce5d1dea89ffd704110fc50be689309
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=COPYING.LIB
#
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=speex
-PKG_VERSION:=1.2rc1
+PKG_VERSION:=1.2.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/speex/
-PKG_MD5SUM:=c4438b22c08e5811ff10e2b06ee9b9ae
+PKG_HASH:=eaae8af0ac742dc7d542c9439ac72f1f385ce838392dc849cae4536af9210094
PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
MAINTAINER:=Peter Wagner <tripolar@gmx.at>
endef
-define Package/libspeexdsp
- SECTION:=libs
- CATEGORY:=Libraries
- TITLE:=Open source speech compression codec library output to DSP
- URL:=http://www.speex.org/
- MAINTAINER:=Peter Wagner <tripolar@gmx.at>
-endef
-
define Package/libspeex/description
Open source patent-free speech compression codec library.
Speex is an Open Source/Free Software patent-free audio compression
This package contains the shared codec library, needed by other programs.
endef
-TARGET_CFLAGS += $(FPIC)
-
-define Package/libspeexdsp/description
- Open source patent-free speech compression codec library.
- Speex is an Open Source/Free Software patent-free audio compression
- format designed for speech. The Speex Project aims to lower the
- barrier of entry for voice applications by providing a free
- alternative to expensive proprietary speech codecs. Moreover, Speex
- is well-adapted to Internet applications and provides useful features
- that are not present in most other codecs.
-
- This package contains the shared dsp library, needed by other programs.
-endef
-
-define Build/Configure
- $(call Build/Configure/Default, \
- --enable-shared \
- --enable-static \
- --enable-fixed-point \
- --disable-oggtest \
- --disable-float-api \
- --disable-vbr \
- --with-ogg=$(STAGING_DIR)/usr \
- )
-endef
-
-define Build/Compile
- $(MAKE) -C $(PKG_BUILD_DIR) \
- DESTDIR="$(PKG_INSTALL_DIR)" \
- bin_PROGRAMS="" \
- all install
-endef
-
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/speex $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeex.{a,so*} $(1)/usr/lib/
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeexdsp.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/speex.pc $(1)/usr/lib/pkgconfig/
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/speexdsp.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libspeex/install
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeex.so.* $(1)/usr/lib/
endef
-define Package/libspeexdsp/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeexdsp.so.* $(1)/usr/lib/
-endef
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+ --enable-shared \
+ --enable-static \
+ --disable-binaries \
+ $(if $(CONFIG_SOFT_FLOAT),--enable-fixed-point --disable-float-api --disable-vbr)
$(eval $(call BuildPackage,libspeex))
-$(eval $(call BuildPackage,libspeexdsp))
--- /dev/null
+#
+# Copyright (C) 2006-2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=speexdsp
+PKG_VERSION:=1.2rc3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://downloads.us.xiph.org/releases/speex/
+PKG_HASH:=4ae688600039f5d224bdf2e222d2fbde65608447e4c2f681585e4dca6df692f1
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libspeexdsp
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=Open source speech compression codec library output to DSP
+ URL:=http://www.speex.org/
+ MAINTAINER:=Peter Wagner <tripolar@gmx.at>
+endef
+
+define Package/libspeexdsp/description
+ Open source patent-free speech compression codec library.
+ Speex is an Open Source/Free Software patent-free audio compression
+ format designed for speech. The Speex Project aims to lower the
+ barrier of entry for voice applications by providing a free
+ alternative to expensive proprietary speech codecs. Moreover, Speex
+ is well-adapted to Internet applications and provides useful features
+ that are not present in most other codecs.
+
+ This package contains the shared dsp library, needed by other programs.
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/speex $(1)/usr/include/
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeexdsp.{a,so*} $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/speexdsp.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libspeexdsp/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspeexdsp.so.* $(1)/usr/lib/
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+ --enable-shared \
+ --enable-static \
+ --disable-examples \
+ $(if $(CONFIG_aarch64),--disable-neon) \
+ $(if $(CONFIG_SOFT_FLOAT),--enable-fixed-point --disable-float-api)
+
+$(eval $(call BuildPackage,libspeexdsp))
include $(TOPDIR)/rules.mk
PKG_NAME:=sqlite
-PKG_VERSION:=3190300
+PKG_VERSION:=3200100
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
-PKG_HASH:=06129c03dced9f87733a8cba408871bd60673b8f93b920ba8d815efab0a06301
+PKG_HASH:=ec66595b29bc0798b023a5122021ea646ab4fa9e2f735937c5426feeba950742
PKG_SOURCE_URL:=http://www.sqlite.org/2017/
PKG_LICENSE:=PUBLICDOMAIN
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://ftp.porcupine.org/pub/security
-PKG_MD5SUM:=e6fa25f71226d090f34de3f6b122fb5a
+PKG_HASH:=9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d
PKG_LICENSE:=BSD
PKG_LICENE_FILES:=DISCLAIMER
include $(TOPDIR)/rules.mk
PKG_NAME:=tdb
-PKG_VERSION:=1.0.6
+PKG_VERSION:=1.3.15
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/tdb
-PKG_MD5SUM:=6b643fdeb48304010dcd5f675e458b58
+PKG_SOURCE_URL:=https://www.samba.org/ftp/tdb/
+PKG_HASH:=b4a1bf3833601bd9f10aff363cb750860aef9ce5b4617989239923192f946728
PKG_INSTALL:=1
-PKG_BUILD_DEPENDS:=+libgdbm
include $(INCLUDE_DIR)/package.mk
+# for $(LINUX_VERSION)
+include $(INCLUDE_DIR)/kernel.mk
+# for $(VERSION_DIST)
+include $(INCLUDE_DIR)/version.mk
+#include $(INCLUDE_DIR)/version.mk
define Package/tdb
SUBMENU:=database
TITLE:=Trivial Database
URL:=http://sourceforge.net/projects/tdb/
MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
-# DEPENDS:=+libgdbm
endef
define Package/tdb/description
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
endef
+CONFIGURE_ARGS = \
+ --target=$(GNU_TARGET_NAME) \
+ --build=$(GNU_HOST_NAME) \
+ --cross-compile \
+ --cross-answers="$(PKG_BUILD_DIR)/cache.txt" \
+ --program-prefix="" \
+ --prefix=$(CONFIGURE_PREFIX) \
+ --exec-prefix=$(CONFIGURE_PREFIX) \
+ --bindir=$(CONFIGURE_PREFIX)/bin \
+ --sbindir=$(CONFIGURE_PREFIX)/sbin \
+ --libexecdir=$(CONFIGURE_PREFIX)/lib \
+ --sysconfdir=/etc \
+ --datadir=$(CONFIGURE_PREFIX)/share \
+ --localstatedir=/var \
+ --mandir=$(CONFIGURE_PREFIX)/man \
+ --infodir=$(CONFIGURE_PREFIX)/info \
+ $(DISABLE_IPV6)
+
+CONFIGURE_ARGS += \
+ --disable-python \
+ --disable-rpath \
+ --disable-rpath-install \
+ --disable-rpath-private-install
+
+define Build/Configure
+ $(CP) ./files/tdb.cache.txt $(PKG_BUILD_DIR)/cache.txt
+ echo -e "\nChecking uname sysname type: \"$(VERSION_DIST)\" \
+ \nChecking uname release type: \"$(LINUX_VERSION)-$(GNU_TARGET_NAME)\" \
+ \nChecking uname machine type: \"$(ARCH)\" \
+ \nChecking uname version type: \"$(VERSION_DIST) Linux-$(LINUX_VERSION) $(shell date +%Y-%m-%d)\"\n" >> $(PKG_BUILD_DIR)/cache.txt;
+ $(call Build/Configure/Default)
+endef
+
define Package/tdb/install
$(INSTALL_DIR) $(1)/usr/lib
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
endef
--- /dev/null
+Checking simple C program: OK
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking for large file support without additional flags: OK
+Checking for -D_LARGE_FILES: OK
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: OK
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_INCOHERENT_MMAP: NO
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking if can we convert from CP850 to UCS-2LE: OK
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+Checking whether we can use Linux thread-specific credentials with 32-bit system calls: OK
+Checking whether we can use Linux thread-specific credentials: OK
+Checking whether setreuid is available: OK
+Checking whether setresuid is available: OK
+Checking whether seteuid is available: OK
+Checking whether fcntl locking is available: OK
+Checking whether fcntl lock supports open file description locks: OK
+Checking for the maximum value of the 'time_t' type: OK
+Checking whether the realpath function allows a NULL argument: OK
+Checking whether POSIX capabilities are available: OK
+Checking for ftruncate extend: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+getcwd takes a NULL argument: OK
+Checking value of NSIG: "65"
+Checking value of _NSIG: "65"
+Checking value of SIGRTMAX: "64"
+Checking value of SIGRTMIN: "34"
+++ /dev/null
---- a/tdbtool.c 2001-12-11 06:45:47.000000000 +0300
-+++ b/tdbtool.c 2014-11-14 15:14:00.401164300 +0300
-@@ -169,23 +169,21 @@ static void print_data(unsigned char *bu
-
- static void help(void)
- {
-- printf("
--tdbtool:
-- create dbname : create a database
-- open dbname : open an existing database
-- erase : erase the database
-- dump dumpname : dump the database as strings
-- insert key data : insert a record
-- store key data : store a record (replace)
-- show key : show a record by key
-- delete key : delete a record by key
-- list : print the database hash table and freelist
-- free : print the database freelist
-- 1 | first : print the first record
-- n | next : print the next record
-- q | quit : terminate
-- \\n : repeat 'next' command
--");
-+ printf("tdbtool:\n");
-+ printf(" create dbname : create a database\n");
-+ printf(" open dbname : open an existing database\n");
-+ printf(" erase : erase the database\n");
-+ printf(" dump dumpname : dump the database as strings\n");
-+ printf(" insert key data : insert a record\n");
-+ printf(" store key data : store a record (replace)\n");
-+ printf(" show key : show a record by key\n");
-+ printf(" delete key : delete a record by key\n");
-+ printf(" list : print the database hash table and freelist\n");
-+ printf(" free : print the database freelist\n");
-+ printf(" 1 | first : print the first record\n");
-+ printf(" n | next : print the next record\n");
-+ printf(" q | quit : terminate\n");
-+ printf(" \\n : repeat 'next' command\n\n");
- }
-
- static void terror(char *why)
include $(TOPDIR)/rules.mk
PKG_NAME:=tiff
-PKG_VERSION:=4.0.7
+PKG_VERSION:=4.0.8
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://download.osgeo.org/libtiff
-PKG_HASH:=9f43a2cfb9589e5cecaa66e16bf87f814c945f22df7ba600d63aac4632c4f019
+PKG_HASH:=59d7a5a8ccd92059913f246877db95a2918e6c04fb9d43fd74e5c3390dac2910
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=autogen.sh aclocal.m4
--- /dev/null
+diff -pur tiff-4.0.4/tools/tiffsplit.c tiff-4.0.4_patch/tools/tiffsplit.c
+--- tiff-4.0.4/tools/tiffsplit.c 2015-05-28 15:10:26.000000000 +0200
++++ tiff-4.0.4_patch/tools/tiffsplit.c 2016-02-12 19:15:30.532005041 +0100
+@@ -179,8 +179,9 @@ tiffcp(TIFF* in, TIFF* out)
+ TIFFSetField(out, TIFFTAG_JPEGTABLES, count, table);
+ }
+ }
++ uint32 count = 0;
+ CopyField(TIFFTAG_PHOTOMETRIC, shortv);
+- CopyField(TIFFTAG_PREDICTOR, shortv);
++ CopyField2(TIFFTAG_PREDICTOR, count, shortv);
+ CopyField(TIFFTAG_THRESHHOLDING, shortv);
+ CopyField(TIFFTAG_FILLORDER, shortv);
+ CopyField(TIFFTAG_ORIENTATION, shortv);
+@@ -188,7 +189,7 @@ tiffcp(TIFF* in, TIFF* out)
+ CopyField(TIFFTAG_MAXSAMPLEVALUE, shortv);
+ CopyField(TIFFTAG_XRESOLUTION, floatv);
+ CopyField(TIFFTAG_YRESOLUTION, floatv);
+- CopyField(TIFFTAG_GROUP3OPTIONS, longv);
++ CopyField2(TIFFTAG_GROUP3OPTIONS, count, longv);
+ CopyField(TIFFTAG_GROUP4OPTIONS, longv);
+ CopyField(TIFFTAG_RESOLUTIONUNIT, shortv);
+ CopyField(TIFFTAG_PLANARCONFIG, shortv);
--- /dev/null
+From 02669064e927074819ce1ed39aba0fccaa167717 Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Mon, 29 May 2017 10:12:54 +0000
+Subject: [PATCH] * libtiff/tif_color.c: TIFFYCbCrToRGBInit(): stricter
+ clamping to avoid int32 overflow in TIFFYCbCrtoRGB(). Fixes
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1844 Credit to OSS Fuzz
+
+---
+ ChangeLog | 7 +++++++
+ libtiff/tif_color.c | 6 +++---
+ 2 files changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index ee8d9d08..61116596 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,10 @@
++2017-05-29 Even Rouault <even.rouault at spatialys.com>
++
++ * libtiff/tif_color.c: TIFFYCbCrToRGBInit(): stricter clamping to avoid
++ int32 overflow in TIFFYCbCrtoRGB().
++ Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1844
++ Credit to OSS Fuzz
++
+ 2017-05-21 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ * configure.ac: libtiff 4.0.8 released.
+diff --git a/libtiff/tif_color.c b/libtiff/tif_color.c
+index 055ed3b2..10a5e66e 100644
+--- a/libtiff/tif_color.c
++++ b/libtiff/tif_color.c
+@@ -275,10 +275,10 @@ TIFFYCbCrToRGBInit(TIFFYCbCrToRGB* ycbcr, float *luma, float *refBlackWhite)
+ for (i = 0, x = -128; i < 256; i++, x++) {
+ int32 Cr = (int32)CLAMPw(Code2V(x, refBlackWhite[4] - 128.0F,
+ refBlackWhite[5] - 128.0F, 127),
+- -128.0F * 64, 128.0F * 64);
++ -128.0F * 32, 128.0F * 32);
+ int32 Cb = (int32)CLAMPw(Code2V(x, refBlackWhite[2] - 128.0F,
+ refBlackWhite[3] - 128.0F, 127),
+- -128.0F * 64, 128.0F * 64);
++ -128.0F * 32, 128.0F * 32);
+
+ ycbcr->Cr_r_tab[i] = (int32)((D1*Cr + ONE_HALF)>>SHIFT);
+ ycbcr->Cb_b_tab[i] = (int32)((D3*Cb + ONE_HALF)>>SHIFT);
+@@ -286,7 +286,7 @@ TIFFYCbCrToRGBInit(TIFFYCbCrToRGB* ycbcr, float *luma, float *refBlackWhite)
+ ycbcr->Cb_g_tab[i] = D4*Cb + ONE_HALF;
+ ycbcr->Y_tab[i] =
+ (int32)CLAMPw(Code2V(x + 128, refBlackWhite[0], refBlackWhite[1], 255),
+- -128.0F * 64, 128.0F * 64);
++ -128.0F * 32, 128.0F * 32);
+ }
+ }
+
--- /dev/null
+From 468988860e0dae62ebbf991627c74bcbb4bd256f Mon Sep 17 00:00:00 2001
+From: erouault <erouault>
+Date: Mon, 29 May 2017 11:29:06 +0000
+Subject: [PATCH] * libtiff/tif_getimage.c: initYCbCrConversion(): stricter
+ validation for refBlackWhite coefficients values. To avoid invalid
+ float->int32 conversion (when refBlackWhite[0] == 2147483648.f) Fixes
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1907 Credit to OSS Fuzz
+
+---
+ ChangeLog | 8 ++++++++
+ libtiff/tif_getimage.c | 2 +-
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index a2ddaac2..04881ba7 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,5 +1,13 @@
+ 2017-05-29 Even Rouault <even.rouault at spatialys.com>
+
++ * libtiff/tif_getimage.c: initYCbCrConversion(): stricter validation for
++ refBlackWhite coefficients values. To avoid invalid float->int32 conversion
++ (when refBlackWhite[0] == 2147483648.f)
++ Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1907
++ Credit to OSS Fuzz
++
++2017-05-29 Even Rouault <even.rouault at spatialys.com>
++
+ * libtiff/tif_color.c: TIFFYCbCrToRGBInit(): stricter clamping to avoid
+ int32 overflow in TIFFYCbCrtoRGB().
+ Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1844
+diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c
+index dc373abc..a209a7a7 100644
+--- a/libtiff/tif_getimage.c
++++ b/libtiff/tif_getimage.c
+@@ -2241,7 +2241,7 @@ DECLARESepPutFunc(putseparate8bitYCbCr11tile)
+
+ static int isInRefBlackWhiteRange(float f)
+ {
+- return f >= (float)(-0x7FFFFFFF + 128) && f <= (float)0x7FFFFFFF;
++ return f > (float)(-0x7FFFFFFF + 128) && f < (float)0x7FFFFFFF;
+ }
+
+ static int
--- /dev/null
+commit 40448d58fbfad52d2dde5bd18daa30b17fe35fcd
+Author: erouault <erouault>
+Date: Thu Jun 1 12:44:04 2017 +0000
+
+ * libtiff/tif_dirinfo.c, tif_dirread.c: add _TIFFCheckFieldIsValidForCodec(),
+ and use it in TIFFReadDirectory() so as to ignore fields whose tag is a
+ codec-specified tag but this codec is not enabled. This avoids TIFFGetField()
+ to behave differently depending on whether the codec is enabled or not, and
+ thus can avoid stack based buffer overflows in a number of TIFF utilities
+ such as tiffsplit, tiffcmp, thumbnail, etc.
+ Patch derived from 0063-Handle-properly-CODEC-specific-tags.patch
+ (http://bugzilla.maptools.org/show_bug.cgi?id=2580) by Raphaël Hertzog.
+ Fixes:
+ http://bugzilla.maptools.org/show_bug.cgi?id=2580
+ http://bugzilla.maptools.org/show_bug.cgi?id=2693
+ http://bugzilla.maptools.org/show_bug.cgi?id=2625 (CVE-2016-10095)
+ http://bugzilla.maptools.org/show_bug.cgi?id=2564 (CVE-2015-7554)
+ http://bugzilla.maptools.org/show_bug.cgi?id=2561 (CVE-2016-5318)
+ http://bugzilla.maptools.org/show_bug.cgi?id=2499 (CVE-2014-8128)
+ http://bugzilla.maptools.org/show_bug.cgi?id=2441
+ http://bugzilla.maptools.org/show_bug.cgi?id=2433
+
+diff --git a/ChangeLog b/ChangeLog
+index 04881ba7..ebd1a3c0 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,23 @@
++2017-06-01 Even Rouault <even.rouault at spatialys.com>
++
++ * libtiff/tif_dirinfo.c, tif_dirread.c: add _TIFFCheckFieldIsValidForCodec(),
++ and use it in TIFFReadDirectory() so as to ignore fields whose tag is a
++ codec-specified tag but this codec is not enabled. This avoids TIFFGetField()
++ to behave differently depending on whether the codec is enabled or not, and
++ thus can avoid stack based buffer overflows in a number of TIFF utilities
++ such as tiffsplit, tiffcmp, thumbnail, etc.
++ Patch derived from 0063-Handle-properly-CODEC-specific-tags.patch
++ (http://bugzilla.maptools.org/show_bug.cgi?id=2580) by Raphaël Hertzog.
++ Fixes:
++ http://bugzilla.maptools.org/show_bug.cgi?id=2580
++ http://bugzilla.maptools.org/show_bug.cgi?id=2693
++ http://bugzilla.maptools.org/show_bug.cgi?id=2625 (CVE-2016-10095)
++ http://bugzilla.maptools.org/show_bug.cgi?id=2564 (CVE-2015-7554)
++ http://bugzilla.maptools.org/show_bug.cgi?id=2561 (CVE-2016-5318)
++ http://bugzilla.maptools.org/show_bug.cgi?id=2499 (CVE-2014-8128)
++ http://bugzilla.maptools.org/show_bug.cgi?id=2441
++ http://bugzilla.maptools.org/show_bug.cgi?id=2433
++
+ 2017-05-29 Even Rouault <even.rouault at spatialys.com>
+
+ * libtiff/tif_getimage.c: initYCbCrConversion(): stricter validation for
+diff --git a/libtiff/tif_dir.h b/libtiff/tif_dir.h
+index 6af5f3dc..5a380767 100644
+--- a/libtiff/tif_dir.h
++++ b/libtiff/tif_dir.h
+@@ -1,4 +1,4 @@
+-/* $Id: tif_dir.h,v 1.54 2011-02-18 20:53:05 fwarmerdam Exp $ */
++/* $Id: tif_dir.h,v 1.55 2017-06-01 12:44:04 erouault Exp $ */
+
+ /*
+ * Copyright (c) 1988-1997 Sam Leffler
+@@ -291,6 +291,7 @@ struct _TIFFField {
+ extern int _TIFFMergeFields(TIFF*, const TIFFField[], uint32);
+ extern const TIFFField* _TIFFFindOrRegisterField(TIFF *, uint32, TIFFDataType);
+ extern TIFFField* _TIFFCreateAnonField(TIFF *, uint32, TIFFDataType);
++extern int _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag);
+
+ #if defined(__cplusplus)
+ }
+diff --git a/libtiff/tif_dirinfo.c b/libtiff/tif_dirinfo.c
+index 23ad0020..4904f540 100644
+--- a/libtiff/tif_dirinfo.c
++++ b/libtiff/tif_dirinfo.c
+@@ -1,4 +1,4 @@
+-/* $Id: tif_dirinfo.c,v 1.126 2016-11-18 02:52:13 bfriesen Exp $ */
++/* $Id: tif_dirinfo.c,v 1.127 2017-06-01 12:44:04 erouault Exp $ */
+
+ /*
+ * Copyright (c) 1988-1997 Sam Leffler
+@@ -956,6 +956,109 @@ TIFFMergeFieldInfo(TIFF* tif, const TIFFFieldInfo info[], uint32 n)
+ return 0;
+ }
+
++int
++_TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
++{
++ /* Filter out non-codec specific tags */
++ switch (tag) {
++ /* Shared tags */
++ case TIFFTAG_PREDICTOR:
++ /* JPEG tags */
++ case TIFFTAG_JPEGTABLES:
++ /* OJPEG tags */
++ case TIFFTAG_JPEGIFOFFSET:
++ case TIFFTAG_JPEGIFBYTECOUNT:
++ case TIFFTAG_JPEGQTABLES:
++ case TIFFTAG_JPEGDCTABLES:
++ case TIFFTAG_JPEGACTABLES:
++ case TIFFTAG_JPEGPROC:
++ case TIFFTAG_JPEGRESTARTINTERVAL:
++ /* CCITT* */
++ case TIFFTAG_BADFAXLINES:
++ case TIFFTAG_CLEANFAXDATA:
++ case TIFFTAG_CONSECUTIVEBADFAXLINES:
++ case TIFFTAG_GROUP3OPTIONS:
++ case TIFFTAG_GROUP4OPTIONS:
++ break;
++ default:
++ return 1;
++ }
++ /* Check if codec specific tags are allowed for the current
++ * compression scheme (codec) */
++ switch (tif->tif_dir.td_compression) {
++ case COMPRESSION_LZW:
++ if (tag == TIFFTAG_PREDICTOR)
++ return 1;
++ break;
++ case COMPRESSION_PACKBITS:
++ /* No codec-specific tags */
++ break;
++ case COMPRESSION_THUNDERSCAN:
++ /* No codec-specific tags */
++ break;
++ case COMPRESSION_NEXT:
++ /* No codec-specific tags */
++ break;
++ case COMPRESSION_JPEG:
++ if (tag == TIFFTAG_JPEGTABLES)
++ return 1;
++ break;
++ case COMPRESSION_OJPEG:
++ switch (tag) {
++ case TIFFTAG_JPEGIFOFFSET:
++ case TIFFTAG_JPEGIFBYTECOUNT:
++ case TIFFTAG_JPEGQTABLES:
++ case TIFFTAG_JPEGDCTABLES:
++ case TIFFTAG_JPEGACTABLES:
++ case TIFFTAG_JPEGPROC:
++ case TIFFTAG_JPEGRESTARTINTERVAL:
++ return 1;
++ }
++ break;
++ case COMPRESSION_CCITTRLE:
++ case COMPRESSION_CCITTRLEW:
++ case COMPRESSION_CCITTFAX3:
++ case COMPRESSION_CCITTFAX4:
++ switch (tag) {
++ case TIFFTAG_BADFAXLINES:
++ case TIFFTAG_CLEANFAXDATA:
++ case TIFFTAG_CONSECUTIVEBADFAXLINES:
++ return 1;
++ case TIFFTAG_GROUP3OPTIONS:
++ if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX3)
++ return 1;
++ break;
++ case TIFFTAG_GROUP4OPTIONS:
++ if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX4)
++ return 1;
++ break;
++ }
++ break;
++ case COMPRESSION_JBIG:
++ /* No codec-specific tags */
++ break;
++ case COMPRESSION_DEFLATE:
++ case COMPRESSION_ADOBE_DEFLATE:
++ if (tag == TIFFTAG_PREDICTOR)
++ return 1;
++ break;
++ case COMPRESSION_PIXARLOG:
++ if (tag == TIFFTAG_PREDICTOR)
++ return 1;
++ break;
++ case COMPRESSION_SGILOG:
++ case COMPRESSION_SGILOG24:
++ /* No codec-specific tags */
++ break;
++ case COMPRESSION_LZMA:
++ if (tag == TIFFTAG_PREDICTOR)
++ return 1;
++ break;
++
++ }
++ return 0;
++}
++
+ /* vim: set ts=8 sts=8 sw=8 noet: */
+
+ /*
+diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
+index 772ebaf7..acde78b5 100644
+--- a/libtiff/tif_dirread.c
++++ b/libtiff/tif_dirread.c
+@@ -1,4 +1,4 @@
+-/* $Id: tif_dirread.c,v 1.208 2017-04-27 15:46:22 erouault Exp $ */
++/* $Id: tif_dirread.c,v 1.209 2017-06-01 12:44:04 erouault Exp $ */
+
+ /*
+ * Copyright (c) 1988-1997 Sam Leffler
+@@ -3580,6 +3580,10 @@ TIFFReadDirectory(TIFF* tif)
+ goto bad;
+ dp->tdir_tag=IGNORE;
+ break;
++ default:
++ if( !_TIFFCheckFieldIsValidForCodec(tif, dp->tdir_tag) )
++ dp->tdir_tag=IGNORE;
++ break;
+ }
+ }
+ }
--- /dev/null
+From fe8d7165956b88df4837034a9161dc5fd20cf67a Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Mon, 26 Jun 2017 15:19:59 +0000
+Subject: [PATCH] * libtiff/tif_jbig.c: fix memory leak in error code path of
+ JBIGDecode() Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2706 Reported
+ by team OWL337
+
+* libtiff/tif_jpeg.c: error out at decoding time if anticipated libjpeg
+---
+ ChangeLog | 8 +++++++-
+ libtiff/tif_jbig.c | 1 +
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index bc5096e7..ecd70534 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,9 @@
++2017-06-26 Even Rouault <even.rouault at spatialys.com>
++
++ * libtiff/tif_jbig.c: fix memory leak in error code path of JBIGDecode()
++ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2706
++ Reported by team OWL337
++
+ 2017-06-01 Even Rouault <even.rouault at spatialys.com>
+
+ * libtiff/tif_dirinfo.c, tif_dirread.c: add _TIFFCheckFieldIsValidForCodec(),
+diff --git a/libtiff/tif_jbig.c b/libtiff/tif_jbig.c
+index 5f5f75e2..c75f31d9 100644
+--- a/libtiff/tif_jbig.c
++++ b/libtiff/tif_jbig.c
+@@ -94,6 +94,7 @@ static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
+ jbg_strerror(decodeStatus)
+ #endif
+ );
++ jbg_dec_free(&decoder);
+ return 0;
+ }
+
--- /dev/null
+From 1077fad562e03d1cad591dd10163dd80ad63ab0e Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Fri, 30 Jun 2017 13:11:18 +0000
+Subject: [PATCH] * libtiff/tif_read.c, tiffiop.h: add a
+ _TIFFReadEncodedStripAndAllocBuffer() function, variant of
+ TIFFReadEncodedStrip() that allocates the decoded buffer only after a first
+ successful TIFFFillStrip(). This avoids excessive memory allocation on
+ corrupted files. * libtiff/tif_getimage.c: use
+ _TIFFReadEncodedStripAndAllocBuffer(). Fixes
+ http://bugzilla.maptools.org/show_bug.cgi?id=2708 and
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2433 . Credit to OSS
+ Fuzz
+
+---
+ ChangeLog | 11 +++++++
+ libtiff/tif_getimage.c | 59 ++++++++++++++++++++++----------------
+ libtiff/tif_read.c | 78 +++++++++++++++++++++++++++++++++++++++++++-------
+ libtiff/tiffiop.h | 5 ++++
+ 4 files changed, 118 insertions(+), 35 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index c969f9e2..6f085e09 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,14 @@
++2017-06-30 Even Rouault <even.rouault at spatialys.com>
++
++ * libtiff/tif_read.c, tiffiop.h: add a _TIFFReadEncodedStripAndAllocBuffer()
++ function, variant of TIFFReadEncodedStrip() that allocates the
++ decoded buffer only after a first successful TIFFFillStrip(). This avoids
++ excessive memory allocation on corrupted files.
++ * libtiff/tif_getimage.c: use _TIFFReadEncodedStripAndAllocBuffer().
++ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2708 and
++ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2433 .
++ Credit to OSS Fuzz
++
+ 2017-06-26 Even Rouault <even.rouault at spatialys.com>
+
+ * libtiff/tif_jbig.c: fix memory leak in error code path of JBIGDecode()
+diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c
+index cee8e930..cc6e8f30 100644
+--- a/libtiff/tif_getimage.c
++++ b/libtiff/tif_getimage.c
+@@ -905,26 +905,22 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+ tileContigRoutine put = img->put.contig;
+ uint32 row, y, nrow, nrowsub, rowstoread;
+ tmsize_t pos;
+- unsigned char* buf;
++ unsigned char* buf = NULL;
+ uint32 rowsperstrip;
+ uint16 subsamplinghor,subsamplingver;
+ uint32 imagewidth = img->width;
+ tmsize_t scanline;
+ int32 fromskew, toskew;
+ int ret = 1, flip;
++ tmsize_t maxstripsize;
+
+ TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING, &subsamplinghor, &subsamplingver);
+ if( subsamplingver == 0 ) {
+ TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Invalid vertical YCbCr subsampling");
+ return (0);
+ }
+-
+- buf = (unsigned char*) _TIFFmalloc(TIFFStripSize(tif));
+- if (buf == 0) {
+- TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for strip buffer");
+- return (0);
+- }
+- _TIFFmemset(buf, 0, TIFFStripSize(tif));
++
++ maxstripsize = TIFFStripSize(tif);
+
+ flip = setorientation(img);
+ if (flip & FLIP_VERTICALLY) {
+@@ -946,11 +942,12 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+ nrowsub = nrow;
+ if ((nrowsub%subsamplingver)!=0)
+ nrowsub+=subsamplingver-nrowsub%subsamplingver;
+- if (TIFFReadEncodedStrip(tif,
++ if (_TIFFReadEncodedStripAndAllocBuffer(tif,
+ TIFFComputeStrip(tif,row+img->row_offset, 0),
+- buf,
++ (void**)(&buf),
++ maxstripsize,
+ ((row + img->row_offset)%rowsperstrip + nrowsub) * scanline)==(tmsize_t)(-1)
+- && img->stoponerr)
++ && (buf == NULL || img->stoponerr))
+ {
+ ret = 0;
+ break;
+@@ -994,8 +991,8 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+ {
+ TIFF* tif = img->tif;
+ tileSeparateRoutine put = img->put.separate;
+- unsigned char *buf;
+- unsigned char *p0, *p1, *p2, *pa;
++ unsigned char *buf = NULL;
++ unsigned char *p0 = NULL, *p1 = NULL, *p2 = NULL, *pa = NULL;
+ uint32 row, y, nrow, rowstoread;
+ tmsize_t pos;
+ tmsize_t scanline;
+@@ -1014,15 +1011,6 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+ TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Integer overflow in %s", "gtStripSeparate");
+ return (0);
+ }
+- p0 = buf = (unsigned char *)_TIFFmalloc(bufsize);
+- if (buf == 0) {
+- TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for tile buffer");
+- return (0);
+- }
+- _TIFFmemset(buf, 0, bufsize);
+- p1 = p0 + stripsize;
+- p2 = p1 + stripsize;
+- pa = (alpha?(p2+stripsize):NULL);
+
+ flip = setorientation(img);
+ if (flip & FLIP_VERTICALLY) {
+@@ -1040,7 +1028,6 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+ case PHOTOMETRIC_MINISBLACK:
+ case PHOTOMETRIC_PALETTE:
+ colorchannels = 1;
+- p2 = p1 = p0;
+ break;
+
+ default:
+@@ -1056,7 +1043,31 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+ rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip;
+ nrow = (row + rowstoread > h ? h - row : rowstoread);
+ offset_row = row + img->row_offset;
+- if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 0),
++ if( buf == NULL )
++ {
++ if (_TIFFReadEncodedStripAndAllocBuffer(
++ tif, TIFFComputeStrip(tif, offset_row, 0),
++ (void**) &buf, bufsize,
++ ((row + img->row_offset)%rowsperstrip + nrow) * scanline)==(tmsize_t)(-1)
++ && (buf == NULL || img->stoponerr))
++ {
++ ret = 0;
++ break;
++ }
++ p0 = buf;
++ if( colorchannels == 1 )
++ {
++ p2 = p1 = p0;
++ pa = (alpha?(p0+3*stripsize):NULL);
++ }
++ else
++ {
++ p1 = p0 + stripsize;
++ p2 = p1 + stripsize;
++ pa = (alpha?(p2+stripsize):NULL);
++ }
++ }
++ else if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 0),
+ p0, ((row + img->row_offset)%rowsperstrip + nrow) * scanline)==(tmsize_t)(-1)
+ && img->stoponerr)
+ {
+diff --git a/libtiff/tif_read.c b/libtiff/tif_read.c
+index fc0072e7..047305ab 100644
+--- a/libtiff/tif_read.c
++++ b/libtiff/tif_read.c
+@@ -442,18 +442,17 @@ TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample)
+ }
+
+ /*
+- * Read a strip of data and decompress the specified
+- * amount into the user-supplied buffer.
++ * Calculate the strip size according to the number of
++ * rows in the strip (check for truncated last strip on any
++ * of the separations).
+ */
+-tmsize_t
+-TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
++static tmsize_t TIFFReadEncodedStripGetStripSize(TIFF* tif, uint32 strip, uint16* pplane)
+ {
+ static const char module[] = "TIFFReadEncodedStrip";
+ TIFFDirectory *td = &tif->tif_dir;
+ uint32 rowsperstrip;
+ uint32 stripsperplane;
+ uint32 stripinplane;
+- uint16 plane;
+ uint32 rows;
+ tmsize_t stripsize;
+ if (!TIFFCheckRead(tif,0))
+@@ -465,23 +464,37 @@ TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
+ (unsigned long)td->td_nstrips);
+ return((tmsize_t)(-1));
+ }
+- /*
+- * Calculate the strip size according to the number of
+- * rows in the strip (check for truncated last strip on any
+- * of the separations).
+- */
++
+ rowsperstrip=td->td_rowsperstrip;
+ if (rowsperstrip>td->td_imagelength)
+ rowsperstrip=td->td_imagelength;
+ stripsperplane= TIFFhowmany_32_maxuint_compat(td->td_imagelength, rowsperstrip);
+ stripinplane=(strip%stripsperplane);
+- plane=(uint16)(strip/stripsperplane);
++ if( pplane ) *pplane=(uint16)(strip/stripsperplane);
+ rows=td->td_imagelength-stripinplane*rowsperstrip;
+ if (rows>rowsperstrip)
+ rows=rowsperstrip;
+ stripsize=TIFFVStripSize(tif,rows);
+ if (stripsize==0)
+ return((tmsize_t)(-1));
++ return stripsize;
++}
++
++/*
++ * Read a strip of data and decompress the specified
++ * amount into the user-supplied buffer.
++ */
++tmsize_t
++TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
++{
++ static const char module[] = "TIFFReadEncodedStrip";
++ TIFFDirectory *td = &tif->tif_dir;
++ tmsize_t stripsize;
++ uint16 plane;
++
++ stripsize=TIFFReadEncodedStripGetStripSize(tif, strip, &plane);
++ if (stripsize==((tmsize_t)(-1)))
++ return((tmsize_t)(-1));
+
+ /* shortcut to avoid an extra memcpy() */
+ if( td->td_compression == COMPRESSION_NONE &&
+@@ -510,6 +523,49 @@ TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
+ return(stripsize);
+ }
+
++/* Variant of TIFFReadEncodedStrip() that does
++ * * if *buf == NULL, *buf = _TIFFmalloc(bufsizetoalloc) only after TIFFFillStrip() has
++ * suceeded. This avoid excessive memory allocation in case of truncated
++ * file.
++ * * calls regular TIFFReadEncodedStrip() if *buf != NULL
++ */
++tmsize_t
++_TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32 strip,
++ void **buf, tmsize_t bufsizetoalloc,
++ tmsize_t size_to_read)
++{
++ tmsize_t this_stripsize;
++ uint16 plane;
++
++ if( *buf != NULL )
++ {
++ return TIFFReadEncodedStrip(tif, strip, *buf, size_to_read);
++ }
++
++ this_stripsize=TIFFReadEncodedStripGetStripSize(tif, strip, &plane);
++ if (this_stripsize==((tmsize_t)(-1)))
++ return((tmsize_t)(-1));
++
++ if ((size_to_read!=(tmsize_t)(-1))&&(size_to_read<this_stripsize))
++ this_stripsize=size_to_read;
++ if (!TIFFFillStrip(tif,strip))
++ return((tmsize_t)(-1));
++
++ *buf = _TIFFmalloc(bufsizetoalloc);
++ if (*buf == NULL) {
++ TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for strip buffer");
++ return((tmsize_t)(-1));
++ }
++ _TIFFmemset(*buf, 0, bufsizetoalloc);
++
++ if ((*tif->tif_decodestrip)(tif,*buf,this_stripsize,plane)<=0)
++ return((tmsize_t)(-1));
++ (*tif->tif_postdecode)(tif,*buf,this_stripsize);
++ return(this_stripsize);
++
++
++}
++
+ static tmsize_t
+ TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,
+ const char* module)
+diff --git a/libtiff/tiffiop.h b/libtiff/tiffiop.h
+index 846ade03..7f0b90f7 100644
+--- a/libtiff/tiffiop.h
++++ b/libtiff/tiffiop.h
+@@ -365,6 +365,11 @@ extern void* _TIFFCheckRealloc(TIFF*, void*, tmsize_t, tmsize_t, const char*);
+ extern double _TIFFUInt64ToDouble(uint64);
+ extern float _TIFFUInt64ToFloat(uint64);
+
++extern tmsize_t
++_TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32 strip,
++ void **buf, tmsize_t bufsizetoalloc,
++ tmsize_t size_to_read);
++
+ extern int TIFFInitDumpMode(TIFF*, int);
+ #ifdef PACKBITS_SUPPORT
+ extern int TIFFInitPackBits(TIFF*, int);
--- /dev/null
+From 6173a57d39e04d68b139f8c1aa499a24dbe74ba1 Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Fri, 30 Jun 2017 17:29:44 +0000
+Subject: [PATCH] * libtiff/tif_dirwrite.c: in
+ TIFFWriteDirectoryTagCheckedXXXX() functions associated with LONG8/SLONG8
+ data type, replace assertion that the file is BigTIFF, by a non-fatal error.
+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2712 Reported by team
+ OWL337
+
+---
+ ChangeLog | 8 ++++++++
+ libtiff/tif_dirwrite.c | 20 ++++++++++++++++----
+ 2 files changed, 24 insertions(+), 4 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 6f085e09..77a64385 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,5 +1,13 @@
+ 2017-06-30 Even Rouault <even.rouault at spatialys.com>
+
++ * libtiff/tif_dirwrite.c: in TIFFWriteDirectoryTagCheckedXXXX()
++ functions associated with LONG8/SLONG8 data type, replace assertion that
++ the file is BigTIFF, by a non-fatal error.
++ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2712
++ Reported by team OWL337
++
++2017-06-30 Even Rouault <even.rouault at spatialys.com>
++
+ * libtiff/tif_read.c, tiffiop.h: add a _TIFFReadEncodedStripAndAllocBuffer()
+ function, variant of TIFFReadEncodedStrip() that allocates the
+ decoded buffer only after a first successful TIFFFillStrip(). This avoids
+diff --git a/libtiff/tif_dirwrite.c b/libtiff/tif_dirwrite.c
+index 2967da58..8d6686ba 100644
+--- a/libtiff/tif_dirwrite.c
++++ b/libtiff/tif_dirwrite.c
+@@ -2111,7 +2111,10 @@ TIFFWriteDirectoryTagCheckedLong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, ui
+ {
+ uint64 m;
+ assert(sizeof(uint64)==8);
+- assert(tif->tif_flags&TIFF_BIGTIFF);
++ if( !(tif->tif_flags&TIFF_BIGTIFF) ) {
++ TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","LONG8 not allowed for ClassicTIFF");
++ return(0);
++ }
+ m=value;
+ if (tif->tif_flags&TIFF_SWAB)
+ TIFFSwabLong8(&m);
+@@ -2124,7 +2127,10 @@ TIFFWriteDirectoryTagCheckedLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* di
+ {
+ assert(count<0x20000000);
+ assert(sizeof(uint64)==8);
+- assert(tif->tif_flags&TIFF_BIGTIFF);
++ if( !(tif->tif_flags&TIFF_BIGTIFF) ) {
++ TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","LONG8 not allowed for ClassicTIFF");
++ return(0);
++ }
+ if (tif->tif_flags&TIFF_SWAB)
+ TIFFSwabArrayOfLong8(value,count);
+ return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_LONG8,count,count*8,value));
+@@ -2136,7 +2142,10 @@ TIFFWriteDirectoryTagCheckedSlong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, u
+ {
+ int64 m;
+ assert(sizeof(int64)==8);
+- assert(tif->tif_flags&TIFF_BIGTIFF);
++ if( !(tif->tif_flags&TIFF_BIGTIFF) ) {
++ TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","SLONG8 not allowed for ClassicTIFF");
++ return(0);
++ }
+ m=value;
+ if (tif->tif_flags&TIFF_SWAB)
+ TIFFSwabLong8((uint64*)(&m));
+@@ -2149,7 +2158,10 @@ TIFFWriteDirectoryTagCheckedSlong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* d
+ {
+ assert(count<0x20000000);
+ assert(sizeof(int64)==8);
+- assert(tif->tif_flags&TIFF_BIGTIFF);
++ if( !(tif->tif_flags&TIFF_BIGTIFF) ) {
++ TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","SLONG8 not allowed for ClassicTIFF");
++ return(0);
++ }
+ if (tif->tif_flags&TIFF_SWAB)
+ TIFFSwabArrayOfLong8((uint64*)value,count);
+ return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG8,count,count*8,value));
--- /dev/null
+From 9c45d2395863b793528518d64ddb97d8fdc200dd Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Tue, 11 Jul 2017 08:55:07 +0000
+Subject: [PATCH] * libtiff/tif_lzw.c: fix 4.0.8 regression in the decoding of
+ old-style LZW compressed files.
+
+---
+ ChangeLog | 5 +++++
+ libtiff/tif_lzw.c | 4 ++++
+ 2 files changed, 9 insertions(+)
+
+diff --git a/ChangeLog b/ChangeLog
+index b0c84977..c5c74af7 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,8 @@
++2017-07-11 Even Rouault <even.rouault at spatialys.com>
++
++ * libtiff/tif_lzw.c: fix 4.0.8 regression in the decoding of old-style LZW
++ compressed files.
++
+ 2017-06-30 Even Rouault <even.rouault at spatialys.com>
+
+ * libtiff/tif_dirwrite.c: in TIFFWriteDirectoryTagCheckedXXXX()
+diff --git a/libtiff/tif_lzw.c b/libtiff/tif_lzw.c
+index a2d01c90..f62b9e58 100644
+--- a/libtiff/tif_lzw.c
++++ b/libtiff/tif_lzw.c
+@@ -655,6 +655,9 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
+ }
+
+ bp = (unsigned char *)tif->tif_rawcp;
++#ifdef LZW_CHECKEOS
++ sp->dec_bitsleft = (((uint64)tif->tif_rawcc) << 3);
++#endif
+ nbits = sp->lzw_nbits;
+ nextdata = sp->lzw_nextdata;
+ nextbits = sp->lzw_nextbits;
+@@ -764,6 +767,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
+ }
+ }
+
++ tif->tif_rawcc -= (tmsize_t)( (uint8*) bp - tif->tif_rawcp );
+ tif->tif_rawcp = (uint8*) bp;
+ sp->lzw_nbits = (unsigned short)nbits;
+ sp->lzw_nextdata = nextdata;
--- /dev/null
+From 69bfeec247899776b1b396651adb47436e5f1556 Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Sat, 15 Jul 2017 11:13:46 +0000
+Subject: [PATCH] * tools/tiff2pdf.c: prevent heap buffer overflow write in
+ "Raw" mode on PlanarConfig=Contig input images. Fixes
+ http://bugzilla.maptools.org/show_bug.cgi?id=2715 Reported by team OWL337
+
+---
+ ChangeLog | 7 +++++++
+ tools/tiff2pdf.c | 7 ++++++-
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index b4771234..1b5490f3 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,10 @@
++2017-07-15 Even Rouault <even.rouault at spatialys.com>
++
++ * tools/tiff2pdf.c: prevent heap buffer overflow write in "Raw"
++ mode on PlanarConfig=Contig input images.
++ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2715
++ Reported by team OWL337
++
+ 2017-07-11 Even Rouault <even.rouault at spatialys.com>
+
+ * libtiff/tif_lzw.c: fix 4.0.8 regression in the decoding of old-style LZW
+diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
+index db196e04..cd1e2358 100644
+--- a/tools/tiff2pdf.c
++++ b/tools/tiff2pdf.c
+@@ -1737,7 +1737,12 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
+ return;
+
+ t2p->pdf_transcode = T2P_TRANSCODE_ENCODE;
+- if(t2p->pdf_nopassthrough==0){
++ /* It seems that T2P_TRANSCODE_RAW mode doesn't support separate->contig */
++ /* conversion. At least t2p_read_tiff_size and t2p_read_tiff_size_tile */
++ /* do not take into account the number of samples, and thus */
++ /* that can cause heap buffer overflows such as in */
++ /* http://bugzilla.maptools.org/show_bug.cgi?id=2715 */
++ if(t2p->pdf_nopassthrough==0 && t2p->tiff_planar!=PLANARCONFIG_SEPARATE){
+ #ifdef CCITT_SUPPORT
+ if(t2p->tiff_compression==COMPRESSION_CCITTFAX4
+ ){
+++ /dev/null
-commit 8c101323f5789ef6a0db952d53794e9c4ba48207
-Author: erouault <erouault>
-Date: Fri Dec 2 21:56:56 2016 +0000
-
- * libtiff/tif_read.c, libtiff/tiffiop.h: fix uint32 overflow in
- TIFFReadEncodedStrip() that caused an integer division by zero.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2596
-
-diff --git a/ChangeLog b/ChangeLog
-index 46a5d7c..668b66a 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,10 @@
-+2016-12-02 Even Rouault <even.rouault at spatialys.com>
-+
-+ * libtiff/tif_read.c, libtiff/tiffiop.h: fix uint32 overflow in
-+ TIFFReadEncodedStrip() that caused an integer division by zero.
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2596
-+
- 2016-11-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
-
- * libtiff 4.0.7 released.
-diff --git a/libtiff/tif_read.c b/libtiff/tif_read.c
-index 8003592..29a311d 100644
---- a/libtiff/tif_read.c
-+++ b/libtiff/tif_read.c
-@@ -1,4 +1,4 @@
--/* $Id: tif_read.c,v 1.49 2016-07-10 18:00:21 erouault Exp $ */
-+/* $Id: tif_read.c,v 1.50 2016-12-02 21:56:56 erouault Exp $ */
-
- /*
- * Copyright (c) 1988-1997 Sam Leffler
-@@ -346,7 +346,7 @@ TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
- rowsperstrip=td->td_rowsperstrip;
- if (rowsperstrip>td->td_imagelength)
- rowsperstrip=td->td_imagelength;
-- stripsperplane=((td->td_imagelength+rowsperstrip-1)/rowsperstrip);
-+ stripsperplane= TIFFhowmany_32_maxuint_compat(td->td_imagelength, rowsperstrip);
- stripinplane=(strip%stripsperplane);
- plane=(uint16)(strip/stripsperplane);
- rows=td->td_imagelength-stripinplane*rowsperstrip;
-diff --git a/libtiff/tiffiop.h b/libtiff/tiffiop.h
-index 8bcd0c1..5294ee7 100644
---- a/libtiff/tiffiop.h
-+++ b/libtiff/tiffiop.h
-@@ -1,4 +1,4 @@
--/* $Id: tiffiop.h,v 1.89 2016-01-23 21:20:34 erouault Exp $ */
-+/* $Id: tiffiop.h,v 1.90 2016-12-02 21:56:56 erouault Exp $ */
-
- /*
- * Copyright (c) 1988-1997 Sam Leffler
-@@ -250,6 +250,10 @@ struct tiff {
- #define TIFFhowmany_32(x, y) (((uint32)x < (0xffffffff - (uint32)(y-1))) ? \
- ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) : \
- 0U)
-+/* Variant of TIFFhowmany_32() that doesn't return 0 if x close to MAXUINT. */
-+/* Caution: TIFFhowmany_32_maxuint_compat(x,y)*y might overflow */
-+#define TIFFhowmany_32_maxuint_compat(x, y) \
-+ (((uint32)(x) / (uint32)(y)) + ((((uint32)(x) % (uint32)(y)) != 0) ? 1 : 0))
- #define TIFFhowmany8_32(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
- #define TIFFroundup_32(x, y) (TIFFhowmany_32(x,y)*(y))
- #define TIFFhowmany_64(x, y) ((((uint64)(x))+(((uint64)(y))-1))/((uint64)(y)))
+++ /dev/null
-commit b412777317cabbf8ed89ca38fb180991cca89b8c
-Author: erouault <erouault>
-Date: Fri Dec 2 22:13:32 2016 +0000
-
- * tools/tiffcp.c: avoid uint32 underflow in cpDecodedStrips that
- can cause various issues, such as buffer overflows in the library.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2598
-
-diff --git a/ChangeLog b/ChangeLog
-index 668b66a..0f154d6 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,12 @@
- 2016-12-02 Even Rouault <even.rouault at spatialys.com>
-
-+ * tools/tiffcp.c: avoid uint32 underflow in cpDecodedStrips that
-+ can cause various issues, such as buffer overflows in the library.
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2598
-+
-+2016-12-02 Even Rouault <even.rouault at spatialys.com>
-+
- * libtiff/tif_read.c, libtiff/tiffiop.h: fix uint32 overflow in
- TIFFReadEncodedStrip() that caused an integer division by zero.
- Reported by Agostino Sarubbo.
-diff --git a/tools/tiffcp.c b/tools/tiffcp.c
-index 338a3d1..6dfb9a9 100644
---- a/tools/tiffcp.c
-+++ b/tools/tiffcp.c
-@@ -1,4 +1,4 @@
--/* $Id: tiffcp.c,v 1.55 2016-10-08 15:54:57 erouault Exp $ */
-+/* $Id: tiffcp.c,v 1.56 2016-12-02 22:13:32 erouault Exp $ */
-
- /*
- * Copyright (c) 1988-1997 Sam Leffler
-@@ -985,7 +985,7 @@ DECLAREcpFunc(cpDecodedStrips)
- tstrip_t s, ns = TIFFNumberOfStrips(in);
- uint32 row = 0;
- _TIFFmemset(buf, 0, stripsize);
-- for (s = 0; s < ns; s++) {
-+ for (s = 0; s < ns && row < imagelength; s++) {
- tsize_t cc = (row + rowsperstrip > imagelength) ?
- TIFFVStripSize(in, imagelength - row) : stripsize;
- if (TIFFReadEncodedStrip(in, s, buf, cc) < 0
+++ /dev/null
-commit da99990ba6e1203798a59eb836fc6433ed6e3d66
-Author: erouault <erouault>
-Date: Fri Dec 2 23:05:51 2016 +0000
-
- * libtiff/tif_pixarlog.c, libtiff/tif_luv.c: fix heap-based buffer
- overflow on generation of PixarLog / LUV compressed files, with
- ColorMap, TransferFunction attached and nasty plays with bitspersample.
- The fix for LUV has not been tested, but suffers from the same kind
- of issue of PixarLog.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2604
-
-diff --git a/ChangeLog b/ChangeLog
-index 0f154d6..93c01f8 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,13 @@
-+2016-12-03 Even Rouault <even.rouault at spatialys.com>
-+
-+ * libtiff/tif_pixarlog.c, libtiff/tif_luv.c: fix heap-based buffer
-+ overflow on generation of PixarLog / LUV compressed files, with
-+ ColorMap, TransferFunction attached and nasty plays with bitspersample.
-+ The fix for LUV has not been tested, but suffers from the same kind
-+ of issue of PixarLog.
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2604
-+
- 2016-12-02 Even Rouault <even.rouault at spatialys.com>
-
- * tools/tiffcp.c: avoid uint32 underflow in cpDecodedStrips that
-diff --git a/libtiff/tif_luv.c b/libtiff/tif_luv.c
-index ca08f30..f42ac01 100644
---- a/libtiff/tif_luv.c
-+++ b/libtiff/tif_luv.c
-@@ -1,4 +1,4 @@
--/* $Id: tif_luv.c,v 1.43 2016-09-04 21:32:56 erouault Exp $ */
-+/* $Id: tif_luv.c,v 1.44 2016-12-02 23:05:51 erouault Exp $ */
-
- /*
- * Copyright (c) 1997 Greg Ward Larson
-@@ -158,6 +158,7 @@
- typedef struct logLuvState LogLuvState;
-
- struct logLuvState {
-+ int encoder_state; /* 1 if encoder correctly initialized */
- int user_datafmt; /* user data format */
- int encode_meth; /* encoding method */
- int pixel_size; /* bytes per pixel */
-@@ -1552,6 +1553,7 @@ LogLuvSetupEncode(TIFF* tif)
- td->td_photometric, "must be either LogLUV or LogL");
- break;
- }
-+ sp->encoder_state = 1;
- return (1);
- notsupported:
- TIFFErrorExt(tif->tif_clientdata, module,
-@@ -1563,19 +1565,27 @@ notsupported:
- static void
- LogLuvClose(TIFF* tif)
- {
-+ LogLuvState* sp = (LogLuvState*) tif->tif_data;
- TIFFDirectory *td = &tif->tif_dir;
-
-+ assert(sp != 0);
- /*
- * For consistency, we always want to write out the same
- * bitspersample and sampleformat for our TIFF file,
- * regardless of the data format being used by the application.
- * Since this routine is called after tags have been set but
- * before they have been recorded in the file, we reset them here.
-+ * Note: this is really a nasty approach. See PixarLogClose
- */
-- td->td_samplesperpixel =
-- (td->td_photometric == PHOTOMETRIC_LOGL) ? 1 : 3;
-- td->td_bitspersample = 16;
-- td->td_sampleformat = SAMPLEFORMAT_INT;
-+ if( sp->encoder_state )
-+ {
-+ /* See PixarLogClose. Might avoid issues with tags whose size depends
-+ * on those below, but not completely sure this is enough. */
-+ td->td_samplesperpixel =
-+ (td->td_photometric == PHOTOMETRIC_LOGL) ? 1 : 3;
-+ td->td_bitspersample = 16;
-+ td->td_sampleformat = SAMPLEFORMAT_INT;
-+ }
- }
-
- static void
-diff --git a/libtiff/tif_pixarlog.c b/libtiff/tif_pixarlog.c
-index f4af2ba..9836dce 100644
---- a/libtiff/tif_pixarlog.c
-+++ b/libtiff/tif_pixarlog.c
-@@ -1,4 +1,4 @@
--/* $Id: tif_pixarlog.c,v 1.48 2016-09-23 22:12:18 erouault Exp $ */
-+/* $Id: tif_pixarlog.c,v 1.49 2016-12-02 23:05:51 erouault Exp $ */
-
- /*
- * Copyright (c) 1996-1997 Sam Leffler
-@@ -1233,8 +1233,10 @@ PixarLogPostEncode(TIFF* tif)
- static void
- PixarLogClose(TIFF* tif)
- {
-+ PixarLogState* sp = (PixarLogState*) tif->tif_data;
- TIFFDirectory *td = &tif->tif_dir;
-
-+ assert(sp != 0);
- /* In a really sneaky (and really incorrect, and untruthful, and
- * troublesome, and error-prone) maneuver that completely goes against
- * the spirit of TIFF, and breaks TIFF, on close, we covertly
-@@ -1243,8 +1245,19 @@ PixarLogClose(TIFF* tif)
- * readers that don't know about PixarLog, or how to set
- * the PIXARLOGDATFMT pseudo-tag.
- */
-- td->td_bitspersample = 8;
-- td->td_sampleformat = SAMPLEFORMAT_UINT;
-+
-+ if (sp->state&PLSTATE_INIT) {
-+ /* We test the state to avoid an issue such as in
-+ * http://bugzilla.maptools.org/show_bug.cgi?id=2604
-+ * What appends in that case is that the bitspersample is 1 and
-+ * a TransferFunction is set. The size of the TransferFunction
-+ * depends on 1<<bitspersample. So if we increase it, an access
-+ * out of the buffer will happen at directory flushing.
-+ * Another option would be to clear those targs.
-+ */
-+ td->td_bitspersample = 8;
-+ td->td_sampleformat = SAMPLEFORMAT_UINT;
-+ }
- }
-
- static void
+++ /dev/null
-commit c533d200ecc45e00892a94f9bb2e762a5aa0b2ce
-Author: erouault <erouault>
-Date: Sat Dec 3 11:02:15 2016 +0000
-
- * libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip() to
- instanciate compute ntrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip),
- instead of a logic based on the total size of data. Which is faulty is
- the total size of data is not sufficient to fill the whole image, and thus
- results in reading outside of the StripByCounts/StripOffsets arrays when
- using TIFFReadScanline().
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2608.
-
- * libtiff/tif_strip.c: revert the change in TIFFNumberOfStrips() done
- for http://bugzilla.maptools.org/show_bug.cgi?id=2587 / CVE-2016-9273 since
- the above change is a better fix that makes it unnecessary.
-
-diff --git a/ChangeLog b/ChangeLog
-index 93c01f8..9dbc7a0 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,20 @@
- 2016-12-03 Even Rouault <even.rouault at spatialys.com>
-
-+ * libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip() to
-+ instanciate compute ntrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip),
-+ instead of a logic based on the total size of data. Which is faulty is
-+ the total size of data is not sufficient to fill the whole image, and thus
-+ results in reading outside of the StripByCounts/StripOffsets arrays when
-+ using TIFFReadScanline().
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2608.
-+
-+ * libtiff/tif_strip.c: revert the change in TIFFNumberOfStrips() done
-+ for http://bugzilla.maptools.org/show_bug.cgi?id=2587 / CVE-2016-9273 since
-+ the above change is a better fix that makes it unnecessary.
-+
-+2016-12-03 Even Rouault <even.rouault at spatialys.com>
-+
- * libtiff/tif_pixarlog.c, libtiff/tif_luv.c: fix heap-based buffer
- overflow on generation of PixarLog / LUV compressed files, with
- ColorMap, TransferFunction attached and nasty plays with bitspersample.
-diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
-index 01070f2..f290528 100644
---- a/libtiff/tif_dirread.c
-+++ b/libtiff/tif_dirread.c
-@@ -1,4 +1,4 @@
--/* $Id: tif_dirread.c,v 1.204 2016-11-16 15:14:15 erouault Exp $ */
-+/* $Id: tif_dirread.c,v 1.205 2016-12-03 11:02:15 erouault Exp $ */
-
- /*
- * Copyright (c) 1988-1997 Sam Leffler
-@@ -5502,8 +5502,7 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
- uint64 rowblockbytes;
- uint64 stripbytes;
- uint32 strip;
-- uint64 nstrips64;
-- uint32 nstrips32;
-+ uint32 nstrips;
- uint32 rowsperstrip;
- uint64* newcounts;
- uint64* newoffsets;
-@@ -5534,18 +5533,17 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
- return;
-
- /*
-- * never increase the number of strips in an image
-+ * never increase the number of rows per strip
- */
- if (rowsperstrip >= td->td_rowsperstrip)
- return;
-- nstrips64 = TIFFhowmany_64(bytecount, stripbytes);
-- if ((nstrips64==0)||(nstrips64>0xFFFFFFFF)) /* something is wonky, do nothing. */
-- return;
-- nstrips32 = (uint32)nstrips64;
-+ nstrips = TIFFhowmany_32(td->td_imagelength, rowsperstrip);
-+ if( nstrips == 0 )
-+ return;
-
-- newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips32, sizeof (uint64),
-+ newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
- "for chopped \"StripByteCounts\" array");
-- newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips32, sizeof (uint64),
-+ newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
- "for chopped \"StripOffsets\" array");
- if (newcounts == NULL || newoffsets == NULL) {
- /*
-@@ -5562,18 +5560,18 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
- * Fill the strip information arrays with new bytecounts and offsets
- * that reflect the broken-up format.
- */
-- for (strip = 0; strip < nstrips32; strip++) {
-+ for (strip = 0; strip < nstrips; strip++) {
- if (stripbytes > bytecount)
- stripbytes = bytecount;
- newcounts[strip] = stripbytes;
-- newoffsets[strip] = offset;
-+ newoffsets[strip] = stripbytes ? offset : 0;
- offset += stripbytes;
- bytecount -= stripbytes;
- }
- /*
- * Replace old single strip info with multi-strip info.
- */
-- td->td_stripsperimage = td->td_nstrips = nstrips32;
-+ td->td_stripsperimage = td->td_nstrips = nstrips;
- TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
-
- _TIFFfree(td->td_stripbytecount);
-diff --git a/libtiff/tif_strip.c b/libtiff/tif_strip.c
-index b6098dd..6e9f2ef 100644
---- a/libtiff/tif_strip.c
-+++ b/libtiff/tif_strip.c
-@@ -1,4 +1,4 @@
--/* $Id: tif_strip.c,v 1.37 2016-11-09 23:00:49 erouault Exp $ */
-+/* $Id: tif_strip.c,v 1.38 2016-12-03 11:02:15 erouault Exp $ */
-
- /*
- * Copyright (c) 1991-1997 Sam Leffler
-@@ -63,15 +63,6 @@ TIFFNumberOfStrips(TIFF* tif)
- TIFFDirectory *td = &tif->tif_dir;
- uint32 nstrips;
-
-- /* If the value was already computed and store in td_nstrips, then return it,
-- since ChopUpSingleUncompressedStrip might have altered and resized the
-- since the td_stripbytecount and td_stripoffset arrays to the new value
-- after the initial affectation of td_nstrips = TIFFNumberOfStrips() in
-- tif_dirread.c ~line 3612.
-- See http://bugzilla.maptools.org/show_bug.cgi?id=2587 */
-- if( td->td_nstrips )
-- return td->td_nstrips;
--
- nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
- TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
- if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
+++ /dev/null
-commit 43576568ed4af4bd43409b7ff36939340141dfd6
-Author: erouault <erouault>
-Date: Sat Dec 3 11:15:18 2016 +0000
-
- * libtiff/tif_ojpeg.c: make OJPEGDecode() early exit in case of failure in
- OJPEGPreDecode(). This will avoid a divide by zero, and potential other issues.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2611
-
-diff --git a/ChangeLog b/ChangeLog
-index 9dbc7a0..5b23665 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,12 @@
- 2016-12-03 Even Rouault <even.rouault at spatialys.com>
-
-+ * libtiff/tif_ojpeg.c: make OJPEGDecode() early exit in case of failure in
-+ OJPEGPreDecode(). This will avoid a divide by zero, and potential other issues.
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2611
-+
-+2016-12-03 Even Rouault <even.rouault at spatialys.com>
-+
- * libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip() to
- instanciate compute ntrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip),
- instead of a logic based on the total size of data. Which is faulty is
-diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c
-index 30a1812..93839d8 100644
---- a/libtiff/tif_ojpeg.c
-+++ b/libtiff/tif_ojpeg.c
-@@ -1,4 +1,4 @@
--/* $Id: tif_ojpeg.c,v 1.65 2016-09-04 21:32:56 erouault Exp $ */
-+/* $Id: tif_ojpeg.c,v 1.66 2016-12-03 11:15:18 erouault Exp $ */
-
- /* WARNING: The type of JPEG encapsulation defined by the TIFF Version 6.0
- specification is now totally obsolete and deprecated for new applications and
-@@ -244,6 +244,7 @@ typedef enum {
-
- typedef struct {
- TIFF* tif;
-+ int decoder_ok;
- #ifndef LIBJPEG_ENCAP_EXTERNAL
- JMP_BUF exit_jmpbuf;
- #endif
-@@ -722,6 +723,7 @@ OJPEGPreDecode(TIFF* tif, uint16 s)
- }
- sp->write_curstrile++;
- }
-+ sp->decoder_ok = 1;
- return(1);
- }
-
-@@ -784,8 +786,14 @@ OJPEGPreDecodeSkipScanlines(TIFF* tif)
- static int
- OJPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
- {
-+ static const char module[]="OJPEGDecode";
- OJPEGState* sp=(OJPEGState*)tif->tif_data;
- (void)s;
-+ if( !sp->decoder_ok )
-+ {
-+ TIFFErrorExt(tif->tif_clientdata,module,"Cannot decode: decoder not correctly initialized");
-+ return 0;
-+ }
- if (sp->libjpeg_jpeg_query_style==0)
- {
- if (OJPEGDecodeRaw(tif,buf,cc)==0)
+++ /dev/null
-commit 4307dad7fc153baefeb6bb677060e9c5157e5d42
-Author: erouault <erouault>
-Date: Sat Dec 3 11:35:56 2016 +0000
-
- * tools/tiffcrop.c: fix readContigStripsIntoBuffer() in -i (ignore) mode so
- that the output buffer is correctly incremented to avoid write outside bounds.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2620
-
-diff --git a/ChangeLog b/ChangeLog
-index 5b23665..d6a416b 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,12 @@
- 2016-12-03 Even Rouault <even.rouault at spatialys.com>
-
-+ * tools/tiffcrop.c: fix readContigStripsIntoBuffer() in -i (ignore) mode so
-+ that the output buffer is correctly incremented to avoid write outside bounds.
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2620
-+
-+2016-12-03 Even Rouault <even.rouault at spatialys.com>
-+
- * libtiff/tif_ojpeg.c: make OJPEGDecode() early exit in case of failure in
- OJPEGPreDecode(). This will avoid a divide by zero, and potential other issues.
- Reported by Agostino Sarubbo.
-diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
-index 722b132..bdcbd63 100644
---- a/tools/tiffcrop.c
-+++ b/tools/tiffcrop.c
-@@ -1,4 +1,4 @@
--/* $Id: tiffcrop.c,v 1.46 2016-11-18 14:58:46 erouault Exp $ */
-+/* $Id: tiffcrop.c,v 1.47 2016-12-03 11:35:56 erouault Exp $ */
-
- /* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of
- * the image data through additional options listed below
-@@ -3698,7 +3698,7 @@ static int readContigStripsIntoBuffer (TIFF* in, uint8* buf)
- (unsigned long) strip, (unsigned long)rows);
- return 0;
- }
-- bufp += bytes_read;
-+ bufp += stripsize;
- }
-
- return 1;
+++ /dev/null
-commit 17d56c24c10ed300233164cc51380979124d6dd8
-Author: erouault <erouault>
-Date: Sat Dec 3 12:19:32 2016 +0000
-
- * tools/tiffcrop.c: add 3 extra bytes at end of strip buffer in
- readSeparateStripsIntoBuffer() to avoid read outside of heap allocated buffer.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2621
-
-diff --git a/ChangeLog b/ChangeLog
-index d6a416b..50db803 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,12 @@
- 2016-12-03 Even Rouault <even.rouault at spatialys.com>
-
-+ * tools/tiffcrop.c: add 3 extra bytes at end of strip buffer in
-+ readSeparateStripsIntoBuffer() to avoid read outside of heap allocated buffer.
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2621
-+
-+2016-12-03 Even Rouault <even.rouault at spatialys.com>
-+
- * tools/tiffcrop.c: fix readContigStripsIntoBuffer() in -i (ignore) mode so
- that the output buffer is correctly incremented to avoid write outside bounds.
- Reported by Agostino Sarubbo.
-diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
-index bdcbd63..9122aab 100644
---- a/tools/tiffcrop.c
-+++ b/tools/tiffcrop.c
-@@ -1,4 +1,4 @@
--/* $Id: tiffcrop.c,v 1.47 2016-12-03 11:35:56 erouault Exp $ */
-+/* $Id: tiffcrop.c,v 1.48 2016-12-03 12:19:32 erouault Exp $ */
-
- /* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of
- * the image data through additional options listed below
-@@ -4815,10 +4815,17 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8 *obuf, uint32 length,
- nstrips = TIFFNumberOfStrips(in);
- strips_per_sample = nstrips /spp;
-
-+ /* Add 3 padding bytes for combineSeparateSamples32bits */
-+ if( (size_t) stripsize > 0xFFFFFFFFU - 3U )
-+ {
-+ TIFFError("readSeparateStripsIntoBuffer", "Integer overflow when calculating buffer size.");
-+ exit(-1);
-+ }
-+
- for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
- {
- srcbuffs[s] = NULL;
-- buff = _TIFFmalloc(stripsize);
-+ buff = _TIFFmalloc(stripsize + 3);
- if (!buff)
- {
- TIFFError ("readSeparateStripsIntoBuffer",
-@@ -4827,6 +4834,9 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8 *obuf, uint32 length,
- _TIFFfree (srcbuffs[i]);
- return 0;
- }
-+ buff[stripsize] = 0;
-+ buff[stripsize+1] = 0;
-+ buff[stripsize+2] = 0;
- srcbuffs[s] = buff;
- }
-
+++ /dev/null
-commit fc9eedf265394eb8a5633160a8fcdb7ece072701
-Author: erouault <erouault>
-Date: Sat Dec 3 13:00:03 2016 +0000
-
- * tools/tiffcrop.c: fix integer division by zero when BitsPerSample is missing.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2619
-
-diff --git a/ChangeLog b/ChangeLog
-index 50db803..2940828 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,11 @@
- 2016-12-03 Even Rouault <even.rouault at spatialys.com>
-
-+ * tools/tiffcrop.c: fix integer division by zero when BitsPerSample is missing.
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2619
-+
-+2016-12-03 Even Rouault <even.rouault at spatialys.com>
-+
- * tools/tiffcrop.c: add 3 extra bytes at end of strip buffer in
- readSeparateStripsIntoBuffer() to avoid read outside of heap allocated buffer.
- Reported by Agostino Sarubbo.
-diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
-index 9122aab..21dd087 100644
---- a/tools/tiffcrop.c
-+++ b/tools/tiffcrop.c
-@@ -1,4 +1,4 @@
--/* $Id: tiffcrop.c,v 1.48 2016-12-03 12:19:32 erouault Exp $ */
-+/* $Id: tiffcrop.c,v 1.49 2016-12-03 13:00:04 erouault Exp $ */
-
- /* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of
- * the image data through additional options listed below
-@@ -1164,7 +1164,7 @@ writeBufferToSeparateStrips (TIFF* out, uint8* buf,
- tdata_t obuf;
-
- (void) TIFFGetFieldDefaulted(out, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
-- (void) TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps);
-+ (void) TIFFGetFieldDefaulted(out, TIFFTAG_BITSPERSAMPLE, &bps);
- bytes_per_sample = (bps + 7) / 8;
- if( width == 0 ||
- (uint32)bps * (uint32)spp > TIFF_UINT32_MAX / width ||
-@@ -4760,7 +4760,7 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8 *obuf, uint32 length,
- int i, bytes_per_sample, bytes_per_pixel, shift_width, result = 1;
- uint32 j;
- int32 bytes_read = 0;
-- uint16 bps, planar;
-+ uint16 bps = 0, planar;
- uint32 nstrips;
- uint32 strips_per_sample;
- uint32 src_rowsize, dst_rowsize, rows_processed, rps;
-@@ -4780,7 +4780,7 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8 *obuf, uint32 length,
- }
-
- memset (srcbuffs, '\0', sizeof(srcbuffs));
-- TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bps);
-+ TIFFGetFieldDefaulted(in, TIFFTAG_BITSPERSAMPLE, &bps);
- TIFFGetFieldDefaulted(in, TIFFTAG_PLANARCONFIG, &planar);
- TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &rps);
- if (rps > length)
+++ /dev/null
-commit a1d523c27dafafadf589c77e834c52661f1c78fc
-Author: erouault <erouault>
-Date: Sat Dec 3 14:18:48 2016 +0000
-
- * tools/tiffinfo.c: fix null pointer dereference in -r mode when the image has
- no StripByteCount tag.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2594
-
-diff --git a/ChangeLog b/ChangeLog
-index dd27c7f..e41d00c 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,12 @@
- 2016-12-03 Even Rouault <even.rouault at spatialys.com>
-
-+ * tools/tiffinfo.c: fix null pointer dereference in -r mode when the image has
-+ no StripByteCount tag.
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2594
-+
-+2016-12-03 Even Rouault <even.rouault at spatialys.com>
-+
- * tools/tiffcrop.c: fix integer division by zero when BitsPerSample is missing.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2619
-diff --git a/tools/tiffinfo.c b/tools/tiffinfo.c
-index b02c7d4..4d58055 100644
---- a/tools/tiffinfo.c
-+++ b/tools/tiffinfo.c
-@@ -1,4 +1,4 @@
--/* $Id: tiffinfo.c,v 1.25 2016-11-12 20:06:05 bfriesen Exp $ */
-+/* $Id: tiffinfo.c,v 1.26 2016-12-03 14:18:49 erouault Exp $ */
-
- /*
- * Copyright (c) 1988-1997 Sam Leffler
-@@ -417,7 +417,7 @@ TIFFReadRawData(TIFF* tif, int bitrev)
- uint64* stripbc=NULL;
-
- TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &stripbc);
-- if (nstrips > 0) {
-+ if (stripbc != NULL && nstrips > 0) {
- uint32 bufsize = (uint32) stripbc[0];
- tdata_t buf = _TIFFmalloc(bufsize);
- tstrip_t s;
+++ /dev/null
-commit 6d3ef98b2415b2edfa36a5ba600d5a824c094309
-Author: erouault <erouault>
-Date: Sat Dec 3 14:42:40 2016 +0000
-
- * tools/tiffcp.c: avoid potential division by zero if BitsPerSamples tag is
- missing.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2597
-
-diff --git a/ChangeLog b/ChangeLog
-index e41d00c..0d7b12d 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,12 @@
- 2016-12-03 Even Rouault <even.rouault at spatialys.com>
-
-+ * tools/tiffcp.c: avoid potential division by zero if BitsPerSamples tag is
-+ missing.
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2597
-+
-+2016-12-03 Even Rouault <even.rouault at spatialys.com>
-+
- * tools/tiffinfo.c: fix null pointer dereference in -r mode when the image has
- no StripByteCount tag.
- Reported by Agostino Sarubbo.
-diff --git a/tools/tiffcp.c b/tools/tiffcp.c
-index 6dfb9a9..c8e48c3 100644
---- a/tools/tiffcp.c
-+++ b/tools/tiffcp.c
-@@ -1,4 +1,4 @@
--/* $Id: tiffcp.c,v 1.56 2016-12-02 22:13:32 erouault Exp $ */
-+/* $Id: tiffcp.c,v 1.57 2016-12-03 14:42:40 erouault Exp $ */
-
- /*
- * Copyright (c) 1988-1997 Sam Leffler
-@@ -1378,7 +1378,7 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer)
- uint8* bufp = (uint8*) buf;
- uint32 tw, tl;
- uint32 row;
-- uint16 bps, bytes_per_sample;
-+ uint16 bps = 0, bytes_per_sample;
-
- tilebuf = _TIFFmalloc(tilesize);
- if (tilebuf == 0)
-@@ -1387,6 +1387,12 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer)
- (void) TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw);
- (void) TIFFGetField(in, TIFFTAG_TILELENGTH, &tl);
- (void) TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bps);
-+ if( bps == 0 )
-+ {
-+ TIFFError(TIFFFileName(in), "Error, cannot read BitsPerSample");
-+ status = 0;
-+ goto done;
-+ }
- assert( bps % 8 == 0 );
- bytes_per_sample = bps/8;
-
+++ /dev/null
-commit 9991b31a7c651e7b87a3ccd73b3dc5c67dcfdd60
-Author: erouault <erouault>
-Date: Sat Dec 3 15:30:31 2016 +0000
-
- * tools/tif_dir.c: when TIFFGetField(, TIFFTAG_NUMBEROFINKS, ) is called,
- limit the return number of inks to SamplesPerPixel, so that code that parses
- ink names doesn't go past the end of the buffer.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2599
-
-
- Reported by Agostino Sarubbo.
-
-diff --git a/ChangeLog b/ChangeLog
-index 0d7b12d..fb9fc0e 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,13 @@
- 2016-12-03 Even Rouault <even.rouault at spatialys.com>
-
-+ * tools/tif_dir.c: when TIFFGetField(, TIFFTAG_NUMBEROFINKS, ) is called,
-+ limit the return number of inks to SamplesPerPixel, so that code that parses
-+ ink names doesn't go past the end of the buffer.
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2599
-+
-+2016-12-03 Even Rouault <even.rouault at spatialys.com>
-+
- * tools/tiffcp.c: avoid potential division by zero if BitsPerSamples tag is
- missing.
- Reported by Agostino Sarubbo.
-diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c
-index ad21655..2574e74 100644
---- a/libtiff/tif_dir.c
-+++ b/libtiff/tif_dir.c
-@@ -1,4 +1,4 @@
--/* $Id: tif_dir.c,v 1.127 2016-10-25 21:35:15 erouault Exp $ */
-+/* $Id: tif_dir.c,v 1.128 2016-12-03 15:30:31 erouault Exp $ */
-
- /*
- * Copyright (c) 1988-1997 Sam Leffler
-@@ -854,6 +854,32 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
- if( fip == NULL ) /* cannot happen since TIFFGetField() already checks it */
- return 0;
-
-+ if( tag == TIFFTAG_NUMBEROFINKS )
-+ {
-+ int i;
-+ for (i = 0; i < td->td_customValueCount; i++) {
-+ uint16 val;
-+ TIFFTagValue *tv = td->td_customValues + i;
-+ if (tv->info->field_tag != tag)
-+ continue;
-+ val = *(uint16 *)tv->value;
-+ /* Truncate to SamplesPerPixel, since the */
-+ /* setting code for INKNAMES assume that there are SamplesPerPixel */
-+ /* inknames. */
-+ /* Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2599 */
-+ if( val > td->td_samplesperpixel )
-+ {
-+ TIFFWarningExt(tif->tif_clientdata,"_TIFFVGetField",
-+ "Truncating NumberOfInks from %u to %u",
-+ val, td->td_samplesperpixel);
-+ val = td->td_samplesperpixel;
-+ }
-+ *va_arg(ap, uint16*) = val;
-+ return 1;
-+ }
-+ return 0;
-+ }
-+
- /*
- * We want to force the custom code to be used for custom
- * fields even if the tag happens to match a well known
+++ /dev/null
-commit 307a31765cb01245e3655ce168385dd7d51e14bd
-Author: erouault <erouault>
-Date: Sat Dec 3 15:44:15 2016 +0000
-
- * tools/tiffcp.c: avoid potential division by zero if BitsPerSamples tag is
- missing.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2607
-
-diff --git a/ChangeLog b/ChangeLog
-index ac2d922..94be038 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,12 @@
- 2016-12-03 Even Rouault <even.rouault at spatialys.com>
-
-+ * tools/tiffcp.c: avoid potential division by zero if BitsPerSamples tag is
-+ missing.
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2607
-+
-+2016-12-03 Even Rouault <even.rouault at spatialys.com>
-+
- * tools/tif_dir.c: when TIFFGetField(, TIFFTAG_NUMBEROFINKS, ) is called,
- limit the return number of inks to SamplesPerPixel, so that code that parses
- ink names doesn't go past the end of the buffer.
-diff --git a/tools/tiffcp.c b/tools/tiffcp.c
-index c8e48c3..142cbb0 100644
---- a/tools/tiffcp.c
-+++ b/tools/tiffcp.c
-@@ -1,4 +1,4 @@
--/* $Id: tiffcp.c,v 1.57 2016-12-03 14:42:40 erouault Exp $ */
-+/* $Id: tiffcp.c,v 1.58 2016-12-03 15:44:15 erouault Exp $ */
-
- /*
- * Copyright (c) 1988-1997 Sam Leffler
-@@ -1569,7 +1569,7 @@ DECLAREwriteFunc(writeBufferToSeparateTiles)
- uint8* bufp = (uint8*) buf;
- uint32 tl, tw;
- uint32 row;
-- uint16 bps, bytes_per_sample;
-+ uint16 bps = 0, bytes_per_sample;
-
- obuf = _TIFFmalloc(TIFFTileSize(out));
- if (obuf == NULL)
-@@ -1578,6 +1578,12 @@ DECLAREwriteFunc(writeBufferToSeparateTiles)
- (void) TIFFGetField(out, TIFFTAG_TILELENGTH, &tl);
- (void) TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw);
- (void) TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps);
-+ if( bps == 0 )
-+ {
-+ TIFFError(TIFFFileName(out), "Error, cannot read BitsPerSample");
-+ _TIFFfree(obuf);
-+ return 0;
-+ }
- assert( bps % 8 == 0 );
- bytes_per_sample = bps/8;
-
+++ /dev/null
-commit b34209fede77aa203cd5adcd9638ccc70731a50f
-Author: erouault <erouault>
-Date: Sat Dec 3 16:40:01 2016 +0000
-
- * tools/tiffcp.c: fix uint32 underflow/overflow that can cause heap-based
- buffer overflow.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2610
-
-diff --git a/ChangeLog b/ChangeLog
-index 94be038..8ee76c0 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,12 @@
- 2016-12-03 Even Rouault <even.rouault at spatialys.com>
-
-+ * tools/tiffcp.c: fix uint32 underflow/overflow that can cause heap-based
-+ buffer overflow.
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2610
-+
-+2016-12-03 Even Rouault <even.rouault at spatialys.com>
-+
- * tools/tiffcp.c: avoid potential division by zero if BitsPerSamples tag is
- missing.
- Reported by Agostino Sarubbo.
-diff --git a/tools/tiffcp.c b/tools/tiffcp.c
-index 142cbb0..6d96bb8 100644
---- a/tools/tiffcp.c
-+++ b/tools/tiffcp.c
-@@ -1,4 +1,4 @@
--/* $Id: tiffcp.c,v 1.58 2016-12-03 15:44:15 erouault Exp $ */
-+/* $Id: tiffcp.c,v 1.59 2016-12-03 16:40:01 erouault Exp $ */
-
- /*
- * Copyright (c) 1988-1997 Sam Leffler
-@@ -1163,7 +1163,7 @@ bad:
-
- static void
- cpStripToTile(uint8* out, uint8* in,
-- uint32 rows, uint32 cols, int outskew, int inskew)
-+ uint32 rows, uint32 cols, int outskew, int64 inskew)
- {
- while (rows-- > 0) {
- uint32 j = cols;
-@@ -1320,7 +1320,7 @@ DECLAREreadFunc(readContigTilesIntoBuffer)
- tdata_t tilebuf;
- uint32 imagew = TIFFScanlineSize(in);
- uint32 tilew = TIFFTileRowSize(in);
-- int iskew = imagew - tilew;
-+ int64 iskew = (int64)imagew - (int64)tilew;
- uint8* bufp = (uint8*) buf;
- uint32 tw, tl;
- uint32 row;
-@@ -1348,7 +1348,7 @@ DECLAREreadFunc(readContigTilesIntoBuffer)
- status = 0;
- goto done;
- }
-- if (colb + tilew > imagew) {
-+ if (colb > iskew) {
- uint32 width = imagew - colb;
- uint32 oskew = tilew - width;
- cpStripToTile(bufp + colb,
+++ /dev/null
-commit 18bca4cf3057681689efb502175cbe5f01cb68c3
-Author: erouault <erouault>
-Date: Sat Dec 3 16:50:02 2016 +0000
-
- * tools/tiffcp.c: replace assert( (bps % 8) == 0 ) by a non assert check.
- Reported by Agostino Sarubbo.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2605
-
-diff --git a/ChangeLog b/ChangeLog
-index 8ee76c0..025eb72 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,11 @@
- 2016-12-03 Even Rouault <even.rouault at spatialys.com>
-
-+ * tools/tiffcp.c: replace assert( (bps % 8) == 0 ) by a non assert check.
-+ Reported by Agostino Sarubbo.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2605
-+
-+2016-12-03 Even Rouault <even.rouault at spatialys.com>
-+
- * tools/tiffcp.c: fix uint32 underflow/overflow that can cause heap-based
- buffer overflow.
- Reported by Agostino Sarubbo.
-diff --git a/tools/tiffcp.c b/tools/tiffcp.c
-index 6d96bb8..49c9d37 100644
---- a/tools/tiffcp.c
-+++ b/tools/tiffcp.c
-@@ -1,4 +1,4 @@
--/* $Id: tiffcp.c,v 1.59 2016-12-03 16:40:01 erouault Exp $ */
-+/* $Id: tiffcp.c,v 1.60 2016-12-03 16:50:02 erouault Exp $ */
-
- /*
- * Copyright (c) 1988-1997 Sam Leffler
-@@ -45,7 +45,6 @@
- #include <string.h>
-
- #include <ctype.h>
--#include <assert.h>
-
- #ifdef HAVE_UNISTD_H
- # include <unistd.h>
-@@ -1393,7 +1392,12 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer)
- status = 0;
- goto done;
- }
-- assert( bps % 8 == 0 );
-+ if( (bps % 8) != 0 )
-+ {
-+ TIFFError(TIFFFileName(in), "Error, cannot handle BitsPerSample that is not a multiple of 8");
-+ status = 0;
-+ goto done;
-+ }
- bytes_per_sample = bps/8;
-
- for (row = 0; row < imagelength; row += tl) {
-@@ -1584,7 +1588,12 @@ DECLAREwriteFunc(writeBufferToSeparateTiles)
- _TIFFfree(obuf);
- return 0;
- }
-- assert( bps % 8 == 0 );
-+ if( (bps % 8) != 0 )
-+ {
-+ TIFFError(TIFFFileName(out), "Error, cannot handle BitsPerSample that is not a multiple of 8");
-+ _TIFFfree(obuf);
-+ return 0;
-+ }
- bytes_per_sample = bps/8;
-
- for (row = 0; row < imagelength; row += tl) {
+++ /dev/null
-commit 8c9dbee088d8b43cdae47b9c5f711058bd1f17f1
-Author: erouault <erouault>
-Date: Tue Dec 13 18:15:48 2016 +0000
-
- * libtiff/tif_fax3.h: revert change done on 2016-01-09 that made
- Param member of TIFFFaxTabEnt structure a uint16 to reduce size of
- the binary. It happens that the Hylafax software uses the tables that
- follow this typedef (TIFFFaxMainTable, TIFFFaxWhiteTable,
- TIFFFaxBlackTable), also they are not in a public libtiff header.
- Raised by Lee Howard.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2636
-
-diff --git a/ChangeLog b/ChangeLog
-index ee6fd802..558db20e 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,13 @@
-+2016-12-13 Even Rouault <even.rouault at spatialys.com>
-+
-+ * libtiff/tif_fax3.h: revert change done on 2016-01-09 that made
-+ Param member of TIFFFaxTabEnt structure a uint16 to reduce size of
-+ the binary. It happens that the Hylafax software uses the tables that
-+ follow this typedef (TIFFFaxMainTable, TIFFFaxWhiteTable,
-+ TIFFFaxBlackTable), also they are not in a public libtiff header.
-+ Raised by Lee Howard.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2636
-+
- 2016-12-03 Even Rouault <even.rouault at spatialys.com>
-
- * tools/tiffcp.c: replace assert( (bps % 8) == 0 ) by a non assert check.
-diff --git a/libtiff/tif_fax3.h b/libtiff/tif_fax3.h
-index e0b2ca6b..45ce43f1 100644
---- a/libtiff/tif_fax3.h
-+++ b/libtiff/tif_fax3.h
-@@ -1,4 +1,4 @@
--/* $Id: tif_fax3.h,v 1.11 2016-01-23 21:20:34 erouault Exp $ */
-+/* $Id: tif_fax3.h,v 1.12 2016-12-13 18:15:48 erouault Exp $ */
-
- /*
- * Copyright (c) 1990-1997 Sam Leffler
-@@ -81,10 +81,12 @@ extern void _TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32);
- #define S_MakeUp 11
- #define S_EOL 12
-
-+/* WARNING: do not change the layout of this structure as the Halyfax software */
-+/* really depends on it. See http://bugzilla.maptools.org/show_bug.cgi?id=2636 */
- typedef struct { /* state table entry */
- unsigned char State; /* see above */
- unsigned char Width; /* width of code in bits */
-- uint16 Param; /* unsigned 16-bit run length in bits */
-+ uint32 Param; /* unsigned 32-bit run length in bits (holds on 16 bit actually, but cannot be changed. See above warning) */
- } TIFFFaxTabEnt;
-
- extern const TIFFFaxTabEnt TIFFFaxMainTable[];
+++ /dev/null
-From c7153361a4041260719b340f73f2f76b0969235c Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Tue, 20 Dec 2016 17:28:17 +0000
-Subject: [PATCH] * tools/tiff2pdf.c: avoid potential heap-based overflow in
- t2p_readwrite_pdf_image_tile(). Fixes
- http://bugzilla.maptools.org/show_bug.cgi?id=2640
-
----
- ChangeLog | 6 ++++++
- tools/tiff2pdf.c | 2 +-
- 2 files changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index 6be3602..91ba4e6 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,9 @@
-+2016-12-20 Even Rouault <even.rouault at spatialys.com>
-+
-+ * tools/tiff2pdf.c: avoid potential heap-based overflow in
-+ t2p_readwrite_pdf_image_tile().
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2640
-+
- 2016-12-13 Even Rouault <even.rouault at spatialys.com>
-
- * libtiff/tif_fax3.h: revert change done on 2016-01-09 that made
-diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
-index 47d7629..db196e0 100644
---- a/tools/tiff2pdf.c
-+++ b/tools/tiff2pdf.c
-@@ -2895,7 +2895,7 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P
- return(0);
- }
- if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt) != 0) {
-- if (count >= 4) {
-+ if (count > 4) {
- /* Ignore EOI marker of JpegTables */
- _TIFFmemcpy(buffer, jpt, count - 2);
- bufferoffset += count - 2;
+++ /dev/null
-From 5c080298d59efa53264d7248bbe3a04660db6ef7 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Wed, 11 Jan 2017 19:25:44 +0000
-Subject: [PATCH] * tools/tiffcp.c: error out cleanly in cpContig2SeparateByRow
- and cpSeparate2ContigByRow if BitsPerSample != 8 to avoid heap based
- overflow. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2656 and
- http://bugzilla.maptools.org/show_bug.cgi?id=2657
-
----
- ChangeLog | 7 +++++++
- tools/tiffcp.c | 24 ++++++++++++++++++++++--
- 2 files changed, 29 insertions(+), 2 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index f78cad0..064f25b 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,10 @@
-+2017-01-11 Even Rouault <even.rouault at spatialys.com>
-+
-+ * tools/tiffcp.c: error out cleanly in cpContig2SeparateByRow and
-+ cpSeparate2ContigByRow if BitsPerSample != 8 to avoid heap based overflow.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2656 and
-+ http://bugzilla.maptools.org/show_bug.cgi?id=2657
-+
- 2016-12-20 Even Rouault <even.rouault at spatialys.com>
-
- * tools/tiff2pdf.c: avoid potential heap-based overflow in
-diff --git a/tools/tiffcp.c b/tools/tiffcp.c
-index bdf754c..8bbcd52 100644
---- a/tools/tiffcp.c
-+++ b/tools/tiffcp.c
-@@ -591,7 +591,7 @@ static copyFunc pickCopyFunc(TIFF*, TIFF*, uint16, uint16);
- static int
- tiffcp(TIFF* in, TIFF* out)
- {
-- uint16 bitspersample, samplesperpixel = 1;
-+ uint16 bitspersample = 1, samplesperpixel = 1;
- uint16 input_compression, input_photometric = PHOTOMETRIC_MINISBLACK;
- copyFunc cf;
- uint32 width, length;
-@@ -1067,6 +1067,16 @@ DECLAREcpFunc(cpContig2SeparateByRow)
- register uint32 n;
- uint32 row;
- tsample_t s;
-+ uint16 bps = 0;
-+
-+ (void) TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bps);
-+ if( bps != 8 )
-+ {
-+ TIFFError(TIFFFileName(in),
-+ "Error, can only handle BitsPerSample=8 in %s",
-+ "cpContig2SeparateByRow");
-+ return 0;
-+ }
-
- inbuf = _TIFFmalloc(scanlinesizein);
- outbuf = _TIFFmalloc(scanlinesizeout);
-@@ -1120,6 +1130,16 @@ DECLAREcpFunc(cpSeparate2ContigByRow)
- register uint32 n;
- uint32 row;
- tsample_t s;
-+ uint16 bps = 0;
-+
-+ (void) TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bps);
-+ if( bps != 8 )
-+ {
-+ TIFFError(TIFFFileName(in),
-+ "Error, can only handle BitsPerSample=8 in %s",
-+ "cpSeparate2ContigByRow");
-+ return 0;
-+ }
-
- inbuf = _TIFFmalloc(scanlinesizein);
- outbuf = _TIFFmalloc(scanlinesizeout);
-@@ -1784,7 +1804,7 @@ pickCopyFunc(TIFF* in, TIFF* out, uint16 bitspersample, uint16 samplesperpixel)
- uint32 w, l, tw, tl;
- int bychunk;
-
-- (void) TIFFGetField(in, TIFFTAG_PLANARCONFIG, &shortv);
-+ (void) TIFFGetFieldDefaulted(in, TIFFTAG_PLANARCONFIG, &shortv);
- if (shortv != config && bitspersample != 8 && samplesperpixel > 1) {
- fprintf(stderr,
- "%s: Cannot handle different planar configuration w/ bits/sample != 8\n",
+++ /dev/null
-From 47f2fb61a3a64667bce1a8398a8fcb1b348ff122 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Wed, 11 Jan 2017 12:15:01 +0000
-Subject: [PATCH] * libtiff/tif_jpeg.c: avoid integer division by zero in
- JPEGSetupEncode() when horizontal or vertical sampling is set to 0. Fixes
- http://bugzilla.maptools.org/show_bug.cgi?id=2653
-
----
- ChangeLog | 6 ++++++
- libtiff/tif_jpeg.c | 7 +++++++
- 2 files changed, 13 insertions(+)
-
-diff --git a/ChangeLog b/ChangeLog
-index c82bc76..a7208f5 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,11 @@
- 2017-01-11 Even Rouault <even.rouault at spatialys.com>
-
-+ * libtiff/tif_jpeg.c: avoid integer division by zero in
-+ JPEGSetupEncode() when horizontal or vertical sampling is set to 0.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2653
-+
-+2017-01-11 Even Rouault <even.rouault at spatialys.com>
-+
- * tools/tiffcp.c: error out cleanly in cpContig2SeparateByRow and
- cpSeparate2ContigByRow if BitsPerSample != 8 to avoid heap based overflow.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2656 and
-diff --git a/libtiff/tif_jpeg.c b/libtiff/tif_jpeg.c
-index 38595f9..6c17c38 100644
---- a/libtiff/tif_jpeg.c
-+++ b/libtiff/tif_jpeg.c
-@@ -1626,6 +1626,13 @@ JPEGSetupEncode(TIFF* tif)
- case PHOTOMETRIC_YCBCR:
- sp->h_sampling = td->td_ycbcrsubsampling[0];
- sp->v_sampling = td->td_ycbcrsubsampling[1];
-+ if( sp->h_sampling == 0 || sp->v_sampling == 0 )
-+ {
-+ TIFFErrorExt(tif->tif_clientdata, module,
-+ "Invalig horizontal/vertical sampling value");
-+ return (0);
-+ }
-+
- /*
- * A ReferenceBlackWhite field *must* be present since the
- * default value is inappropriate for YCbCr. Fill in the
+++ /dev/null
-From 3cfd62d77c2a7e147a05bd678524c345fa9c2bb8 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Wed, 11 Jan 2017 13:28:01 +0000
-Subject: [PATCH] * libtiff/tif_dirread.c: avoid division by floating point 0
- in TIFFReadDirEntryCheckedRational() and TIFFReadDirEntryCheckedSrational(),
- and return 0 in that case (instead of infinity as before presumably)
- Apparently some sanitizers do not like those divisions by zero. Fixes
- http://bugzilla.maptools.org/show_bug.cgi?id=2644
-
----
- ChangeLog | 8 ++++++++
- libtiff/tif_dirread.c | 10 ++++++++--
- 2 files changed, 16 insertions(+), 2 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index 6a752cd..722a405 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,13 @@
- 2017-01-11 Even Rouault <even.rouault at spatialys.com>
-
-+ * libtiff/tif_dirread.c: avoid division by floating point 0 in
-+ TIFFReadDirEntryCheckedRational() and TIFFReadDirEntryCheckedSrational(),
-+ and return 0 in that case (instead of infinity as before presumably)
-+ Apparently some sanitizers do not like those divisions by zero.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2644
-+
-+2017-01-11 Even Rouault <even.rouault at spatialys.com>
-+
- * libtiff/tif_jpeg.c: avoid integer division by zero in
- JPEGSetupEncode() when horizontal or vertical sampling is set to 0.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2653
-diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
-index 570d0c3..8a1e42a 100644
---- a/libtiff/tif_dirread.c
-+++ b/libtiff/tif_dirread.c
-@@ -2872,7 +2872,10 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedRational(TIFF* tif, TIFFD
- m.l = direntry->tdir_offset.toff_long8;
- if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfLong(m.i,2);
-- if (m.i[0]==0)
-+ /* Not completely sure what we should do when m.i[1]==0, but some */
-+ /* sanitizers do not like division by 0.0: */
-+ /* http://bugzilla.maptools.org/show_bug.cgi?id=2644 */
-+ if (m.i[0]==0 || m.i[1]==0)
- *value=0.0;
- else
- *value=(double)m.i[0]/(double)m.i[1];
-@@ -2900,7 +2903,10 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSrational(TIFF* tif, TIFF
- m.l=direntry->tdir_offset.toff_long8;
- if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfLong(m.i,2);
-- if ((int32)m.i[0]==0)
-+ /* Not completely sure what we should do when m.i[1]==0, but some */
-+ /* sanitizers do not like division by 0.0: */
-+ /* http://bugzilla.maptools.org/show_bug.cgi?id=2644 */
-+ if ((int32)m.i[0]==0 || m.i[1]==0)
- *value=0.0;
- else
- *value=(double)((int32)m.i[0])/(double)m.i[1];
+++ /dev/null
-From 3144e57770c1e4d26520d8abee750f8ac8b75490 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Wed, 11 Jan 2017 16:09:02 +0000
-Subject: [PATCH] * libtiff/tif_dir.c, tif_dirread.c, tif_dirwrite.c: implement
- various clampings of double to other data types to avoid undefined behaviour
- if the output range isn't big enough to hold the input value. Fixes
- http://bugzilla.maptools.org/show_bug.cgi?id=2643
- http://bugzilla.maptools.org/show_bug.cgi?id=2642
- http://bugzilla.maptools.org/show_bug.cgi?id=2646
- http://bugzilla.maptools.org/show_bug.cgi?id=2647
-
----
- ChangeLog | 10 ++++++
- libtiff/tif_dir.c | 18 +++++++---
- libtiff/tif_dirread.c | 10 +++++-
- libtiff/tif_dirwrite.c | 90 ++++++++++++++++++++++++++++++++++++++++++++------
- 4 files changed, 113 insertions(+), 15 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index 722a405..6517640 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,15 @@
- 2017-01-11 Even Rouault <even.rouault at spatialys.com>
-
-+ * libtiff/tif_dir.c, tif_dirread.c, tif_dirwrite.c: implement various clampings
-+ of double to other data types to avoid undefined behaviour if the output range
-+ isn't big enough to hold the input value.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2643
-+ http://bugzilla.maptools.org/show_bug.cgi?id=2642
-+ http://bugzilla.maptools.org/show_bug.cgi?id=2646
-+ http://bugzilla.maptools.org/show_bug.cgi?id=2647
-+
-+2017-01-11 Even Rouault <even.rouault at spatialys.com>
-+
- * libtiff/tif_dirread.c: avoid division by floating point 0 in
- TIFFReadDirEntryCheckedRational() and TIFFReadDirEntryCheckedSrational(),
- and return 0 in that case (instead of infinity as before presumably)
-diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c
-index 68a55af..a04d28f 100644
---- a/libtiff/tif_dir.c
-+++ b/libtiff/tif_dir.c
-@@ -31,6 +31,7 @@
- * (and also some miscellaneous stuff)
- */
- #include "tiffiop.h"
-+#include <float.h>
-
- /*
- * These are used in the backwards compatibility code...
-@@ -154,6 +155,15 @@ checkInkNamesString(TIFF* tif, uint32 slen, const char* s)
- return (0);
- }
-
-+static float TIFFClampDoubleToFloat( double val )
-+{
-+ if( val > FLT_MAX )
-+ return FLT_MAX;
-+ if( val < -FLT_MAX )
-+ return -FLT_MAX;
-+ return (float)val;
-+}
-+
- static int
- _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
- {
-@@ -312,13 +322,13 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
- dblval = va_arg(ap, double);
- if( dblval < 0 )
- goto badvaluedouble;
-- td->td_xresolution = (float) dblval;
-+ td->td_xresolution = TIFFClampDoubleToFloat( dblval );
- break;
- case TIFFTAG_YRESOLUTION:
- dblval = va_arg(ap, double);
- if( dblval < 0 )
- goto badvaluedouble;
-- td->td_yresolution = (float) dblval;
-+ td->td_yresolution = TIFFClampDoubleToFloat( dblval );
- break;
- case TIFFTAG_PLANARCONFIG:
- v = (uint16) va_arg(ap, uint16_vap);
-@@ -327,10 +337,10 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
- td->td_planarconfig = (uint16) v;
- break;
- case TIFFTAG_XPOSITION:
-- td->td_xposition = (float) va_arg(ap, double);
-+ td->td_xposition = TIFFClampDoubleToFloat( va_arg(ap, double) );
- break;
- case TIFFTAG_YPOSITION:
-- td->td_yposition = (float) va_arg(ap, double);
-+ td->td_yposition = TIFFClampDoubleToFloat( va_arg(ap, double) );
- break;
- case TIFFTAG_RESOLUTIONUNIT:
- v = (uint16) va_arg(ap, uint16_vap);
-diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
-index 8a1e42a..77b0f37 100644
---- a/libtiff/tif_dirread.c
-+++ b/libtiff/tif_dirread.c
-@@ -40,6 +40,7 @@
- */
-
- #include "tiffiop.h"
-+#include <float.h>
-
- #define IGNORE 0 /* tag placeholder used below */
- #define FAILED_FII ((uint32) -1)
-@@ -2406,7 +2407,14 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEnt
- ma=(double*)origdata;
- mb=data;
- for (n=0; n<count; n++)
-- *mb++=(float)(*ma++);
-+ {
-+ double val = *ma++;
-+ if( val > FLT_MAX )
-+ val = FLT_MAX;
-+ else if( val < -FLT_MAX )
-+ val = -FLT_MAX;
-+ *mb++=(float)val;
-+ }
- }
- break;
- }
-diff --git a/libtiff/tif_dirwrite.c b/libtiff/tif_dirwrite.c
-index c9e871b..2967da5 100644
---- a/libtiff/tif_dirwrite.c
-+++ b/libtiff/tif_dirwrite.c
-@@ -30,6 +30,7 @@
- * Directory Write Support Routines.
- */
- #include "tiffiop.h"
-+#include <float.h>
-
- #ifdef HAVE_IEEEFP
- #define TIFFCvtNativeToIEEEFloat(tif, n, fp)
-@@ -939,6 +940,69 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
- return(0);
- }
-
-+static float TIFFClampDoubleToFloat( double val )
-+{
-+ if( val > FLT_MAX )
-+ return FLT_MAX;
-+ if( val < -FLT_MAX )
-+ return -FLT_MAX;
-+ return (float)val;
-+}
-+
-+static int8 TIFFClampDoubleToInt8( double val )
-+{
-+ if( val > 127 )
-+ return 127;
-+ if( val < -128 || val != val )
-+ return -128;
-+ return (int8)val;
-+}
-+
-+static int16 TIFFClampDoubleToInt16( double val )
-+{
-+ if( val > 32767 )
-+ return 32767;
-+ if( val < -32768 || val != val )
-+ return -32768;
-+ return (int16)val;
-+}
-+
-+static int32 TIFFClampDoubleToInt32( double val )
-+{
-+ if( val > 0x7FFFFFFF )
-+ return 0x7FFFFFFF;
-+ if( val < -0x7FFFFFFF-1 || val != val )
-+ return -0x7FFFFFFF-1;
-+ return (int32)val;
-+}
-+
-+static uint8 TIFFClampDoubleToUInt8( double val )
-+{
-+ if( val < 0 )
-+ return 0;
-+ if( val > 255 || val != val )
-+ return 255;
-+ return (uint8)val;
-+}
-+
-+static uint16 TIFFClampDoubleToUInt16( double val )
-+{
-+ if( val < 0 )
-+ return 0;
-+ if( val > 65535 || val != val )
-+ return 65535;
-+ return (uint16)val;
-+}
-+
-+static uint32 TIFFClampDoubleToUInt32( double val )
-+{
-+ if( val < 0 )
-+ return 0;
-+ if( val > 0xFFFFFFFFU || val != val )
-+ return 0xFFFFFFFFU;
-+ return (uint32)val;
-+}
-+
- static int
- TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value)
- {
-@@ -959,7 +1023,7 @@ TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* di
- if (tif->tif_dir.td_bitspersample<=32)
- {
- for (i = 0; i < count; ++i)
-- ((float*)conv)[i] = (float)value[i];
-+ ((float*)conv)[i] = TIFFClampDoubleToFloat(value[i]);
- ok = TIFFWriteDirectoryTagFloatArray(tif,ndir,dir,tag,count,(float*)conv);
- }
- else
-@@ -971,19 +1035,19 @@ TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* di
- if (tif->tif_dir.td_bitspersample<=8)
- {
- for (i = 0; i < count; ++i)
-- ((int8*)conv)[i] = (int8)value[i];
-+ ((int8*)conv)[i] = TIFFClampDoubleToInt8(value[i]);
- ok = TIFFWriteDirectoryTagSbyteArray(tif,ndir,dir,tag,count,(int8*)conv);
- }
- else if (tif->tif_dir.td_bitspersample<=16)
- {
- for (i = 0; i < count; ++i)
-- ((int16*)conv)[i] = (int16)value[i];
-+ ((int16*)conv)[i] = TIFFClampDoubleToInt16(value[i]);
- ok = TIFFWriteDirectoryTagSshortArray(tif,ndir,dir,tag,count,(int16*)conv);
- }
- else
- {
- for (i = 0; i < count; ++i)
-- ((int32*)conv)[i] = (int32)value[i];
-+ ((int32*)conv)[i] = TIFFClampDoubleToInt32(value[i]);
- ok = TIFFWriteDirectoryTagSlongArray(tif,ndir,dir,tag,count,(int32*)conv);
- }
- break;
-@@ -991,19 +1055,19 @@ TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* di
- if (tif->tif_dir.td_bitspersample<=8)
- {
- for (i = 0; i < count; ++i)
-- ((uint8*)conv)[i] = (uint8)value[i];
-+ ((uint8*)conv)[i] = TIFFClampDoubleToUInt8(value[i]);
- ok = TIFFWriteDirectoryTagByteArray(tif,ndir,dir,tag,count,(uint8*)conv);
- }
- else if (tif->tif_dir.td_bitspersample<=16)
- {
- for (i = 0; i < count; ++i)
-- ((uint16*)conv)[i] = (uint16)value[i];
-+ ((uint16*)conv)[i] = TIFFClampDoubleToUInt16(value[i]);
- ok = TIFFWriteDirectoryTagShortArray(tif,ndir,dir,tag,count,(uint16*)conv);
- }
- else
- {
- for (i = 0; i < count; ++i)
-- ((uint32*)conv)[i] = (uint32)value[i];
-+ ((uint32*)conv)[i] = TIFFClampDoubleToUInt32(value[i]);
- ok = TIFFWriteDirectoryTagLongArray(tif,ndir,dir,tag,count,(uint32*)conv);
- }
- break;
-@@ -2094,6 +2094,7 @@ TIFFWriteDirectoryTagCheckedSlong8Array(
- static int
- TIFFWriteDirectoryTagCheckedRational(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value)
- {
-+ static const char module[] = "TIFFWriteDirectoryTagCheckedRational";
- uint32 m[2];
- assert(value>=0.0);
- assert(sizeof(uint32)==4);
-@@ -2102,7 +2102,12 @@ TIFFWriteDirectoryTagCheckedRational(TIF
- m[0]=0;
- m[1]=1;
- }
-- else if (value==(double)(uint32)value)
-+ else if( value != value )
-+ {
-+ TIFFErrorExt(tif->tif_clientdata,module,"Not-a-number value is illegal");
-+ return 0;
-+ }
-+ else if (value <= 0xFFFFFFFFU && value==(double)(uint32)value)
- {
- m[0]=(uint32)value;
- m[1]=1;
-@@ -2143,12 +2212,13 @@ TIFFWriteDirectoryTagCheckedRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry*
- }
- for (na=value, nb=m, nc=0; nc<count; na++, nb+=2, nc++)
- {
-- if (*na<=0.0)
-+ if (*na<=0.0 || *na != *na)
- {
- nb[0]=0;
- nb[1]=1;
- }
-- else if (*na==(float)(uint32)(*na))
-+ else if (*na >= 0 && *na <= (float)0xFFFFFFFFU &&
-+ *na==(float)(uint32)(*na))
- {
- nb[0]=(uint32)(*na);
- nb[1]=1;
+++ /dev/null
-From 0a76a8c765c7b8327c59646284fa78c3c27e5490 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Wed, 11 Jan 2017 16:13:50 +0000
-Subject: [PATCH] * libtiff/tif_jpeg.c: validate BitsPerSample in
- JPEGSetupEncode() to avoid undefined behaviour caused by invalid shift
- exponent. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2648
-
----
- ChangeLog | 6 ++++++
- libtiff/tif_jpeg.c | 7 +++++++
- 2 files changed, 13 insertions(+)
-
-diff --git a/ChangeLog b/ChangeLog
-index 6517640..8e202a2 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,11 @@
- 2017-01-11 Even Rouault <even.rouault at spatialys.com>
-
-+ * libtiff/tif_jpeg.c: validate BitsPerSample in JPEGSetupEncode() to avoid
-+ undefined behaviour caused by invalid shift exponent.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2648
-+
-+2017-01-11 Even Rouault <even.rouault at spatialys.com>
-+
- * libtiff/tif_dir.c, tif_dirread.c, tif_dirwrite.c: implement various clampings
- of double to other data types to avoid undefined behaviour if the output range
- isn't big enough to hold the input value.
-diff --git a/libtiff/tif_jpeg.c b/libtiff/tif_jpeg.c
-index 6c17c38..192989a 100644
---- a/libtiff/tif_jpeg.c
-+++ b/libtiff/tif_jpeg.c
-@@ -1632,6 +1632,13 @@ JPEGSetupEncode(TIFF* tif)
- "Invalig horizontal/vertical sampling value");
- return (0);
- }
-+ if( td->td_bitspersample > 16 )
-+ {
-+ TIFFErrorExt(tif->tif_clientdata, module,
-+ "BitsPerSample %d not allowed for JPEG",
-+ td->td_bitspersample);
-+ return (0);
-+ }
-
- /*
- * A ReferenceBlackWhite field *must* be present since the
+++ /dev/null
-From 66e7bd59520996740e4df5495a830b42fae48bc4 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Wed, 11 Jan 2017 16:33:34 +0000
-Subject: [PATCH] * libtiff/tif_read.c: avoid potential undefined behaviour on
- signed integer addition in TIFFReadRawStrip1() in isMapped() case. Fixes
- http://bugzilla.maptools.org/show_bug.cgi?id=2650
-
----
- ChangeLog | 6 ++++++
- libtiff/tif_read.c | 27 ++++++++++++++++++---------
- 2 files changed, 24 insertions(+), 9 deletions(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index 8e202a2..3e31464 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,11 @@
- 2017-01-11 Even Rouault <even.rouault at spatialys.com>
-
-+ * libtiff/tif_read.c: avoid potential undefined behaviour on signed integer
-+ addition in TIFFReadRawStrip1() in isMapped() case.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2650
-+
-+2017-01-11 Even Rouault <even.rouault at spatialys.com>
-+
- * libtiff/tif_jpeg.c: validate BitsPerSample in JPEGSetupEncode() to avoid
- undefined behaviour caused by invalid shift exponent.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2648
-diff --git a/libtiff/tif_read.c b/libtiff/tif_read.c
-index 52bbf50..b7aacbd 100644
---- a/libtiff/tif_read.c
-+++ b/libtiff/tif_read.c
-@@ -420,16 +420,25 @@ TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,
- return ((tmsize_t)(-1));
- }
- } else {
-- tmsize_t ma,mb;
-+ tmsize_t ma;
- tmsize_t n;
-- ma=(tmsize_t)td->td_stripoffset[strip];
-- mb=ma+size;
-- if ((td->td_stripoffset[strip] > (uint64)TIFF_TMSIZE_T_MAX)||(ma>tif->tif_size))
-- n=0;
-- else if ((mb<ma)||(mb<size)||(mb>tif->tif_size))
-- n=tif->tif_size-ma;
-- else
-- n=size;
-+ if ((td->td_stripoffset[strip] > (uint64)TIFF_TMSIZE_T_MAX)||
-+ ((ma=(tmsize_t)td->td_stripoffset[strip])>tif->tif_size))
-+ {
-+ n=0;
-+ }
-+ else if( ma > TIFF_TMSIZE_T_MAX - size )
-+ {
-+ n=0;
-+ }
-+ else
-+ {
-+ tmsize_t mb=ma+size;
-+ if (mb>tif->tif_size)
-+ n=tif->tif_size-ma;
-+ else
-+ n=size;
-+ }
- if (n!=size) {
- #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- TIFFErrorExt(tif->tif_clientdata, module,
+++ /dev/null
-From 48780b4fcc425cddc4ef8ffdf536f96a0d1b313b Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Wed, 11 Jan 2017 16:38:26 +0000
-Subject: [PATCH] =?UTF-8?q?*=20libtiff/tif=5Fgetimage.c:=20add=20explicit?=
- =?UTF-8?q?=20uint32=20cast=20in=20putagreytile=20to=20avoid=20UndefinedBe?=
- =?UTF-8?q?haviorSanitizer=20warning.=20Patch=20by=20Nicol=C3=A1s=20Pe?=
- =?UTF-8?q?=C3=B1a.=20Fixes=20http://bugzilla.maptools.org/show=5Fbug.cgi?=
- =?UTF-8?q?=3Fid=3D2658?=
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
----
- ChangeLog | 7 +++++++
- libtiff/tif_getimage.c | 2 +-
- 2 files changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index 3e31464..6a342e5 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,12 @@
- 2017-01-11 Even Rouault <even.rouault at spatialys.com>
-
-+ * libtiff/tif_getimage.c: add explicit uint32 cast in putagreytile to
-+ avoid UndefinedBehaviorSanitizer warning.
-+ Patch by Nicolás Peña.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2658
-+
-+2017-01-11 Even Rouault <even.rouault at spatialys.com>
-+
- * libtiff/tif_read.c: avoid potential undefined behaviour on signed integer
- addition in TIFFReadRawStrip1() in isMapped() case.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2650
-diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c
-index fed31f1..2fa1775 100644
---- a/libtiff/tif_getimage.c
-+++ b/libtiff/tif_getimage.c
-@@ -1305,7 +1305,7 @@ DECLAREContigPutFunc(putagreytile)
- while (h-- > 0) {
- for (x = w; x-- > 0;)
- {
-- *cp++ = BWmap[*pp][0] & (*(pp+1) << 24 | ~A1);
-+ *cp++ = BWmap[*pp][0] & ((uint32)*(pp+1) << 24 | ~A1);
- pp += samplesperpixel;
- }
- cp += toskew;
+++ /dev/null
-From d60332057b9575ada4f264489582b13e30137be1 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Wed, 11 Jan 2017 19:02:49 +0000
-Subject: [PATCH] * libtiff/tiffiop.h, tif_unix.c, tif_win32.c, tif_vms.c: add
- _TIFFcalloc()
-
-* libtiff/tif_read.c: TIFFReadBufferSetup(): use _TIFFcalloc() to zero
-initialize tif_rawdata.
-Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2651
----
- ChangeLog | 8 ++++++++
- libtiff/tif_read.c | 4 +++-
- libtiff/tif_unix.c | 8 ++++++++
- libtiff/tif_vms.c | 8 ++++++++
- libtiff/tif_win32.c | 8 ++++++++
- libtiff/tiffio.h | 1 +
- 6 files changed, 36 insertions(+), 1 deletion(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index 6a342e5..abd75d7 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,5 +1,13 @@
- 2017-01-11 Even Rouault <even.rouault at spatialys.com>
-
-+ * libtiff/tiffiop.h, tif_unix.c, tif_win32.c, tif_vms.c: add _TIFFcalloc()
-+
-+ * libtiff/tif_read.c: TIFFReadBufferSetup(): use _TIFFcalloc() to zero
-+ initialize tif_rawdata.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2651
-+
-+2017-01-11 Even Rouault <even.rouault at spatialys.com>
-+
- * libtiff/tif_getimage.c: add explicit uint32 cast in putagreytile to
- avoid UndefinedBehaviorSanitizer warning.
- Patch by Nicolás Peña.
-diff --git a/libtiff/tif_read.c b/libtiff/tif_read.c
-index 277fdd6..4535ccb 100644
---- a/libtiff/tif_read.c
-+++ b/libtiff/tif_read.c
-@@ -985,7 +985,9 @@ TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size)
- "Invalid buffer size");
- return (0);
- }
-- tif->tif_rawdata = (uint8*) _TIFFmalloc(tif->tif_rawdatasize);
-+ /* Initialize to zero to avoid uninitialized buffers in case of */
-+ /* short reads (http://bugzilla.maptools.org/show_bug.cgi?id=2651) */
-+ tif->tif_rawdata = (uint8*) _TIFFcalloc(1, tif->tif_rawdatasize);
- tif->tif_flags |= TIFF_MYBUFFER;
- }
- if (tif->tif_rawdata == NULL) {
-diff --git a/libtiff/tif_unix.c b/libtiff/tif_unix.c
-index 7c7bc96..89dd32e 100644
---- a/libtiff/tif_unix.c
-+++ b/libtiff/tif_unix.c
-@@ -316,6 +316,14 @@ _TIFFmalloc(tmsize_t s)
- return (malloc((size_t) s));
- }
-
-+void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz)
-+{
-+ if( nmemb == 0 || siz == 0 )
-+ return ((void *) NULL);
-+
-+ return calloc((size_t) nmemb, (size_t)siz);
-+}
-+
- void
- _TIFFfree(void* p)
- {
-diff --git a/libtiff/tif_win32.c b/libtiff/tif_win32.c
-index d730b3a..3e9001b 100644
---- a/libtiff/tif_win32.c
-+++ b/libtiff/tif_win32.c
-@@ -360,6 +360,14 @@ _TIFFmalloc(tmsize_t s)
- return (malloc((size_t) s));
- }
-
-+void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz)
-+{
-+ if( nmemb == 0 || siz == 0 )
-+ return ((void *) NULL);
-+
-+ return calloc((size_t) nmemb, (size_t)siz);
-+}
-+
- void
- _TIFFfree(void* p)
- {
-diff --git a/libtiff/tiffio.h b/libtiff/tiffio.h
-index 732da17..fbd9171 100644
---- a/libtiff/tiffio.h
-+++ b/libtiff/tiffio.h
-@@ -293,6 +293,7 @@ extern TIFFCodec* TIFFGetConfiguredCODECs(void);
- */
-
- extern void* _TIFFmalloc(tmsize_t s);
-+extern void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz);
- extern void* _TIFFrealloc(void* p, tmsize_t s);
- extern void _TIFFmemset(void* p, int v, tmsize_t c);
- extern void _TIFFmemcpy(void* d, const void* s, tmsize_t c);
+++ /dev/null
-From 8283e4d1b7e53340684d12932880cbcbaf23a8c1 Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Thu, 12 Jan 2017 17:43:25 +0000
-Subject: [PATCH] =?UTF-8?q?*=20libtiff/tif=5Fojpeg.c:=20fix=20leak=20in=20?=
- =?UTF-8?q?OJPEGReadHeaderInfoSecTablesAcTable=20when=20read=20fails.=20Pa?=
- =?UTF-8?q?tch=20by=20Nicol=C3=A1s=20Pe=C3=B1a.=20Fixes=20http://bugzilla.?=
- =?UTF-8?q?maptools.org/show=5Fbug.cgi=3Fid=3D2659?=
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
----
- ChangeLog | 7 +++++++
- libtiff/tif_ojpeg.c | 3 +++
- 2 files changed, 10 insertions(+)
-
-diff --git a/ChangeLog b/ChangeLog
-index 6e6f3b0..12e0370 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,3 +1,10 @@
-+2017-01-12 Even Rouault <even.rouault at spatialys.com>
-+
-+ * libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesAcTable
-+ when read fails.
-+ Patch by Nicolás Peña.
-+ Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2659
-+
- 2017-01-11 Even Rouault <even.rouault at spatialys.com>
-
- * libtiff/tiffiop.h, tif_unix.c, tif_win32.c, tif_vms.c: add _TIFFcalloc()
-diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c
-index f19e8fd..b92f0eb 100644
---- a/libtiff/tif_ojpeg.c
-+++ b/libtiff/tif_ojpeg.c
-@@ -1918,7 +1918,10 @@ OJPEGReadHeaderInfoSecTablesAcTable(TIFF* tif)
- rb[sizeof(uint32)+5+n]=o[n];
- p=(uint32)TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q);
- if (p!=q)
-+ {
-+ _TIFFfree(rb);
- return(0);
-+ }
- sp->actable[m]=rb;
- sp->sos_tda[m]=(sp->sos_tda[m]|m);
- }
+++ /dev/null
-From 2ea32f7372b65c24b2816f11c04bf59b5090d05b Mon Sep 17 00:00:00 2001
-From: erouault <erouault>
-Date: Thu, 12 Jan 2017 19:23:20 +0000
-Subject: [PATCH] * libtiff/tif_ojpeg.c: fix leak in
- OJPEGReadHeaderInfoSecTablesQTable, OJPEGReadHeaderInfoSecTablesDcTable and
- OJPEGReadHeaderInfoSecTablesAcTable
-
----
- ChangeLog | 3 ++-
- libtiff/tif_ojpeg.c | 6 ++++++
- 2 files changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/ChangeLog b/ChangeLog
-index 12e0370..cd2fa17 100644
---- a/ChangeLog
-+++ b/ChangeLog
-@@ -1,6 +1,7 @@
- 2017-01-12 Even Rouault <even.rouault at spatialys.com>
-
-- * libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesAcTable
-+ * libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesQTable,
-+ OJPEGReadHeaderInfoSecTablesDcTable and OJPEGReadHeaderInfoSecTablesAcTable
- when read fails.
- Patch by Nicolás Peña.
- Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2659
-diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c
-index b92f0eb..5f6c684 100644
---- a/libtiff/tif_ojpeg.c
-+++ b/libtiff/tif_ojpeg.c
-@@ -1790,7 +1790,10 @@ OJPEGReadHeaderInfoSecTablesQTable(TIFF* tif)
- TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET);
- p=(uint32)TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
- if (p!=64)
-+ {
-+ _TIFFfree(ob);
- return(0);
-+ }
- sp->qtable[m]=ob;
- sp->sof_tq[m]=m;
- }
-@@ -1854,7 +1857,10 @@ OJPEGReadHeaderInfoSecTablesDcTable(TIFF* tif)
- rb[sizeof(uint32)+5+n]=o[n];
- p=(uint32)TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q);
- if (p!=q)
-+ {
-+ _TIFFfree(rb);
- return(0);
-+ }
- sp->dctable[m]=rb;
- sp->sos_tda[m]=(m<<4);
- }
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://www.corpit.ru/mjt/tinycdb/
PKG_VERSION:=0.78
-PKG_MD5SUM:=976266afc3f6e7e17492a8d18f21f8f6
+PKG_HASH:=50678f432d8ada8d69f728ec11c3140e151813a7847cf30a62d86f3a720ed63c
PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
PKG_LICENSE:=NLPL
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=115108dc791a2f9e99e150012bcb459d9095da2dd7d80699b584ac0ac3768710
PKG_SOURCE_URL:=http://www.corpit.ru/mjt/udns
PKG_LICENSE:=LGPL-2.1
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
PKG_NAME:=unixodbc
PKG_VERSION:=2.3.4
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_SOURCE_URL:=ftp://ftp.unixodbc.org/pub/unixODBC/
PKG_SOURCE:=unixODBC-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=bd25d261ca1808c947cb687e2034be81
+PKG_HASH:=2e1509a96bb18d248bf08ead0d74804957304ff7c6f8b2e5965309c632421e39
PKG_BUILD_DIR:=$(BUILD_DIR)/unixODBC-$(PKG_VERSION)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/unixODBC-$(PKG_VERSION)
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
PKG_LICENSE:=prog GPL libs LGPL
+HOST_BUILD_DEPENDS:=unixodbc
+
+# if your other package depends on unixodbc and needs
+# odbc_config, add to your other Makefile
+# PKG_BUILD_DEPENDS:=unixodbc/host
include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
CONFIGURE_ARGS += \
--disable-gui \
--with-pic \
$(MAKE_FLAGS) \
ARCH="$(ARCH)" \
CC="$(TARGET_CC)"
- rm $(PKG_BUILD_DIR)/exe/{odbc_config,odbc-config.o}
- $(MAKE) -C $(PKG_BUILD_DIR)/exe \
- DESTDIR="$(PKG_INSTALL_DIR)" \
- CC="$(HOSTCC)" \
- CFLAGS="$(HOST_CFLAGS) -DUSE_UNIXODBC_CONF_H" \
- LDFLAGS="$(HOST_LDFLAGS)"
$(MAKE) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" \
$(MAKE_FLAGS) \
endef
define Build/InstallDev
- $(INSTALL_DIR) $(1)/host/bin
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/odbc_config $(1)/host/bin
- $(INSTALL_DIR) $(1)/usr/bin
- $(LN) ../../host/bin/odbc_config $(1)/usr/bin
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/$(STAGING_DIR)/usr/include/*.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
echo "Driver = /usr/lib/libodbcpsql.so" >> $(1)/etc/odbcinst.ini.d/pgsqlodbc.ini
endef
+define Host/Configure
+ $(call Host/Configure/Default)
+ cp $(PKG_BUILD_DIR)/config.h $(HOST_BUILD_DIR)
+ cp $(PKG_BUILD_DIR)/unixodbc_conf.h $(HOST_BUILD_DIR)
+endef
+
+define Host/Compile
+ $(MAKE) -C $(HOST_BUILD_DIR)/exe \
+ DESTDIR="$(HOST_INSTALL_DIR)" \
+ CC="$(HOSTCC)" \
+ CFLAGS="$(HOST_CFLAGS) -DUSE_UNIXODBC_CONF_H" \
+ LDFLAGS="$(HOST_LDFLAGS)" \
+ odbc_config
+endef
+
+define Host/Install
+ $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
+ $(CP) $(HOST_BUILD_DIR)/exe/odbc_config $(STAGING_DIR_HOST)/bin
+endef
+
$(eval $(call BuildPackage,unixodbc))
$(eval $(call BuildPackage,unixodbc-tools))
$(eval $(call BuildPackage,pgsqlodbc))
+$(eval $(call HostBuild))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.vips.ecs.soton.ac.uk/supported/7.42/
-PKG_MD5SUM:=33a4590924b3120ce309982ec85a7c16
+PKG_HASH:=5ee272b11e4ca61c148d7392cbc01ad35f577b503727f479e38923e5bcfe6abf
PKG_FIXUP:=autoreconf
PKG_CHECK_FORMAT_SECURITY:=0
PKG_REV:=66cb08ca2ad8581080b626a75dfca266a890afb2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=95bfdb37f864318fc3c2ee736a747d4902d279a88f361770c89e60ff5e1d6f63
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_URL:=git://github.com/lloyd/yajl.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://pyyaml.org/download/libyaml/
-PKG_MD5SUM:=5fe00cda18ca5daeb43762b80c38e06e
+PKG_HASH:=7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= https://github.com/zeromq/zeromq4-1/releases/download/v$(PKG_VERSION)/
-PKG_MD5SUM:=a611ecc93fffeb6d058c0e6edf4ad4fb
+PKG_HASH:=e99f44fde25c2e4cb84ce440f87ca7d3fe3271c2b8cfbc67d55e4de25e6fe378
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=libuuid
PKG_SOURCE_URL:=http://patches.freeiz.com/alpine/release/src/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=043b67666af73b26f9627ad97e2aaf92
+PKG_HASH:=ed639b6e5bb97e6b0645c85262ca6a784316195d461ce8d8411999bf80449227
PKG_MAINTAINER:=Antti Seppälä <a.seppala@gmail.com>
PKG_LICENSE:=Apache-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/bogofilter
-PKG_MD5SUM:=d0a5eebb3274b23ceabe766a6443a1c5
+PKG_HASH:=e10287a58d135feaea26880ce7d4b9fa2841fb114a2154bf7da8da98aab0a6b4
PKG_INSTALL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=dovecot
-PKG_VERSION:=2.2.31
-PKG_RELEASE:=2
+PKG_VERSION:=2.2.32
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.dovecot.org/releases/2.2
-PKG_HASH:=034be40907748128d65088a4f59789b2f99ae7b33a88974eae0b6a68ece376a1
+PKG_HASH:=160b2151e2af359877f69cb2dcdfe1a3f4138ad3766e3b8562b96616e2f6bc2e
PKG_LICENSE:=LGPL-2.1 MIT BSD-3-Clause Unique
PKG_LICENSE_FILES:=COPYING COPYING.LGPL COPYING.MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.gz
PKG_SOURCE_URL:=@SF/emailrelay/$(PKG_VERSION)
-PKG_MD5SUM:=0892fbf993407c6b5a16f96e23299b62
+PKG_HASH:=869a3e2d053237d7f63784acc25e748af2dbf2d9b9c5c48e4a5269d4e4b5bda0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(TOPDIR)/rules.mk
PKG_NAME:=fdm
-PKG_VERSION:=1.7
-PKG_RELEASE:=1
+PKG_VERSION:=1.9
+PKG_RELEASE:=2
PKG_LICENSE:=BSD-2-Clause
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/fdm
-PKG_MD5SUM:=aea0421571e8f3ec8f747a5d72c84348
+PKG_SOURCE:=$(PKG_VERSION).zip
+PKG_SOURCE_URL:=https://github.com/nicm/fdm/archive
+PKG_HASH:=ee08f9133657c8c959b738079c2e4f556cf5cca2daa8343feaf4f07698ad6086
PKG_INSTALL:=1
to a pipe, file, maildir, mbox or SMTP server, based on $(if $(CONFIG_FDM_WITH_PCRE),PCRE,POSIX regexp)
endef
+ifdef CONFIG_FDM_WITH_PCRE
+ EXTRA_CFLAGS := -DPCRE
+ EXTRA_LDFLAGS += -lpcre
+endif
+
MAKE_FLAGS += \
- PREFIX="/usr"\
+ PREFIX="/usr" \
$(if $(CONFIG_FDM_WITH_PCRE),PCRE=1)
define Build/Prepare
$(CP) ./src/compat/* $(PKG_BUILD_DIR)/
endef
+define Build/Configure
+ ( cd $(PKG_BUILD_DIR); ./autogen.sh )
+ $(call Build/Configure/Default)
+endef
+
define Package/fdm/config
source "$(SOURCE)/Config.in"
endef
--- /dev/null
+Index: fdm-1.9/Makefile.am
+===================================================================
+--- fdm-1.9.orig/Makefile.am
++++ fdm-1.9/Makefile.am
+@@ -107,7 +107,9 @@ dist_fdm_SOURCES = \
+ xmalloc.c \
+ \
+ parse.y \
+- lex.c
++ lex.c \
++ b64_ntop.c \
++ b64_pton.c
+
+ nodist_fdm_SOURCES =
+ if NO_STRLCAT
PKG_RELEASE:=1
PKG_SOURCE_URL:=ftp://ftp.gnu.org/gnu/mailman/ http://ftp.gnu.org/gnu/mailman/
PKG_VERSION:=2.1.23
-PKG_MD5SUM:=ceb2d8427e29f4e69b2505423ffeb60b
+PKG_HASH:=b022ca6f8534621c9dbe50c983948688bc4623214773b580c2c78e4a7ae43e69
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/muquit/mailsend/archive/$(PKG_VERSION)
-PKG_MD5SUM:=60103c411a8627e893d35e7836f904e8
+PKG_HASH:=73cb1b2455de95ab126e3682bf19c62e6baabee00f449da692be0bebd3ceb26b
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/msmtp-scripts
-PKG_MD5SUM:=2aec48d47b02facf2a33cf97a7434e969c1a054224406e6c55320d825c7902b2
+PKG_HASH:=2aec48d47b02facf2a33cf97a7434e969c1a054224406e6c55320d825c7902b2
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_URL:=ftp://ftp.mutt.org/pub/mutt/ \
https://bitbucket.org/mutt/mutt/downloads/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=15425c4c9946d58c22ccb44901544e6d
+PKG_HASH:=1553501687cd22d5b8aaee4dc5a7d9dcf6cc61d7956f6aabaadd252d10cd5ff9
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=GPL
PKG_SOURCE:=heirloom-mailx_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/h/heirloom-mailx/
-PKG_MD5SUM:=29a6033ef1412824d02eb9d9213cb1f2
+PKG_HASH:=015ba4209135867f37a0245d22235a392b8bbed956913286b887c2e2a9a421ad
PKG_BUILD_DIR:=$(BUILD_DIR)/heirloom-mailx-$(PKG_VERSION)
PKG_INSTALL:=0
include $(TOPDIR)/rules.mk
PKG_NAME:=pigeonhole
-PKG_VERSION:=0.4.16
+PKG_VERSION:=0.4.20
PKG_RELEASE:=1
DOVECOT_VERSION:=2.2
PKG_SOURCE:=dovecot-$(DOVECOT_VERSION)-$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pigeonhole.dovecot.org/releases/$(DOVECOT_VERSION)
-PKG_HASH:=8f0b98f18062d6e241eef74ebe16cc167cd246361cbe6657d94f0ecc5d7d3234
+PKG_HASH:=6fe17d0b8f25f2ad580e01ad81ce47a9e965255e383a1f80e455f9ca0f00be5b
PKG_LICENSE:=LGPL-2.1
PKG_LICENSE_FILES:=COPYING COPYING.LGPL
include $(TOPDIR)/rules.mk
PKG_NAME:=postfix
-PKG_RELEASE:=1
+PKG_RELEASE:=3
PKG_SOURCE_URL:=ftp://ftp.porcupine.org/mirrors/postfix-release/official/
PKG_VERSION:=3.2.2
PKG_HASH:=d06849418d119d09366997b2b481bb23f737629769b4e4a52da42fb3ad8b0576
echo "Warning: $${IPKG_INSTROOT}$(sendmail_path) saved as $${IPKG_INSTROOT}$(sendmail_path)$(ln_old_suffix)"
fi
if [ ! -f "$${IPKG_INSTROOT}$(sendmail_path)" ]; then
- ln -s "$${IPKG_INSTROOT}$(sendmail_path)$(ln_suffix)" "$(sendmail_path)"
+ ln -s "$(sendmail_path)$(ln_suffix)" "$${IPKG_INSTROOT}$(sendmail_path)"
fi
if [ -f "$${IPKG_INSTROOT}$(newaliases_path)" -a "$$(readlink "$${IPKG_INSTROOT}$(newaliases_path)")" != "$(newaliases_path)$(ln_suffix)" ]; then
echo "Warning: $${IPKG_INSTROOT}$(newaliases_path) saved as $${IPKG_INSTROOT}$(newaliases_path)$(ln_old_suffix)"
fi
if [ ! -f "$${IPKG_INSTROOT}$(newaliases_path)" ]; then
- ln -s "$${IPKG_INSTROOT}$(newaliases_path)$(ln_suffix)" "$(newaliases_path)"
+ ln -s "$(newaliases_path)$(ln_suffix)" "$${IPKG_INSTROOT}$(newaliases_path)"
fi
if [ -f "$${IPKG_INSTROOT}$(mailq_path)" -a "$$(readlink "$${IPKG_INSTROOT}$(mailq_path)")" != "$(mailq_path)$(ln_suffix)" ]; then
echo "Warning: $${IPKG_INSTROOT}$(mailq_path) saved as $${IPKG_INSTROOT}$(mailq_path)$(ln_old_suffix)"
fi
if [ ! -f "$(mailq_path)" ]; then
- ln -s "$${IPKG_INSTROOT}$(mailq_path)$(ln_suffix)" "$(mailq_path)"
+ ln -s "$(mailq_path)$(ln_suffix)" "$${IPKG_INSTROOT}$(mailq_path)"
fi
grep -qc main\.cf "$${IPKG_INSTROOT}"/etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/main.cf" >> "$${IPKG_INSTROOT}"/etc/sysupgrade.conf
--- /dev/null
+diff -Naur a/conf/post-install b/conf/post-install
+--- a/conf/post-install 2015-12-28 00:00:45.000000000 +0000
++++ b/conf/post-install 2017-08-01 22:42:30.476896711 +0000
+@@ -561,15 +561,16 @@
+ then
+ set_permission=1
+ fi
++ test -n "$recursive" && nonrecursive="" || nonrecursive="-maxdepth 0"
+ test -n "$set_permission" && {
+- chown $recursive $owner $path || exit 1
+- test -z "$group" || chgrp $recursive $group $path || exit 1
++ find $path $nonrecursive ! -user $owner -exec chown $owner "{}" ";" || exit 1
++ test -z "$group" || find $path $nonrecursive ! -group $group -exec chgrp $group "{}" ";" || exit 1
+ # Don't "chmod -R"; queue file status is encoded in mode bits.
+ if [ "$type" = "d" -a -n "$recursive" ]
+ then
+- find $path -type d -exec chmod $mode "{}" ";"
++ find $path -type d -a ! -perm $mode -exec chmod $mode "{}" ";"
+ else
+- chmod $mode $path
++ find $path $nonrecursive ! -perm $mode -exec chmod $mode "{}" ";"
+ fi || exit 1
+ }
+ done
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.bz2
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/s/ssmtp
-PKG_MD5SUM:=22c37dc90c871e8e052b2cab0ad219d010fa938608cd66b21c8f3c759046fa36
+PKG_HASH:=22c37dc90c871e8e052b2cab0ad219d010fa938608cd66b21c8f3c759046fa36
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MIRROR_HASH:=8d887996b6b8cb465ec59f3f713fca46161cbb804cacd2b5405f836083fb58ba
PKG_SOURCE_URL:=https://github.com/j0sh/crtmpserver.git
PKG_SOURCE_SUBDIR:=crtmpserver-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
select FFMPEG_CUSTOM_DECODER_h264
select FFMPEG_CUSTOM_DECODER_hevc
select FFMPEG_CUSTOM_DECODER_jpegls
+ select FFMPEG_CUSTOM_DECODER_mp2
select FFMPEG_CUSTOM_DECODER_mp3
select FFMPEG_CUSTOM_DECODER_mpeg1video
select FFMPEG_CUSTOM_DECODER_mpeg2video
select FFMPEG_CUSTOM_DEMUXER_matroska
select FFMPEG_CUSTOM_DEMUXER_mov
select FFMPEG_CUSTOM_DEMUXER_mp3
+ select FFMPEG_CUSTOM_DEMUXER_mpegps
select FFMPEG_CUSTOM_DEMUXER_mpegts
select FFMPEG_CUSTOM_DEMUXER_mpegvideo
select FFMPEG_CUSTOM_DEMUXER_ogg
select FFMPEG_CUSTOM_DEMUXER_sdp
select FFMPEG_CUSTOM_DEMUXER_wav
select FFMPEG_CUSTOM_DEMUXER_wv
- select FFMPEG_CUSTOM_PARSER_aac
- select FFMPEG_CUSTOM_PARSER_aac_latm
- select FFMPEG_CUSTOM_PARSER_ac3
- select FFMPEG_CUSTOM_PARSER_flac
- select FFMPEG_CUSTOM_PARSER_mpegaudio
- select FFMPEG_CUSTOM_PARSER_opus
select FFMPEG_CUSTOM_PROTOCOL_file
select FFMPEG_CUSTOM_PROTOCOL_http
select FFMPEG_CUSTOM_PROTOCOL_rtp
config FFMPEG_CUSTOM_SELECT_libmp3lame
bool "Libmp3lame"
- depends on FFMPEG_CUSTOM_PATENTED
depends on PACKAGE_lame-lib
select FFMPEG_CUSTOM_DECODER_mp3
select FFMPEG_CUSTOM_MUXER_mp3
select FFMPEG_CUSTOM_DECODER_h264
select FFMPEG_CUSTOM_MUXER_h264
select FFMPEG_CUSTOM_DEMUXER_h264
- select FFMPEG_CUSTOM_PARSER_h264
comment "Encoders"
config FFMPEG_CUSTOM_ENCODER_ac3
bool "AC3"
depends on FFMPEG_CUSTOM_PATENTED
- select FFMPEG_CUSTOM_PARSER_ac3
config FFMPEG_CUSTOM_ENCODER_jpegls
bool "JPEG-LS"
config FFMPEG_CUSTOM_DECODER_aac
bool "AAC (Advanced Audio Coding)"
depends on FFMPEG_CUSTOM_PATENTED
- select FFMPEG_CUSTOM_PARSER_aac
config FFMPEG_CUSTOM_SELECT_adpcm
bool "ADPCM (multiple types)"
config FFMPEG_CUSTOM_DECODER_ac3
bool "AC3"
depends on FFMPEG_CUSTOM_PATENTED
- select FFMPEG_CUSTOM_PARSER_ac3
config FFMPEG_CUSTOM_DECODER_alac
bool "ALAC"
config FFMPEG_CUSTOM_DECODER_flac
bool "FLAC"
- select FFMPEG_CUSTOM_PARSER_flac
config FFMPEG_CUSTOM_DECODER_gif
bool "GIF"
config FFMPEG_CUSTOM_DECODER_mp2
bool "MP2 (MPEG Audio Layer 2)"
- depends on FFMPEG_CUSTOM_PATENTED
config FFMPEG_CUSTOM_DECODER_mp3
- bool "MP3 (MPEG Audio Layer 2)"
- depends on FFMPEG_CUSTOM_PATENTED
+ bool "MP3 (MPEG Audio Layer 3)"
config FFMPEG_CUSTOM_DECODER_mpegvideo
bool "MPEG Video"
config FFMPEG_CUSTOM_DEMUXER_mp3
bool "MP3 (MPEG Audio Layer 3)"
- select FFMPEG_CUSTOM_PARSER_mpegaudio
config FFMPEG_CUSTOM_DEMUXER_mpegvideo
- bool "MPEG Video"
+ bool "MPEG Video (Raw)"
config FFMPEG_CUSTOM_DEMUXER_mpegps
bool "MPEG-2 (PS)"
include $(TOPDIR)/rules.mk
PKG_NAME:=ffmpeg
-PKG_VERSION:=3.2.6
-PKG_RELEASE:=2
+PKG_VERSION:=3.2.7
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://ffmpeg.org/releases/
-PKG_MD5SUM:=7a35bd97bd7253305bf5c0af5f9dd3ce
-PKG_HASH:=3751cebb5c71a861288267769114d12b966a7703a686a325d90a93707f3a6d9f
+PKG_HASH:=28e75fc32485a88035a7ebf0a956a1e5c7e93b440dd4bbd6bc30c7268cf34fe9
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
Ian Leonard <antonlacon@gmail.com>
h264 \
hevc \
jpegls \
+ mp2 \
mp3 \
mpeg1video \
mpeg2video \
matroska \
mov \
mp3 \
+ mpegps \
mpegts \
mpegvideo \
ogg \
FFMPEG_MINI_PROTOCOLS:= \
- file \
+ file
FFMPEG_AUDIO_DECODERS:= \
aac \
wav \
wv \
-FFMPEG_AUDIO_PARSERS:= \
- aac \
- aac_latm \
- ac3 \
- flac \
- mpegaudio \
- opus \
-
FFMPEG_AUDIO_PROTOCOLS:= \
file http icecast rtp tcp udp
--disable-doc \
--disable-debug \
\
- --disable-dxva2 \
--disable-lzma \
--disable-vaapi \
- --disable-vda \
--disable-vdpau \
--disable-outdevs
ifeq ($(CONFIG_SOFT_FLOAT),y)
-FFMPEG_CONFIGURE += \
+FFMPEG_CONFIGURE+= \
--disable-altivec \
--disable-vsx \
--disable-power8 \
- --disable-amd3dnow \
- --disable-amd3dnowext \
- --disable-mmx \
- --disable-mmxext \
- --disable-sse \
- --disable-sse2 \
- --disable-sse3 \
- --disable-ssse3 \
- --disable-sse4 \
- --disable-sse42 \
- --disable-avx \
- --disable-xop \
- --disable-fma3 \
- --disable-fma4 \
- --disable-avx2 \
- --disable-aesni \
--disable-armv5te \
--disable-armv6 \
--disable-armv6t2 \
--disable-runtime-cpudetect
else ifneq ($(findstring arm,$(CONFIG_ARCH)),)
-FFMPEG_CONFIGURE += \
+FFMPEG_CONFIGURE+= \
--disable-runtime-cpudetect
# XXX: GitHub issue 3320 ppc cpu with fpu but no altivec (WNDR4700)
else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
-FFMPEG_CONFIGURE += \
+FFMPEG_CONFIGURE+= \
--disable-altivec
endif
# selectively disable optimizations according to arch/cpu type
ifneq ($(findstring arm,$(CONFIG_ARCH)),)
+ FFMPEG_CONFIGURE+= --enable-lto
+
ifneq ($(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)),)
- FFMPEG_CONFIGURE+= \
- --enable-vfp
+ FFMPEG_CONFIGURE+= --enable-vfp
else
- FFMPEG_CONFIGURE+= \
- --disable-vfp
+ FFMPEG_CONFIGURE+= --disable-vfp
endif
ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
FFMPEG_CONFIGURE+= \
--enable-neon \
--enable-vfp
else
- FFMPEG_CONFIGURE+= \
- --disable-neon
+ FFMPEG_CONFIGURE+= --disable-neon
endif
endif
+ifeq ($(ARCH),x86_64)
+ FFMPEG_CONFIGURE+= --enable-lto
+endif
+
ifneq ($(CONFIG_YASM),y)
-FFMPEG_CONFIGURE += \
- --disable-yasm
+FFMPEG_CONFIGURE+= --disable-yasm
endif
\
$(if $(CONFIG_PACKAGE_shine),--enable-libshine)
else
+ ifeq ($(ARCH),x86_64)
+ FFMPEG_CONFIGURE+= --enable-hardcoded-tables
+ else
+ FFMPEG_CONFIGURE+= --enable-small
+ endif
FFMPEG_CONFIGURE+= \
- --enable-small \
--enable-gpl \
\
$(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame) \
--disable-everything \
$(call FFMPEG_ENABLE,decoder,$(FFMPEG_AUDIO_DECODERS)) \
$(call FFMPEG_ENABLE,demuxer,$(FFMPEG_AUDIO_DEMUXERS)) \
- $(call FFMPEG_ENABLE,parser,$(FFMPEG_AUDIO_PARSERS)) \
$(call FFMPEG_ENABLE,protocol,$(FFMPEG_AUDIO_PROTOCOLS)) \
--disable-decoder=pcm_bluray,pcm_dvd \
endif
ifneq ($(CONFIG_TARGET_x86),)
- TARGET_CFLAGS += -fomit-frame-pointer
+ TARGET_CFLAGS+= -fomit-frame-pointer
endif
define Build/Configure
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.firestorm.cx/fswebcam/files \
http://www.sanslogic.co.uk/fswebcam/files
-PKG_MD5SUM:=1bfdb21904e816f100370ec8f4df986b
+PKG_HASH:=444d6a8a82102e09e935540c64a731021de36db03e1e74181f41ca6f39aa6474
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENCE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/gphoto
-PKG_MD5SUM:=6c6a21b5e879330cdd71ef92dce36399
PKG_HASH:=9302d02fb472d4936988382b7277ccdc4edaf7ede56c490278912ffd0627699c
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNOME/grilo-plugins/0.3/
-PKG_MD5SUM:=eb25fbe4be83e77f2308d086177a8f4c
+PKG_HASH:=791b89289781272c001545931a8f58f499d14e46e038a9caa82dfe2494301afd
PKG_BUILD_DEPENDS:=glib2 grilo
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNOME/grilo/0.3/
-PKG_MD5SUM:=3b6733633e42143ff90fac1fef34cf42
+PKG_HASH:=ebbdc61dc7920a8cac436895e8625a0ee64d6a4b352987fb5d361ef87243cd4c
PKG_BUILD_DEPENDS:=glib2 libsoup libxml2
PKG_SOURCE:=gst-libav-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-libav
-PKG_MD5SUM:=b5f3c7a27b39b5f5c2f0bfd546b0c655020faf6b38d27b64b346c43e5ebf687a
+PKG_HASH:=b5f3c7a27b39b5f5c2f0bfd546b0c655020faf6b38d27b64b346c43e5ebf687a
PKG_LICENSE:=GPL-2.0 LGPL-2.0
PKG_LICENSE_FILES:=COPYING COPYING.LIB
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-bad-$(PKG_VERSION)
PKG_SOURCE:=gst-plugins-bad-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-bad/
-PKG_MD5SUM:=d7995317530c8773ec088f94d9320909d41da61996b801ebacce9a56af493f97
+PKG_HASH:=d7995317530c8773ec088f94d9320909d41da61996b801ebacce9a56af493f97
PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-base-$(PKG_VERSION)
PKG_SOURCE:=gst-plugins-base-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-base/
-PKG_MD5SUM:=9d7109c8fb0a5dec8edb17b0053c59a46aba7ddf48dc48ea822ebbbd4339d38d
+PKG_HASH:=9d7109c8fb0a5dec8edb17b0053c59a46aba7ddf48dc48ea822ebbbd4339d38d
PKG_BUILD_DEPENDS:= libgstreamer1
PKG_CONFIG_DEPENDS:= \
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-good-$(PKG_VERSION)
PKG_SOURCE:=gst-plugins-good-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-good/
-PKG_MD5SUM:=8d7549118a3b7a009ece6bb38a05b66709c551d32d2adfd89eded4d1d7a23944
+PKG_HASH:=8d7549118a3b7a009ece6bb38a05b66709c551d32d2adfd89eded4d1d7a23944
PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-ugly-$(PKG_VERSION)
PKG_SOURCE:=gst-plugins-ugly-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-ugly/
-PKG_MD5SUM:=9c5b33a2a98fc1d6d6c99a1b536b1fb2de45f53cc8bf8ab85a8b8141fed1a8ac
+PKG_HASH:=9c5b33a2a98fc1d6d6c99a1b536b1fb2de45f53cc8bf8ab85a8b8141fed1a8ac
PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base
PKG_CONFIG_DEPENDS:= \
PKG_BUILD_DIR:=$(BUILD_DIR)/gstreamer-$(PKG_VERSION)
PKG_SOURCE:=gstreamer-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gstreamer/
-PKG_MD5SUM:=9dbebe079c2ab2004ef7f2649fa317cabea1feb4fb5605c24d40744b90918341
+PKG_HASH:=9dbebe079c2ab2004ef7f2649fa317cabea1feb4fb5605c24d40744b90918341
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=autogen.sh aclocal.m4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.xiph.org/releases/icecast/
-PKG_MD5SUM:=83d7d34dbe22f0f8fc119d2c9839efc0
PKG_HASH:=c85ca48c765d61007573ee1406a797ae6cb31fb5961a42e7f1c87adb45ddc592
PKG_MAINTAINER:=André Gaul <andre@gaul.io>, \
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://downloads.xiph.org/releases/ices/
-PKG_MD5SUM:=832c448cc993170a70fd95804fcda5b2
+PKG_HASH:=96458df835033c39236ad3bb099286c033241f8ea7c138e7ccf714e7ade75900
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.flyn.org/projects/lcdgrilo
-PKG_MD5SUM:=37b0b6519968c2949eae4abfc9030325
+PKG_HASH:=f5e6635864bd2156557e894ab0f95ea50c01fefebb6225d9b39c95622efd67a2
PKG_BUILD_DEPENDS:=+vala
PKG_INSTALL:=1
#
-# Copyright (C) 2006-2015 OpenWrt.org
-#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
PKG_REV:=182
PKG_VERSION:=r$(PKG_REV)
PKG_RELEASE:=8
-PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>, \
+ Ted Hess <thess@kitschensync.net>
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).1.tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).1.tar.xz
PKG_SOURCE_URL:=https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer-experimental
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_PROTO:=svn
+PKG_MIRROR_HASH:=ccff417d0a34f7cee12c7984f77788267b1da0f2a7d849bc1b2e3614e670078b
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_MIRROR_HASH:=02602c775ec3829dac59aed16ea6b0d78f77a435b9c360db1a05cb27227da97e
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_PARALLEL:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=7d38d6cb57529d832d87a49d23d3ce24ba088110e3721580139860486c15494c
PKG_SOURCE_URL:=https://r-w-x.org/oggfwd.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=c18e3803d6e36348442ccf3b0ac4868948692491c7dd646d48576f5aec09cdd8
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/tvheadend/tvheadend.git
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/clark15b/xupnpd.git
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_MIRROR_HASH:=333e9938556c9a02b28732b5512626b991c65eaf0eb60d38e29f72ec513d312f
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
include $(TOPDIR)/rules.mk
PKG_NAME:=youtube-dl
-PKG_VERSION:=2017.06.05
+PKG_VERSION:=2017.09.11
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://yt-dl.org/downloads/$(PKG_VERSION)/
-PKG_HASH:=7ca5143fb2b5d41a9752a4c866cac3f2f261174e
+PKG_HASH:=8b6defdd7cb9a8228eca2ef03a8c203a3ccba1ed97cb700f11b40a3af548212a
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_LICENSE:=Unlicense
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Adrian Panella <ianchi74@outlook.com>
-PKG_BUILD_DEPENDS:=python/host
+PKG_BUILD_DEPENDS:=python/host zip/host
include $(INCLUDE_DIR)/package.mk
PKG_NAME:=acme
PKG_SOURCE_VERSION:=7b40cbe8c1a52041351524bcde4b37665a7cdf79
PKG_VERSION:=1.6
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_LICENSE:=GPLv3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE).tar.xz
+PKG_MIRROR_HASH:=008c6f779bcbbccbde9cdd2b37b07f7a1f5a0678ee9533ce3060690b63edf2c0
PKG_SOURCE_URL:=git://github.com/Neilpang/acme.sh.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
uci delete ucitrack.@acme[0]
uci commit
}
+exit 0
endef
include $(TOPDIR)/rules.mk
PKG_NAME:=adblock
-PKG_VERSION:=2.8.3
+PKG_VERSION:=3.0.2
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
* => daily updates, approx. 150 entries
* [reg_cn](https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt)
* => regional blocklist for China, daily updates, approx. 1.600 entries
+ * [reg_id](https://easylist-downloads.adblockplus.org/abpindo+easylist.txt)
+ * => regional blocklist for Indonesia, daily updates, approx. 800 entries
+ * [reg_nl](https://easylist-downloads.adblockplus.org/easylistdutch+easylist.txt)
+ * => regional blocklist for the Netherlands, weekly updates, approx. 1300 entries
* [reg_pl](http://adblocklist.org)
* => regional blocklist for Poland, daily updates, approx. 50 entries
* [reg_ro](https://easylist-downloads.adblockplus.org/rolist+easylist.txt)
* => daily updates, approx. 440 entries
* zero-conf like automatic installation & setup, usually no manual changes needed
* simple but yet powerful adblock engine: adblock does not use error prone external iptables rulesets, http pixel server instances and things like that
-* automatically selects dnsmasq, unbound or bind as dns backend
+* supports five different dns backends / block list formats: dnsmasq, unbound, named (bind), kresd and dnscrypt-proxy
* automatically selects uclient-fetch or wget as download utility (other tools like curl or aria2c are supported as well)
-* support http only mode (without installed ssl library) for all non-SSL blocklist sources
-* automatically supports a wide range of router modes, even AP modes are supported
+* provides 'http only' mode without installed ssl library for all non-SSL block list sources
+* supports a wide range of router modes, even AP modes are supported
* full IPv4 and IPv6 support
-* supports tld compression (top level domain compression), this feature removes thousands of needless host entries from the block list and lowers the memory footprint for the dns backends
+* provides top level domain compression ('tld compression'), this feature removes thousands of needless host entries from the block list and lowers the memory footprint for the dns backends
* each block list source will be updated and processed separately
* block list source parsing by fast & flexible regex rulesets
* overall duplicate removal in central block list (adb_list.overall)
* quality checks during block list update to ensure a reliable dns backend service
* minimal status & error logging to syslog, enable debug logging to receive more output
* procd based init system support (start/stop/restart/reload/suspend/resume/query/status)
-* procd based hotplug support, the adblock start will be solely triggered by network interface triggers
+* procd network interface trigger support or classic time based startup
* suspend & resume adblock actions temporarily without block list reloading
-* runtime information available via LuCI & via 'status' init command
+* output comprehensive runtime information via LuCI or via 'status' init command
* query function to quickly identify blocked (sub-)domains, e.g. for whitelisting
+* strong LuCI support
* optional: force dns requests to local resolver
* optional: force overall sort / duplicate removal for low memory devices (handle with care!)
* optional: 'manual mode' to re-use blocklist backups during startup, get fresh lists only via manual reload or restart action
* a usual setup with an enabled dns backend at minimum - dump AP modes without a working dns backend are _not_ supported
* a download utility:
* to support all blocklist sources a full version (with ssl support) of 'wget', 'uclient-fetch' with one of the 'libustream-*' ssl libraries, 'aria2c' or 'curl' is required
- * for limited devices with real memory constraints, adblock provides also a plain http option and supports wget-nossl and uclient-fetch (without libustream-ssl), too
+ * for limited devices with real memory constraints, adblock provides also a 'http only' option and supports wget-nossl and uclient-fetch (without libustream-ssl) as well
* for more configuration options see examples below
-## LEDE trunk Installation & Usage
-* install 'adblock' (_opkg install adblock_) and that's it - the adblock start will be automatically triggered by procd interface trigger
+## Installation & Usage
+* install 'adblock' (_opkg install adblock_)
+* at minimum configure the appropriate dns backend ('dnsmasq' by default) and enable the adblock service in _/etc/config/adblock_
* control the adblock service manually with _/etc/init.d/adblock_ start/stop/restart/reload/suspend/resume/status or use the LuCI frontend
-* enable/disable your favored block list sources in _/etc/config/adblock_ - 'adaway', 'disconnect' and 'yoyo' are enabled by default
## LuCI adblock companion package
-* for easy management of the various block list sources and all other adblock options you can also use a nice & efficient LuCI frontend
+* for easy management of the various block list sources and all other adblock options you should use the provided LuCI frontend
* install 'luci-app-adblock' (_opkg install luci-app-adblock_)
* the application is located in LuCI under 'Services' menu
* **add white- / blacklist entries:** add domain white- or blacklist entries to always-allow or -deny certain (sub) domains, by default both lists are empty and located in _/etc/adblock_. Please add one domain per line - ip addresses, wildcards & regex are _not_ allowed (see example below)
* **backup & restore block lists:** enable this feature, to restore automatically the latest compressed backup of your block lists in case of any processing error (e.g. a single block list source is not available during update). Please use an (external) solid partition and _not_ your volatile router temp directory for this
* **scheduled list updates:** for a scheduled call of the adblock service add an appropriate crontab entry (see example below)
-* **restrict procd interface trigger:** restrict the procd interface trigger to a (list of) certain interface(s) (default: wan). To disable it at all, remove all entries
+* **change startup behaviour:** by default the startup will be triggered by the 'wan' procd interface trigger. Choose 'none' to disable automatic startups, 'timed' to use a classic timeout (default 30 sec.) or select another trigger interface.
* **suspend & resume adblocking:** to quickly switch the adblock service 'on' or 'off', simply use _/etc/init.d/adblock [suspend|resume]_
* **domain query:** to query the active block list for a specific domain, please run _/etc/init.d/adblock query `<DOMAIN>`_ (see example below)
* **add new list sources:** you could add new block list sources on your own via uci config, all you need is a source url and an awk one-liner (see example below)
## Further adblock config options
* usually the pre-configured adblock setup works quite well and no manual config overrides are needed, all listed options apply to the 'global' config section:
- * adb\_enabled => main switch to enable/disable adblock service (default: '1', enabled)
+ * adb\_enabled => main switch to enable/disable adblock service (default: '0', disabled)
* adb\_debug => enable/disable adblock debug output (default: '0', disabled)
- * adb\_iface => set the procd interface trigger to a (list of) lan / wan interface(s) (default: 'wan')
- * adb\_fetch => full path to a different download utility, see example below (default: not set, use wget)
- * adb\_fetchparm => options for the download utility, see example below (default: not set, use wget options)
- * adb\_triggerdelay => additional trigger delay in seconds before adblock processing starts (default: '2')
+ * adb\_dns => select the dns backend for your environment: 'dnsmasq', 'unbound', 'named', 'kresd' or 'dnscrypt-proxy' (default: 'dnsmasq')
+ * adb\_dnsdir => target directory for the generated blocklist 'adb_list.overall' (default: not set, use dns backend default)
+ * adb\_trigger => set the startup trigger to a certain interface, to 'timed' or to 'none' (default: 'wan')
+ * adb\_triggerdelay => additional trigger delay in seconds before adblock processing begins (default: '1')
+ * adb\_fetch => full path to a dedicated download utility, see example below (default: not set, use wget default)
+ * adb\_fetchparm => options for the download utility, see example below (default: not set, use wget default options)
* adb\_forcedns => force dns requests to local resolver (default: '0', disabled)
* adb\_forcesrt => force overall sort on low memory devices with less than 64 MB RAM (default: '0', disabled)
* adb\_manmode => do not automatically update block lists during startup, use backups instead (default: '0', disabled)
## Examples
-**change default dns backend to 'unbound':**
-<pre><code>
+**change default dns backend to 'unbound':**
+
Adblock deposits the sorted and filtered block list (adb_list.overall) in '/var/lib/unbound' where unbound can find them in its jail.
If you use manual configuration for unbound, then just include the following line in your 'server' clause:
-
+<pre><code>
include: "/var/lib/unbound/adb_list.overall"
</code></pre>
-**change default dns backend to 'bind':**
-<pre><code>
+**change default dns backend to 'named' (bind):**
+
Adblock deposits the sorted and filtered block list (adb_list.overall) in '/var/lib/bind' where bind can find them.
To use the block list please modify the following bind configuration files:
-
+<pre><code>
change '/etc/bind/named.conf', in the 'options' namespace add:
response-policy { zone "rpz"; };
$INCLUDE /var/lib/bind/adb_list.overall
</code></pre>
+**change default dns backend to 'kresd':**
+
+The knot-resolver (kresd) is only available on turris omnia devices. Currently there's no package for kresd in the official LEDE / OpenWrt package repository.
+Adblock deposits the sorted and filtered block list (adb_list.overall) in '/etc/kresd' where kresd can find them.
+To use the block list please create/modify the following kresd configuration files:
+<pre><code>
+TurrisOS > 3.6:
+ edit '/etc/config/resolver' and change / uncomment the following options:
+ forward_upstream '0'
+ list rpz_file '/etc/kresd/adb_list.overall'
+
+TurrisOS < 3.6:
+ edit '/etc/config/resolver' and change / uncomment the following options:
+ forward_upstream '0'
+ option include_config '/etc/kresd/custom.conf'
+
+ create '/etc/kresd/custom.conf' and add:
+ policy.add(policy.rpz(policy.DENY, '/etc/kresd/adb_list.overall'))
+ policy.add(policy.all(policy.FORWARD({'8.8.8.8', '8.8.4.4'})))
+</code></pre>
+
+**change default dns backend to 'dnscrypt-proxy':**
+
+Adblock deposits the sorted and filtered block list (adb_list.overall) by default in '/tmp' where DNSCrypt-Proxy can find them.
+The blacklist option is not supported by default, because DNSCrypt-Proxy is compiled without plugins support.
+Take a custom LEDE build with plugins support to use this feature:
+<pre><code>
+edit '/etc/config/dnscrypt-proxy' and add the following option per dnscrypt-proxy instance:
+ list blacklist 'domains:/tmp/adb_list.overall'
+</code></pre>
+
**configuration for different download utilities:**
<pre><code>
wget (default):
- option adb_fetch="/usr/bin/wget"
- option adb_fetchparm="--quiet --no-cache --no-cookies --max-redirect=0 --timeout=10 --no-check-certificate -O"
+ option adb_fetch '/usr/bin/wget'
+ option adb_fetchparm '--quiet --no-cache --no-cookies --max-redirect=0 --timeout=10 --no-check-certificate -O'
aria2c:
option adb_fetch '/usr/bin/aria2c'
<pre><code>
/etc/init.d/adblock status
::: adblock runtime information
- status : active
- adblock_version : 2.8.0
- blocked_domains : 122827
- fetch_info : wget (built-in)
- dns_backend : dnsmasq
- last_rundate : 26.06.2017 17:00:27
- system : LEDE Reboot SNAPSHOT r4434-b91a38d647
+ + adblock_status : enabled
+ + adblock_version : 3.0.0
+ + blocked_domains : 37406
+ + fetch_utility : wget (built-in)
+ + dns_backend : kresd (/etc/kresd)
+ + last_rundate : 08.09.2017 21:21:21
+ + system_release : OpenWrt omnia 15.05
</code></pre>
**cronjob for a regular block list update (/etc/crontabs/root):**
**query active block list for a certain (sub-)domain, e.g. for whitelisting:**
<pre><code>
/etc/init.d/adblock query example.www.doubleclick.net
-::: results for (sub-)domain 'example.www.doubleclick.net' (max. 5)
- - no match
-::: results for (sub-)domain 'www.doubleclick.net' (max. 5)
- - no match
-::: results for (sub-)domain 'doubleclick.net' (max. 5)
- + doubleclick.net
- + feedads.g.doubleclick.net
- + survey.g.doubleclick.net
+root@turris:~# /etc/init.d/adblock query example.www.doubleclick.net
+::: max. ten results for domain 'example.www.doubleclick.net'
+ - no match
+::: max. ten results for domain 'www.doubleclick.net'
+ - no match
+::: max. ten results for domain 'doubleclick.net'
+ + doubleclick.net
-The query function checks against the submitted (sub-)domain and recurses automatically to the upper top level domain(s).
-For every (sub-)domain it returns the first five relevant results.
+The query function checks against the submitted (sub-)domain and recurses automatically to the upper top level domain.
+For every (sub-)domain it returns the first ten relevant results.
In the example above whitelist "doubleclick.net" to free the submitted domain.
</code></pre>
# see 'https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md'
config adblock 'global'
- option adb_enabled '1'
+ option adb_enabled '0'
option adb_debug '0'
option adb_forcesrt '0'
option adb_forcedns '0'
- option adb_iface 'wan'
- option adb_triggerdelay '2'
+ option adb_dns 'dnsmasq'
+ option adb_trigger 'wan'
option adb_whitelist '/etc/adblock/adblock.whitelist'
option adb_whitelist_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\"^\"\$1\"\\\|[.]\"\$1)}'
option adb_backup '0'
option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
option adb_src_desc 'focus on chinese ads, daily updates, approx. 1.600 entries'
+config source 'reg_id'
+ option enabled '0'
+ option adb_src 'https://easylist-downloads.adblockplus.org/abpindo+easylist.txt'
+ option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
+ option adb_src_desc 'focus on indonesian ads plus generic easylist additions, weekly updates, approx. 800 entries'
+
+config source 'reg_nl'
+ option enabled '0'
+ option adb_src 'https://easylist-downloads.adblockplus.org/easylistdutch+easylist.txt'
+ option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
+ option adb_src_desc 'focus on dutch ads plus generic easylist additions, weekly updates, approx. 1300 entries'
+
config source 'reg_pl'
option enabled '0'
option adb_src 'http://adblocklist.org/adblock-pxf-polish.txt'
#!/bin/sh /etc/rc.common
#
-START=50
+START=30
USE_PROCD=1
EXTRA_COMMANDS="suspend resume query status"
boot()
{
adb_boot=1
- ubus -t 30 wait_for network.interface 2>/dev/null
rc_procd start_service
}
then
if [ -n "${adb_boot}" ]
then
- return 0
+ local trigger="$(uci_get adblock.global.adb_trigger)"
+ if [ "${trigger}" != "timed" ]
+ then
+ return 0
+ fi
fi
procd_open_instance "adblock"
procd_set_param command "${adb_script}" "${@}"
service_triggers()
{
- local iface="$(uci -q get adblock.global.adb_iface)"
- local delay="$(uci -q get adblock.global.adb_triggerdelay)"
+ local trigger="$(uci_get adblock.global.adb_trigger)"
+ local delay="$(uci_get adblock.global.adb_triggerdelay)"
- PROCD_RELOAD_DELAY=$((${delay:=2} * 1000))
- for name in ${iface}
- do
- procd_add_interface_trigger "interface.*.up" "${name}" "${adb_init}" start
- done
- PROCD_RELOAD_DELAY=1000
- procd_add_config_trigger "config.change" "adblock" "${adb_init}" start
+ if [ "${trigger}" != "none" ] && [ "${trigger}" != "timed" ]
+ then
+ PROCD_RELOAD_DELAY=$((${delay:=1} * 1000))
+ procd_add_interface_trigger "interface.*.up" "${trigger}" "${adb_init}" start
+ fi
+ procd_add_reload_trigger "adblock"
}
#
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-adb_ver="2.8.3"
-adb_sysver="$(ubus -S call system board | jsonfilter -e '@.release.description')"
-adb_enabled=1
+adb_ver="3.0.2"
+adb_sysver="unknown"
+adb_enabled=0
adb_debug=0
-adb_minfree=2
adb_manmode=0
adb_forcesrt=0
adb_forcedns=0
+adb_triggerdelay=0
adb_backup=0
adb_backupdir="/mnt"
-adb_whitelist="/etc/adblock/adblock.whitelist"
-adb_whitelist_rset="\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\"^\"\$1\"\\\|[.]\"\$1)}"
adb_fetch="/usr/bin/wget"
adb_fetchparm="--quiet --no-cache --no-cookies --max-redirect=0 --timeout=10 --no-check-certificate -O"
-adb_dnslist="dnsmasq unbound named"
+adb_dns="dnsmasq"
adb_dnsprefix="adb_list"
adb_dnsfile="${adb_dnsprefix}.overall"
adb_rtfile="/tmp/adb_runtime.json"
-adb_sources=""
-adb_src_cat_shalla=""
-adb_action="${1}"
+adb_action="${1:-"start"}"
+adb_cnt=0
+adb_rc=0
# f_envload: load adblock environment
#
f_envload()
{
- local services dns_up cnt=0
+ local dns_up sys_call sys_desc sys_model sys_ver cnt=0
+
+ # get system information
+ #
+ sys_call="$(ubus -S call system board 2>/dev/null)"
+ if [ -n "${sys_call}" ]
+ then
+ sys_desc="$(printf '%s' "${sys_call}" | jsonfilter -e '@.release.description')"
+ sys_model="$(printf '%s' "${sys_call}" | jsonfilter -e '@.model')"
+ sys_ver="$(cat /etc/turris-version 2>/dev/null)"
+ if [ -n "${sys_ver}" ]
+ then
+ sys_desc="${sys_desc}/${sys_ver}"
+ fi
+ adb_sysver="${sys_model}, ${sys_desc}"
+ fi
# source in system libraries
#
config_load adblock
config_foreach parse_config source
- # set dns backend environment
+ # set/check dns backend environment
#
- while [ ${cnt} -le 20 ]
+ case "${adb_dns}" in
+ dnsmasq)
+ adb_dnsuser="${adb_dns}"
+ adb_dnsdir="${adb_dnsdir:-"/tmp/dnsmasq.d"}"
+ adb_dnsformat="awk '{print \"local=/\"\$0\"/\"}'"
+ ;;
+ unbound)
+ adb_dnsuser="${adb_dns}"
+ adb_dnsdir="${adb_dnsdir:-"/var/lib/unbound"}"
+ adb_dnsformat="awk '{print \"local-zone: \042\"\$0\"\042 static\"}'"
+ ;;
+ named)
+ adb_dnsuser="bind"
+ adb_dnsdir="${adb_dnsdir:-"/var/lib/bind"}"
+ adb_dnsformat="awk '{print \"\"\$0\" IN CNAME .\n*.\"\$0\" IN CNAME .\"}'"
+ ;;
+ kresd)
+ adb_dnsuser="root"
+ adb_dnsdir="${adb_dnsdir:-"/etc/kresd"}"
+ adb_dnsformat="awk '{print \"\"\$0\" CNAME .\n*.\"\$0\" CNAME .\"}'"
+ adb_dnsheader="\$TTL 2h"$'\n'"@ IN SOA localhost. root.localhost. (2 6h 1h 1w 2h)"$'\n'" IN NS localhost."
+ ;;
+ dnscrypt-proxy)
+ adb_dnsuser="nobody"
+ adb_dnsdir="${adb_dnsdir:-"/tmp"}"
+ adb_dnsformat="awk '{print \$0}'"
+ ;;
+ esac
+
+ if [ -d "${adb_dnsdir}" ] && [ ! -f "${adb_dnsdir}/${adb_dnsfile}" ]
+ then
+ > "${adb_dnsdir}/${adb_dnsfile}"
+ fi
+
+ case "${adb_action}" in
+ start|restart|reload)
+ > "${adb_rtfile}"
+ if [ "${adb_action}" = "start" ] && [ "${adb_trigger}" = "timed" ]
+ then
+ sleep ${adb_triggerdelay}
+ fi
+ ;;
+ esac
+
+ while [ ${cnt} -le 30 ]
do
- services="$(ubus -S call service list 2>/dev/null)"
- if [ -n "${services}" ]
+ dns_up="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}" 2>/dev/null | jsonfilter -l1 -e "@[\"${adb_dns}\"].instances.*.running" 2>/dev/null)"
+ if [ "${dns_up}" = "true" ]
then
- for dns in ${adb_dnslist}
- do
- dns_up="$(printf "%s" "${services}" | jsonfilter -l1 -e "@.${dns}.instances.*.running")"
- if [ "${dns_up}" = "true" ]
- then
- case "${dns}" in
- dnsmasq)
- adb_dns="${dns}"
- adb_dnsdir="${adb_dnsdir:="/tmp/dnsmasq.d"}"
- adb_dnshidedir="${adb_dnsdir}/.adb_hidden"
- adb_dnsformat="awk '{print \"local=/\"\$0\"/\"}'"
- break 2
- ;;
- unbound)
- adb_dns="${dns}"
- adb_dnsdir="${adb_dnsdir:="/var/lib/unbound"}"
- adb_dnshidedir="${adb_dnsdir}/.adb_hidden"
- adb_dnsformat="awk '{print \"local-zone: \042\"\$0\"\042 static\"}'"
- break 2
- ;;
- named)
- adb_dns="${dns}"
- adb_dnsdir="${adb_dnsdir:="/var/lib/bind"}"
- adb_dnshidedir="${adb_dnsdir}/.adb_hidden"
- adb_dnsformat="awk '{print \"\"\$0\" IN CNAME .\n*.\"\$0\" IN CNAME .\"}'"
- break 2
- ;;
- esac
- fi
- done
+ break
fi
sleep 1
cnt=$((cnt+1))
done
+
if [ -z "${adb_dns}" ] || [ -z "${adb_dnsformat}" ] || [ ! -x "$(command -v ${adb_dns})" ] || [ ! -d "${adb_dnsdir}" ]
then
- f_log "error" "no active/supported DNS backend found"
+ f_log "error" "'${adb_dns}' not running, DNS backend not found"
fi
# force dns to local resolver
f_rmdns
f_dnsrestart
fi
+ f_jsnupdate
f_log "info " "adblock is currently disabled, please set adb_enabled to '1' to use this service"
exit 0
fi
if [ "$(readlink -fn "${adb_fetch}")" = "/usr/bin/wget-nossl" ]
then
adb_fetchparm="--quiet --no-cache --no-cookies --max-redirect=0 --timeout=10 -O"
- elif [ "$(readlink -fn "/bin/wget")" = "/bin/busybox" ] || [ "$(readlink -fn "${adb_fetch}")" = "/bin/busybox" ]
+ elif [ "$(readlink -fn "${adb_fetch}")" = "/bin/busybox" ] ||
+ ([ "$(readlink -fn "/bin/wget")" = "/bin/busybox" ] && [ "$(readlink -fn "${adb_fetch}")" != "/usr/bin/wget" ])
then
adb_fetch="/bin/busybox"
adb_fetchparm="-q -O"
fi
adb_fetchinfo="${adb_fetch##*/} (${ssl_lib})"
- # create dns hideout directory
- #
- if [ ! -d "${adb_dnshidedir}" ]
- then
- mkdir -p -m 660 "${adb_dnshidedir}"
- chown -R "${adb_dns}":"${adb_dns}" "${adb_dnshidedir}" 2>/dev/null
- else
- rm -f "${adb_dnshidedir}/${adb_dnsprefix}"*
- fi
-
# create adblock temp file/directory
#
adb_tmpload="$(mktemp -tu)"
# prepare whitelist entries
#
- if [ -s "${adb_whitelist}" ]
+ if [ -s "${adb_whitelist}" ] && [ -n "${adb_whitelist_rset}" ]
then
awk "${adb_whitelist_rset}" "${adb_whitelist}" > "${adb_tmpdir}/tmp.whitelist"
fi
{
if [ -n "${adb_dns}" ]
then
- rm -f "${adb_dnsdir}/${adb_dnsprefix}"*
- rm -f "${adb_backupdir}/${adb_dnsprefix}"*.gz
- rm -rf "${adb_dnshidedir}"
+ > "${adb_dnsdir}/${adb_dnsfile}"
> "${adb_rtfile}"
+ rm -f "${adb_dnsdir}/.${adb_dnsfile}"
+ rm -f "${adb_backupdir}/${adb_dnsprefix}"*.gz
fi
}
#
f_dnsrestart()
{
- local dns_up mem_free cnt=0
+ local dns_up cnt=0
"/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
while [ ${cnt} -le 10 ]
do
- dns_up="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}" | jsonfilter -l1 -e "@.${adb_dns}.instances.*.running")"
+ dns_up="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}" | jsonfilter -l1 -e "@[\"${adb_dns}\"].instances.*.running")"
if [ "${dns_up}" = "true" ]
then
- mem_free="$(awk '/^MemFree/ {print int($2/1000)}' "/proc/meminfo")"
- if [ ${mem_free} -ge ${adb_minfree} ]
- then
- return 0
- fi
+ return 0
fi
cnt=$((cnt+1))
sleep 1
fi
adb_rc=${?}
;;
+ merge)
+ if [ -s "${adb_tmpfile}" ]
+ then
+ cat "${adb_tmpfile}" >> "${adb_tmpdir}/${adb_dnsfile}"
+ adb_rc=${?}
+ fi
+ ;;
format)
if [ -s "${adb_tmpdir}/tmp.whitelist" ]
then
- grep -vf "${adb_tmpdir}/tmp.whitelist" "${adb_tmpfile}" | eval "${adb_dnsformat}" >> "${adb_tmpdir}/${adb_dnsfile}"
+ grep -vf "${adb_tmpdir}/tmp.whitelist" "${adb_tmpdir}/${adb_dnsfile}" | eval "${adb_dnsformat}" > "${adb_dnsdir}/${adb_dnsfile}"
else
- eval "${adb_dnsformat}" "${adb_tmpfile}" >> "${adb_tmpdir}/${adb_dnsfile}"
+ eval "${adb_dnsformat}" "${adb_tmpdir}/${adb_dnsfile}" > "${adb_dnsdir}/${adb_dnsfile}"
+ fi
+ if [ -n "${adb_dnsheader}" ]
+ then
+ printf '%s\n' "${adb_dnsheader}" | cat - "${adb_dnsdir}/${adb_dnsfile}" > "${adb_tmpdir}/${adb_dnsfile}"
+ cat "${adb_tmpdir}/${adb_dnsfile}" > "${adb_dnsdir}/${adb_dnsfile}"
fi
adb_rc=${?}
;;
f_log "debug" "name: ${src_name}, mode: ${mode}, count: ${cnt}, in_rc: ${in_rc}, out_rc: ${adb_rc}"
}
+# f_tldcompression: top level domain compression
+#
+f_tldcompression()
+{
+ local source="${1}" temp="${adb_tmpload}"
+
+ awk -F "." '{for(f=NF;f > 1;f--) printf "%s.", $f;print $1}' "${source}" 2>/dev/null | sort -u > "${temp}"
+ awk '{if(NR==1){tld=$NF};while(getline){if($NF !~ tld"\\."){print tld;tld=$NF}}print tld}' "${temp}" 2>/dev/null > "${source}"
+ awk -F "." '{for(f=NF;f > 1;f--) printf "%s.", $f;print $1}' "${source}" 2>/dev/null > "${temp}"
+ sort -u "${temp}" > "${source}"
+}
+
# f_switch: suspend/resume adblock processing
#
f_switch()
{
local source target status mode="${1}"
- if [ -d "${adb_dnshidedir}" ]
+ if [ -s "${adb_dnsdir}/${adb_dnsfile}" ] && [ "${mode}" = "suspend" ]
then
- if [ -s "${adb_dnsdir}/${adb_dnsfile}" ] && [ "${mode}" = "suspend" ]
- then
- source="${adb_dnsdir}/${adb_dnsfile}"
- target="${adb_dnshidedir}"
- status="suspended"
- elif [ -s "${adb_dnshidedir}/${adb_dnsfile}" ] && [ "${mode}" = "resume" ]
- then
- source="${adb_dnshidedir}/${adb_dnsfile}"
- target="${adb_dnsdir}"
- status="resumed"
- fi
- if [ -n "${status}" ]
- then
- mv -f "${source}"* "${target}"
- f_dnsrestart
- f_log "info " "adblock processing ${status}"
- fi
+ source="${adb_dnsdir}/${adb_dnsfile}"
+ target="${adb_dnsdir}/.${adb_dnsfile}"
+ status="suspended"
+ elif [ -s "${adb_dnsdir}/.${adb_dnsfile}" ] && [ "${mode}" = "resume" ]
+ then
+ source="${adb_dnsdir}/.${adb_dnsfile}"
+ target="${adb_dnsdir}/${adb_dnsfile}"
+ status="resumed"
+ fi
+ if [ -n "${status}" ]
+ then
+ cat "${source}" > "${target}"
+ > "${source}"
+ f_dnsrestart
+ f_jsnupdate
+ f_log "info " "adblock processing ${status}"
fi
}
printf "%s\n" "::: no active block list found, please start / resume adblock first"
elif [ -z "${domain}" ] || [ "${domain}" = "${tld}" ]
then
- printf "%s\n" "::: invalid domain input, please submit a specific (sub-)domain, e.g. 'www.abc.xyz'"
+ printf "%s\n" "::: invalid domain input, please submit a single domain, e.g. 'doubleclick.net'"
else
cd "${adb_dnsdir}"
while [ "${domain}" != "${tld}" ]
do
search="${domain//./\.}"
- result="$(grep -Hm5 "[/\"\.]${search}[/\"]" "${adb_dnsfile}" | awk -F ':|=|/|\"' '{printf(" + %s\n",$4)}')"
- printf "%s\n" "::: results for (sub-)domain '${domain}' (max. 5)"
- printf "%s\n" "${result:=" - no match"}"
+ if [ "${adb_dns}" = "dnsmasq" ] || [ "${adb_dns}" = "unbound" ]
+ then
+ result="$(awk -F '/|\"' "/[\/\"\.]${search}/{i++;{printf(\" + %s\n\",\$2)};if(i>9){exit}}" "${adb_dnsfile}")"
+ else
+ result="$(awk "/(^[^\*][a-z]*[\.]+${search}|^${search})/{i++;{printf(\" + %s\n\",\$1)};if(i>9){exit}}" "${adb_dnsfile}")"
+ fi
+ printf "%s\n" "::: max. ten results for domain '${domain}'"
+ printf "%s\n" "${result:-" - no match"}"
domain="${tld}"
tld="${domain#*.}"
done
fi
}
+# f_jsnupdate: update runtime information
+#
+f_jsnupdate()
+{
+ local status rundate="$(/bin/date "+%d.%m.%Y %H:%M:%S")"
+
+ if [ ${adb_rc} -gt 0 ]
+ then
+ status="error"
+ elif [ ${adb_enabled} -ne 1 ]
+ then
+ status="disabled"
+ elif [ -s "${adb_dnsdir}/.${adb_dnsfile}" ]
+ then
+ status="paused"
+ else
+ status="enabled"
+ if [ -s "${adb_dnsdir}/${adb_dnsfile}" ]
+ then
+ if [ "${adb_dns}" = "named" ] || [ "${adb_dns}" = "kresd" ]
+ then
+ adb_cnt="$(( ( $(wc -l < "${adb_dnsdir}/${adb_dnsfile}") - $(printf "%s" "${adb_dnsheader}" | grep -c "^") ) / 2 ))"
+ else
+ adb_cnt="$(( $(wc -l < "${adb_dnsdir}/${adb_dnsfile}") - $(printf "%s" "${adb_dnsheader}" | grep -c "^") ))"
+ fi
+ fi
+ fi
+
+ if [ -z "${adb_fetchinfo}" ] && [ -s "${adb_rtfile}" ]
+ then
+ json_load "$(cat "${adb_rtfile}" 2>/dev/null)"
+ json_select data
+ json_get_var adb_fetchinfo "fetch_utility"
+ fi
+
+ json_init
+ json_add_object "data"
+ json_add_string "adblock_status" "${status}"
+ json_add_string "adblock_version" "${adb_ver}"
+ json_add_string "blocked_domains" "${adb_cnt}"
+ json_add_string "fetch_utility" "${adb_fetchinfo}"
+ json_add_string "dns_backend" "${adb_dns} (${adb_dnsdir})"
+ json_add_string "last_rundate" "${rundate}"
+ json_add_string "system_release" "${adb_sysver}"
+ json_close_object
+ json_dump > "${adb_rtfile}"
+}
+
# f_status: output runtime information
#
f_status()
if [ -s "${adb_rtfile}" ]
then
- if [ -s "${adb_dnsdir}/${adb_dnsfile}" ]
- then
- value="active"
- else
- value="no domains blocked"
- fi
printf "%s\n" "::: adblock runtime information"
- printf " %-15s : %s\n" "status" "${value}"
json_load "$(cat "${adb_rtfile}" 2>/dev/null)"
json_select data
json_get_keys keylist
for key in ${keylist}
do
json_get_var value "${key}"
- printf " %-15s : %s\n" "${key}" "${value}"
+ printf " + %-15s : %s\n" "${key}" "${value}"
done
fi
}
f_rmdns
f_dnsrestart
fi
+ adb_rc=1
+ f_jsnupdate
exit 1
fi
fi
#
f_main()
{
- local src_name src_rset shalla_archive enabled url hash_old hash_new cnt=0
+ local src_name src_rset shalla_archive enabled url hash_old hash_new
local mem_total="$(awk '/^MemTotal/ {print int($2/1000)}' "/proc/meminfo")"
f_log "info " "start adblock processing ..."
continue
fi
- # manual mode
+ # manual / backup mode
#
- if [ ${adb_manmode} -eq 1 ] && [ -z "${adb_action}" ] && [ "${src_name}" != "blacklist" ]
+ if [ ${adb_manmode} -eq 1 ] && [ "${adb_action}" = "start" ] && [ "${src_name}" != "blacklist" ]
then
f_list restore
if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
then
- f_list format
+ f_list merge
continue
fi
fi
adb_rc=${?}
fi
- # check download result and prepare domain output (incl. tld compression, list backup & restore)
+ # check download result and prepare list output (incl. tld compression, list backup & restore)
#
if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpload}" ]
then
awk "${src_rset}" "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
if [ -s "${adb_tmpfile}" ]
then
- awk -F "." '{for(f=NF;f > 1;f--) printf "%s.", $f;print $1}' "${adb_tmpfile}" 2>/dev/null | sort -u > "${adb_tmpload}"
- awk '{if(NR==1){tld=$NF};while(getline){if($NF !~ tld"\\."){print tld;tld=$NF}}print tld}' "${adb_tmpload}" 2>/dev/null > "${adb_tmpfile}"
- awk -F "." '{for(f=NF;f > 1;f--) printf "%s.", $f;print $1}' "${adb_tmpfile}" 2>/dev/null > "${adb_tmpload}"
- mv -f "${adb_tmpload}" "${adb_tmpfile}"
- f_list backup
+ f_tldcompression "${adb_tmpfile}"
+ if [ "${src_name}" != "blacklist" ]
+ then
+ f_list backup
+ fi
else
f_list restore
fi
f_list restore
fi
- # remove whitelist domains, final list preparation
+ # list merge
#
if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
then
- f_list format
+ f_list merge
if [ ${adb_rc} -ne 0 ]
then
f_list remove
fi
done
- # hash preparation and overall sort
+ # hash preparation, whitelist removal and overall sort
#
if [ -f "${adb_dnsdir}/${adb_dnsfile}" ]
then
- hash_old="$(sha256sum "${adb_dnsdir}/${adb_dnsfile}" | awk '{print $1}')"
+ hash_old="$(sha256sum "${adb_dnsdir}/${adb_dnsfile}" 2>/dev/null | awk '{print $1}')"
fi
if [ -s "${adb_tmpdir}/${adb_dnsfile}" ]
then
if [ ${mem_total} -ge 64 ] || [ ${adb_forcesrt} -eq 1 ]
then
- sort -u "${adb_tmpdir}/${adb_dnsfile}" > "${adb_dnsdir}/${adb_dnsfile}"
- else
- mv -f "${adb_tmpdir}/${adb_dnsfile}" "${adb_dnsdir}" 2>/dev/null
+ f_tldcompression "${adb_tmpdir}/${adb_dnsfile}"
fi
+ f_list format
else
> "${adb_dnsdir}/${adb_dnsfile}"
fi
- hash_new="$(sha256sum "${adb_dnsdir}/${adb_dnsfile}" | awk '{print $1}')"
- cnt="$(wc -l < "${adb_dnsdir}/${adb_dnsfile}")"
+ chown "${adb_dnsuser}" "${adb_dnsdir}/${adb_dnsfile}" 2>/dev/null
+ f_rmtemp
# conditional restart of the dns backend and runtime information export
#
- chown "${adb_dns}":"${adb_dns}" "${adb_dnsdir}/${adb_dnsfile}" 2>/dev/null
- f_rmtemp
- if [ "${hash_old}" != "${hash_new}" ]
+ hash_new="$(sha256sum "${adb_dnsdir}/${adb_dnsfile}" 2>/dev/null | awk '{print $1}')"
+ if [ -z "${hash_old}" ] || [ -z "${hash_new}" ] || [ "${hash_old}" != "${hash_new}" ]
then
f_dnsrestart
fi
if [ ${?} -eq 0 ]
then
- json_init
- json_add_object "data"
- json_add_string "adblock_version" "${adb_ver}"
- json_add_string "blocked_domains" "${cnt}"
- json_add_string "fetch_info" "${adb_fetchinfo}"
- json_add_string "dns_backend" "${adb_dns}"
- json_add_string "last_rundate" "$(/bin/date "+%d.%m.%Y %H:%M:%S")"
- json_add_string "system" "${adb_sysver}"
- json_close_object
- json_dump > "${adb_rtfile}"
- f_log "info " "block list with overall ${cnt} domains loaded successfully (${adb_sysver})"
+ f_jsnupdate "${adb_cnt}"
+ f_log "info " "block list with overall ${adb_cnt} domains loaded successfully (${adb_sysver})"
else
f_log "error" "dns backend restart with active block list failed"
fi
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-master.tar.gz
PKG_SOURCE_URL:=https://github.com/fln/addrwatch/releases/download/$(PKG_VERSION)/
-PKG_MD5SUM:=8f401415be993005fa5fb58a05e14295
+PKG_HASH:=0455bd8d2e18a793e1182712bf4df3e54a5b7575f82f5b79b60deef19ff93df8
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-master
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://ftp.isc.org/isc/aggregate/
-PKG_MD5SUM:=6fcc515388bf2c5b0c8f9f733bfee7e1
+PKG_HASH:=166503005cd8722c730e530cc90652ddfa198a25624914c65dffc3eb87ba5482
PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
PKG_LICENSE:=ISC
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://download.aircrack-ng.org/ \
http://archive.aircrack-ng.org/aircrack-ng/$(PKG_VERSION)/
-PKG_MD5SUM:=c2f8648c92f7e46051c86c618d4fb0d5
+PKG_HASH:=cf3134521e1c3d7aed4e384e3e5e7b6959e2d485bd1554474608a3a9328e35fd
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_SOURCE_VERSION:=1368525c7305ca5bb4134242f332344f5f7e94e3
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_MIRROR_HASH:=247059922197db04e78c2845974d3dc2fc95a0624a0e0da32b5a13fd86a59d1b
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_PARALLEL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=apache
-PKG_VERSION:=2.4.25
+PKG_VERSION:=2.4.27
PKG_RELEASE:=1
PKG_SOURCE_NAME:=httpd
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@APACHE/httpd/
-PKG_MD5SUM:=2826f49619112ad5813c0be5afcc7ddb
+PKG_HASH:=71fcc128238a690515bd8174d5330a5309161ef314a326ae45c7c15ed139c13a
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
define Package/apache
$(call Package/apache/Default)
- DEPENDS:=+libapr +libaprutil +libpcre +libopenssl +unixodbc
+ DEPENDS:=+libapr +libaprutil +libpcre +libopenssl +unixodbc +zlib
endef
define Package/apache/description
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/apcupsd
-PKG_MD5SUM:=cc8f5ced77f38906a274787acb9bc980
+PKG_HASH:=db7748559b6b4c3784f9856561ef6ac6199ef7bd019b3edcd7e0a647bf8f9867
PKG_BUILD_DEPENDS:=libgd
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=c7da72f7ec26eedd7fd8d224c0e10787b204f94e
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=c6739bef32568877ad63dbfa8e34b617a287e225a0344d4c41ba891e1f25d487
PKG_MAINTAINER:=Alex Samorukov <samm@os2.kiev.ua>
PKG_LICENSE:= GPL-2.0
bool "OpenSSL"
config ARIA2_GNUTLS
- bool "GNUTLS"
+ bool "GnuTLS"
config ARIA2_NOSSL
bool "No SSL Support"
endchoice
+choice
+ prompt "Crypto Library"
+ depends on !ARIA2_OPENSSL
+ default ARIA2_NOCRYPOTLIB
+
+config ARIA2_NETTLE
+ bool "Nettle"
+
+config ARIA2_LIBGCRYPT
+ bool "Libgcrypt"
+
+config ARIA2_NOCRYPTO
+ bool "No Crypto Library"
+
+endchoice
+
+choice
+ prompt "XML Library"
+ default ARIA2_NOXML
+
+config ARIA2_LIBXML2
+ bool "Libxml2"
+
+config ARIA2_EXPAT
+ bool "Expat"
+
+config ARIA2_NOXML
+ bool "No XML Library"
+
+endchoice
+
+config ARIA2_GMP
+ bool "GNU Multiple Precision Arithmetic Library"
+ depends on ARIA2_NETTLE
+ default n
+
config ARIA2_BITTORRENT
bool "Enable Bittorrent Support"
- depends on ARIA2_OPENSSL
+ depends on ARIA2_OPENSSL || ARIA2_LIBGCRYPT || \
+ (ARIA2_NETTLE && ARIA2_GMP)
+ default y
+
+config ARIA2_METALINK
+ bool "Enable Metalink Support"
+ depends on !ARIA2_NOXML
default n
config ARIA2_SFTP
- bool "Enable SFTP Support"
- default n
+ bool "Enable SFTP Support"
+ default n
config ARIA2_ASYNC_DNS
bool "Enable Async DNS Support"
bool "Enable Firefox3/Chromium Cookie Support"
default n
-config ARIA2_METALINK
- bool "Enable Metalink Support"
- default n
-
-choice
- prompt "XML Library"
- default ARIA2_LIBXML2
- depends on ARIA2_METALINK
-
-config ARIA2_LIBXML2
- bool "LIBXML2"
-
-config ARIA2_EXPAT
- bool "EXPAT"
-
-endchoice
+config ARIA2_WEBSOCKET
+ bool "Enable JSON-RPC over WebSocket Support"
+ depends on ARIA2_OPENSSL || ARIA2_LIBGCRYPT || ARIA2_NETTLE
+ default y
endmenu
PKG_NAME:=aria2
PKG_VERSION:=1.32.0
-PKG_RELEASE:=1
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/aria2/aria2/releases/download/release-$(PKG_VERSION)/
PKG_HASH:=546e9194a9135d665fce572cb93c88f30fb5601d113bfa19951107ced682dc50
PKG_INSTALL:=1
-PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>, Hsing-Wang Liao <kuoruan@gmail.com>
+PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>, \
+ Hsing-Wang Liao <kuoruan@gmail.com>
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=COPYING
PKG_CONFIG_DEPENDS := \
- ARIA2_NOSSL \
- ARIA2_OPENSSL \
- ARIA2_GNUTLS \
- ARIA2_BITTORRENT \
- ARIA2_SFTP \
- ARIA2_ASYNC_DNS \
- ARIA2_COOKIE \
- ARIA2_METALINK \
- ARIA2_EXPAT \
- ARIA2_LIBXML2
+ CONFIG_ARIA2_NOSSL \
+ CONFIG_ARIA2_OPENSSL \
+ CONFIG_ARIA2_GNUTLS \
+ CONFIG_ARIA2_NOCRYPTO \
+ CONFIG_ARIA2_NETTLE \
+ CONFIG_ARIA2_LIBGCRYPT \
+ CONFIG_ARIA2_LIBXML2 \
+ CONFIG_ARIA2_EXPAT \
+ CONFIG_ARIA2_GMP \
+ CONFIG_ARIA2_BITTORRENT \
+ CONFIG_ARIA2_METALINK \
+ CONFIG_ARIA2_SFTP \
+ CONFIG_ARIA2_ASYNC_DNS \
+ CONFIG_ARIA2_COOKIE \
+ CONFIG_ARIA2_WEBSOCKET
include $(INCLUDE_DIR)/package.mk
SUBMENU:=File Transfer
TITLE:=lightweight download utility
URL:=https://aria2.github.io/
- DEPENDS:=+zlib +libstdcpp +ARIA2_SFTP:libssh2 +ARIA2_ASYNC_DNS:libcares +ARIA2_COOKIE:libsqlite3 +ARIA2_LIBXML2:libxml2 +ARIA2_EXPAT:libexpat +ARIA2_OPENSSL:libopenssl +ARIA2_GNUTLS:libgnutls
+ DEPENDS:=+zlib +libstdcpp +ARIA2_OPENSSL:libopenssl +ARIA2_GNUTLS:libgnutls \
+ +ARIA2_NETTLE:libnettle +ARIA2_LIBGCRYPT:libgcrypt +ARIA2_GMP:libgmp \
+ +ARIA2_LIBXML2:libxml2 +ARIA2_EXPAT:libexpat +ARIA2_SFTP:libssh2 \
+ +ARIA2_ASYNC_DNS:libcares +ARIA2_COOKIE:libsqlite3
+ USERID:=aria2=6800:aria2=6800
endef
define Package/aria2/description
- aria2 is a lightweight multi-protocol & multi-source command-line download
- utility
+ aria2 is a lightweight multi-protocol & multi-source command-line download
+ utility
endef
CONFIGURE_ARGS += \
$(if $(CONFIG_ARIA2_NOSSL),--disable,--enable)-ssl \
$(if $(CONFIG_ARIA2_BITTORRENT),--enable,--disable)-bittorrent \
$(if $(CONFIG_ARIA2_METALINK),--enable,--disable)-metalink \
+ $(if $(CONFIG_ARIA2_WEBSOCKET),--enable,--disable)-websocket \
$(if $(CONFIG_ARIA2_OPENSSL),--with,--without)-openssl \
$(if $(CONFIG_ARIA2_GNUTLS),--with,--without)-gnutls \
+ $(if $(CONFIG_ARIA2_NETTLE),--with,--without)-libnettle \
+ $(if $(CONFIG_ARIA2_LIBGCRYPT),--with,--without)-libgcrypt \
+ $(if $(CONFIG_ARIA2_GMP),--with,--without)-libgmp \
+ $(if $(CONFIG_ARIA2_LIBXML2),--with,--without)-libxml2 \
+ $(if $(CONFIG_ARIA2_EXPAT),--with,--without)-libexpat \
$(if $(CONFIG_ARIA2_SFTP),--with,--without)-libssh2 \
$(if $(CONFIG_ARIA2_ASYNC_DNS),--with,--without)-libcares \
$(if $(CONFIG_ARIA2_COOKIE),--with,--without)-sqlite3 \
- $(if $(CONFIG_ARIA2_LIBXML2),--with,--without)-libxml2 \
- $(if $(CONFIG_ARIA2_EXPAT),--with,--without)-libexpat \
- --without-libnettle \
- --without-libgmp \
- --without-libgcrypt \
--without-libuv \
--with-libz
+# You can use most aria2 command-line options, replace '-' with '_'.
+# eg. 'rpc-secret' ==> 'rpc_secret'
+#
+# We do not support all options at this time. But you can add any option
+# with 'list extra_settings'.
+#
+# You can also add new config sections to define multi instance.
+#
config aria2 'main'
option enabled '0'
- option file_allocation 'none'
+ option user 'aria2'
+ option dir '/mnt/sda1/aria2'
+ option config_dir '/var/etc/aria2'
option bt_enable_lpd 'true'
option enable_dht 'true'
option follow_torrent 'true'
- option user 'root'
- option dir '/mnt/sda1/aria2'
+ option file_allocation 'none'
option save_session_interval '30'
+
+ # Add addition Headers here.
+ # eg. list header 'Content-Encoding: gzip'
+ list header ''
+
+ # Add BT trackers here.
+ # eg. list bt_tracker 'http://tracker.example.com/announce'
+ list bt_tracker ''
+
+ # Add extra settings here.
+ # eg. list extra_settings 'option=value'
+ list extra_settings ''
#!/bin/sh /etc/rc.common
-# Copyright (C) 2014-2016 nanpuyue <nanpuyue@gmail.com>
-# Copyright (C) 2016 kuoruan <kuoruan@gmail.com>
+# Copyright (C) 2016-2017 Hsing-wang Liao <kuoruan@gmail.com>
+# Licensed to the public under the Apache License 2.0.
START=99
-SERVICE_WRITE_PID=1
-SERVICE_DAEMONIZE=1
-
-
-append_params() {
- local p; local v; local s="$1"; shift
- for p in $*; do
- config_get v "$s" "$p"
- [ -n "$v" ] && (
- p=$(echo "$p" | sed -e 's|_|-|g');
- echo "$p=$v" >> $config_file
- )
+USE_PROCD=1
+
+NAME=aria2
+PROG=/usr/bin/aria2c
+
+_info() {
+ logger -p daemon.info -t "$NAME" "$*"
+}
+
+_err() {
+ logger -p daemon.err -t "$NAME" "$*"
+}
+
+_make_dir() {
+ local d
+ for d in "$@"; do
+ if [ ! -d "$d" ]; then
+ mkdir -p "$d" 2>/dev/null || return 1
+ fi
done
+
+ return 0
}
-section_enabled() {
- local result
- config_get_bool result "$1" 'enabled' 0
- [ $result -eq 1 ]
+_create_file() {
+ touch "$@" 2>/dev/null
}
-option_disabled() {
- local result
- config_get_bool result "$1" "$2" 1
- [ $result -eq 0 ]
+_change_owner() {
+ local u="$1"; shift
+
+ local d
+ for d in "$@"; do
+ if [ -f "$d" ]; then
+ chown "$u" "$d" 2>/dev/null || return 1
+ elif [ -d "$d" ]; then
+ chown -R "$u" "$d" 2>/dev/null || return 1
+ fi
+ done
+
+ return 0
}
-start_instance() {
+_change_file_mode() {
+ local mod="$1"; shift
+ chmod "$mod" "$@" 2>/dev/null
+}
+
+_reset_dir_mode() {
+ local d
+ for d in "$@"; do
+ if [ -d "$d" ]; then
+ find "$d" -type d -exec chmod 755 {} \; 2>/dev/null
+ find "$d" -type f -exec chmod 644 {} \; 2>/dev/null
+ fi
+ done
+}
+
+append_options() {
+ local o; local v
+ for o in "$@"; do
+ v="$(eval echo "\$$o")"
+ [ -n "$v" ] && \
+ echo "${o//_/-}=$v" >>"$config_file_tmp"
+ done
+}
+
+append_setting() {
local s="$1"
- local user
+ [ -n "$s" ] && \
+ echo "$s" >>"$config_file_tmp"
+}
+
+append_header() {
+ local h="$1"
+ [ -n "$h" ] && \
+ echo "header=\"${h}\"" >>"$config_file_tmp"
+}
+
+aria2_validate() {
+ uci_validate_section "$NAME" aria2 "$1" \
+ 'enabled:bool:0' \
+ 'enable_logging:bool' \
+ 'enable_proxy:bool' \
+ 'config_dir:string:/var/etc/aria2' \
+ 'user:string' \
+ 'all_proxy:string' \
+ 'all_proxy_passwd:string' \
+ 'all_proxy_user:string' \
+ 'auto_save_interval:range(0,600)' \
+ 'bt_enable_lpd:or("true","false")' \
+ 'bt_max_open_files:uinteger' \
+ 'bt_max_peers:uinteger' \
+ 'bt_remove_unselected_file:or("true","false")' \
+ 'bt_request_peer_speed_limit:string' \
+ 'bt_save_metadata:or("true","false")' \
+ 'bt_seed_unverified:or("true","false")' \
+ 'bt_stop_timeout:uinteger' \
+ 'bt_tracker:list(string)' \
+ 'ca_certificate:file' \
+ 'certificate:file' \
+ 'check_certificate:or("true","false"):true' \
+ 'connect_timeout:uinteger' \
+ 'dht_listen_port:string' \
+ 'dir:string' \
+ 'disable_ipv6:or("true","false")' \
+ 'disk_cache:string' \
+ 'enable_dht:or("true","false"):true' \
+ 'enable_dht6:or("true","false")' \
+ 'enable_peer_exchange:or("true","false")' \
+ 'event_poll:or("epoll","kqueue","port","poll","select")' \
+ 'file_allocation:or("none","prealloc","trunc","falloc")' \
+ 'follow_torrent:or("true","false","mem")' \
+ 'force_save:or("true","false")' \
+ 'http_accept_gzip:or("true","false")' \
+ 'http_no_cache:or("true","false")' \
+ 'listen_port:string' \
+ 'log:string' \
+ 'log_level:or("debug","info","notice","warn","error")' \
+ 'lowest_speed_limit:string' \
+ 'max_concurrent_downloads:uinteger' \
+ 'max_connection_per_server:uinteger' \
+ 'max_download_limit:string' \
+ 'max_overall_download_limit:string' \
+ 'max_overall_upload_limit:string' \
+ 'max_tries:uinteger' \
+ 'max_upload_limit:string' \
+ 'min_split_size:string' \
+ 'pause:or("true","false")' \
+ 'pause_metadata:or("true","false")' \
+ 'peer_id_prefix:string' \
+ 'private_key:file' \
+ 'retry_wait:uinteger' \
+ 'rpc_auth_method:or("none","user_pass","token")' \
+ 'rpc_certificate:file' \
+ 'rpc_listen_port:range(1024,65535)' \
+ 'rpc_passwd:string' \
+ 'rpc_private_key:file' \
+ 'rpc_secret:string' \
+ 'rpc_secure:or("true","false")' \
+ 'rpc_user:string' \
+ 'save_session_interval:uinteger' \
+ 'seed_ratio:ufloat' \
+ 'seed_time:ufloat' \
+ 'split:uinteger' \
+ 'timeout:uinteger' \
+ 'user_agent:string'
+}
- section_enabled "$s" || return 1
+aria2_start() {
+ local section="$1"
+ aria2_validate "$section" || { _err "Validation failed."; return 1; }
- config_get config_dir "$s" 'config_dir' '/var/etc/aria2'
- config_get dir "$s" 'dir'
- config_get user "$s" 'user'
+ [ "$enabled" = "1" ] || { _info "Instance \"${section}\" disabled."; return 1; }
+ [ -n "$dir" ] || { _err "Please set downlod dir."; return 1; }
+ [ -d "$dir" ] || { _err "Please create downlod dir first."; return 1; }
- config_file="$config_dir/aria2.conf"
- session_file="$config_dir/aria2.session"
- dht_file="$config_dir/dht.dat"
- log_file="$config_dir/aria2.log"
+ config_file="${config_dir}/${NAME}.conf.${section}"
+ config_file_tmp="${config_dir}/${NAME}.conf.tmp"
+ session_file="${config_dir}/${NAME}.session.${section}"
- [ -d "$config_dir" ] || {
- mkdir -m 0755 -p "$config_dir"
- touch "$config_file"
+ _make_dir "$config_dir" || {
+ _err "Can't create config dir: ${config_dir}"
+ return 1
}
- [ -d "$dir" ] || {
- mkdir -m 0755 -p "$dir" # create download dir
- touch "$dir"
+ _create_file "$session_file" "$config_file" "$config_file_tmp" || {
+ _err "Can't create files: ${session_file}, ${config_file}, ${config_file_tmp}"
+ return 1
}
- touch "$session_file" # create session file
+ # create tmp file
+ cat >"$config_file_tmp" <<-EOF
+ # Auto generated file, changes to this file will lost.
+ EOF
+
+ append_setting "dir=${dir}"
+ append_setting "enable-rpc=true"
+ append_setting "rpc-allow-origin-all=true"
+ append_setting "rpc-listen-all=true"
+ append_setting "quiet=true"
+ append_setting "continue=true"
+ append_setting "input-file=${session_file}"
+ append_setting "save-session=${session_file}"
+
+ if [ -z "$enable_logging" ]; then
+ append_options "log" "log_level"
+ elif [ "$enable_logging" = "1" ]; then
+ log=${log:-"/var/log/aria2.log"}
+
+ local log_dir
+ log_dir="$(dirname "$log")"
+
+ _make_dir "$log_dir" || {
+ _err "Can't create log dir: ${log_dir}"
+ return 1
+ }
- echo -e "enable-rpc=true\nrpc-allow-origin-all=true\nrpc-listen-all=true\nquiet=true" > $config_file
- echo -e "continue=true\ninput-file=$session_file\nsave-session=$session_file" >> $config_file
+ # create or clear log file
+ echo >"$log"
- option_disabled "$s" 'enable_dht' || echo "dht-file-path=$dht_file" >> $config_file
- option_disabled "$s" 'enable_log' || {
- [ -f "$log_file" ] && echo > $log_file # if log file exist, clear it
- echo -e "log=$log_file" >> $config_file
- }
+ append_setting "log=${log}"
+ append_options "log_level"
+ fi
+
+ if [ -z "$enable_proxy" ] || [ "$enable_proxy" = "1" ]; then
+ append_options "all_proxy" "all_proxy_user" "all_proxy_passwd"
+ fi
- # if user is set, change dir owner
- [ -z "$user" ] || {
- chown -R $user:$user $config_dir
- chown -R $user:$user $dir
+ unset_auth_method() {
+ uci -q batch <<-EOF
+ set ${NAME}.${section}.rpc_auth_method=""
+ commit $NAME
+ EOF
}
- append_params "$s" \
- file_allocation bt_enable_lpd enable_dht rpc_user rpc_passwd rpc_listen_port dir bt_tracker disk_cache \
- max_overall_download_limit max_overall_upload_limit max_download_limit max_upload_limit max_concurrent_downloads \
- max_connection_per_server min_split_size split save_session_interval follow_torrent listen_port bt_max_peers \
- peer_id_prefix user_agent rpc_secret log_level
-
- config_list_foreach "$s" extra_settings append_extrasettings
-
- SERVICE_UID="$user" \
- service_start /usr/bin/aria2c --conf-path="$config_file" # start service
-}
+ if [ -z "$rpc_auth_method" ]; then
+ if [ -n "$rpc_secret" ]; then
+ append_setting "rpc-secret=${rpc_secret}"
+ elif [ -n "$rpc_user" ]; then
+ append_setting "rpc-user=${rpc_user}"
+ append_setting "rcp-passwd=${rcp-passwd}"
+ else
+ _info "It is recommand to set RPC secret."
+ fi
+ elif [ "$rpc_auth_method" = "token" ]; then
+ if [ -n "$rpc_secret" ]; then
+ append_setting "rpc-secret=${rpc_secret}"
+ else
+ unset_auth_method
+ fi
+ elif [ "$rpc_auth_method" = "user_pass" ]; then
+ if [ -n "$rcp_user" ]; then
+ append_setting "rpc-user=${rpc_user}"
+ append_setting "rcp-passwd=${rcp-passwd}"
+ else
+ _info "Please set RPC user."
+ unset_auth_method
+ fi
+ fi
-append_extrasettings() {
- echo "$1" >> $config_file
-}
+ if [ ."$rpc_secure" = ."true" ] && [ -n "$rpc_certificate" ]; then
+ append_setting "rpc-secure=true"
+ append_options "rpc_certificate" "rpc_private_key"
+ fi
-start() {
- logger -t ARIA2C 'Starting aria2c service'
- config_load 'aria2'
- config_foreach start_instance 'aria2'
- return 0
-}
+ if [ ."$check_certificate" = ."true" ]; then
+ append_setting "check-certificate=true"
+ append_options "ca_certificate"
+ fi
-stop() {
- if [ -n "`pidof aria2c`" ]; then
- logger -t ARIA2C 'Shutting down aria2c service'
- service_stop /usr/bin/aria2c
+ if [ ."$enable_dht" = ."true" ]; then
+ dht_file="${config_dir}/dht.dat.${section}"
+ _create_file "$dht_file" || {
+ _err "Can't create DHT file: ${dht_file}"
+ return 1
+ }
+
+ append_setting "enable-dht=true"
+ append_setting "dht-file-path=${dht_file}"
fi
- return 0
+
+ if [ ."$enable_dht6" = ."true" ] && [ ."$disable_ipv6" != ."true" ]; then
+ dht6_file="${config_dir}/dht6.dat.${section}"
+ _create_file "$dht6_file" || {
+ _err "Can't create DHT6 file: ${dht6_file}"
+ return 1
+ }
+
+ append_setting "enable-dht6=true"
+ append_setting "dht-file-path6=${dht6_file}"
+ fi
+
+ if [ -n "$bt_tracker" ]; then
+ local bt_tracker_list; local t
+ for t in $bt_tracker; do
+ if [ -z "$bt_tracker_list" ]; then
+ bt_tracker_list="$t"
+ else
+ bt_tracker_list="${bt_tracker_list},${t}"
+ fi
+ done
+
+ append_setting "bt-tracker=${bt_tracker_list}"
+ fi
+
+ append_options "auto_save_interval" "bt_enable_lpd" "bt_max_open_files" "bt_max_peers" \
+ "bt_remove_unselected_file" "bt_request_peer_speed_limit" "bt_save_metadata" "bt_seed_unverified" \
+ "bt_stop_timeout" "certificate" "connect_timeout" "dht_listen_port" "disable_ipv6" "disk_cache" \
+ "enable_peer_exchange" "event_poll" "file_allocation" "follow_torrent" "force_save" "http_accept_gzip" \
+ "http_no_cache" "listen_port" "lowest_speed_limit" "max_concurrent_downloads" "max_connection_per_server" \
+ "max_download_limit" "max_overall_download_limit" "max_overall_upload_limit" "max_tries" \
+ "max_upload_limit" "min_split_size" "pause" "pause_metadata" "peer_id_prefix" "private_key" \
+ "retry_wait" "rpc_listen_port" "save_session_interval" "seed_ratio" "seed_time" "split" "timeout" \
+ "user_agent"
+
+ config_list_foreach "$section" "header" append_header
+ config_list_foreach "$section" "extra_settings" append_setting
+
+ sed '/^$/d' "$config_file_tmp" >"$config_file"
+ rm -f "$config_file_tmp"
+
+ _reset_dir_mode "$config_dir"
+ _change_file_mode 600 "$config_file"
+
+ if [ -n "$user" ]; then
+ if ( user_exists "$user" && _change_owner "$user" "$config_dir" "$log" ); then
+ _info "Aria2 will run with uer '${user}'."
+ if [ "$user" != "root" ]; then
+ _info "Please make sure user '${user}' has write access to downlod dir: ${dir}"
+ fi
+ else
+ _info "Set run user to '${user}' failed, default user will be used."
+ user=
+ fi
+ fi
+
+ procd_open_instance "${NAME}.${section}"
+ procd_set_param command "$PROG"
+ procd_append_param command --conf-path="${config_file}"
+
+ procd_set_param respawn
+ procd_set_param stdout 1
+ procd_set_param stderr 1
+
+ procd_set_param file "$config_file"
+ [ -n "$user" ] && \
+ procd_set_param user "$user"
+
+ procd_add_jail "${NAME}.${section}" log
+ procd_add_jail_mount "$config_file"
+ procd_add_jail_mount_rw "$dir" "$config_dir" "$log"
+ procd_close_instance
}
-restart() {
- logger -t ARIA2C 'Restarting aria2c service'
- stop
- sleep 2 # give time to shutdown
- start
+service_triggers() {
+ procd_add_reload_trigger "$NAME"
}
+start_service() {
+ config_load "$NAME"
+ config_foreach aria2_start "aria2"
+}
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=69b2f70588565385f3a61d9b1f100f01747cd5e1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=1cfb670ddd1763dbf5c712aaefe4d6c4f825011969e36484e6c442794324f721
PKG_FIXUP:=autoreconf
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=http://www.harding.motd.ca/autossh/
-PKG_MD5SUM:=f86684b96e99d22b2e9d35dc63b0aa29
+PKG_HASH:=9e8e10a59d7619176f4b986e256f776097a364d1be012781ea52e08d04679156
PKG_LICENSE:=0BSD
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE_PROTO:=git
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=6d5155ab347b731640495b1f0df6a4a849e84194d2ef0c2ec6af3879ee1aca2c
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-v$(PKG_VERSION)
PKG_HASH:=6d5155ab347b731640495b1f0df6a4a849e84194d2ef0c2ec6af3879ee1aca2c
include $(TOPDIR)/rules.mk
PKG_NAME:=bind
-PKG_VERSION:=9.10.5-P3
-PKG_RELEASE:=1
+PKG_VERSION:=9.11.2
+PKG_RELEASE:=2
USERID:=bind=57:bind=57
PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
PKG_SOURCE_URL:= \
http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) \
http://ftp.isc.org/isc/bind9/$(PKG_VERSION)
-PKG_HASH:=8d7e96b5b0bbac7b900d4c4bbb82e0956b4e509433c5fa392bb72a929b96606a
+PKG_HASH:=7f46ad8620f7c3b0ac375d7a5211b15677708fda84ce25d7aeb7222fe2e3c77a
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
PKG_USE_MIPS16:=0
PKG_CONFIG_DEPENDS := \
- CONFIG_OPENSSL_WITH_EC \
CONFIG_BIND_ENABLE_FILTER_AAAA
include $(INCLUDE_DIR)/package.mk
define Package/bind/Default
SECTION:=net
CATEGORY:=Network
- DEPENDS:=+bind-libs
+ DEPENDS:=+bind-libs +@OPENSSL_WITH_EC
TITLE:=bind
URL:=https://www.isc.org/software/bind
SUBMENU:=IP Addresses and Names
define Package/bind-libs
SECTION:=libs
CATEGORY:=Libraries
- DEPENDS:=+libopenssl
+ DEPENDS:=+libopenssl +zlib
TITLE:=bind shared libraries
URL:=https://www.isc.org/software/bind
endef
define Package/bind-server
$(call Package/bind/Default)
TITLE+= DNS server
+ DEPENDS+= +@OPENSSL_WITH_DEPRECATED
endef
define Package/bind-server/config
--with-libjson=no \
--with-libtool \
--with-libxml2=no \
+ --without-lmdb \
--enable-epoll=yes \
--with-gost=no \
--with-gssapi=no \
===================================================================
--- bind-9.10.4-P3.orig/bin/Makefile.in
+++ bind-9.10.4-P3/bin/Makefile.in
-@@ -19,7 +19,7 @@ srcdir = @srcdir@
+@@ -10,7 +10,7 @@ srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
-SUBDIRS = named rndc dig delv dnssec tools tests nsupdate \
+SUBDIRS = named rndc dig delv dnssec tools nsupdate \
- check confgen @PYTHON_TOOLS@ @PKCS11_TOOLS@
+ check confgen @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@
TARGETS =
Index: bind-9.10.4-P3/lib/Makefile.in
===================================================================
--- bind-9.10.4-P3.orig/lib/Makefile.in
+++ bind-9.10.4-P3/lib/Makefile.in
-@@ -23,7 +23,7 @@ top_srcdir = @top_srcdir@
+@@ -14,7 +14,7 @@ top_srcdir = @top_srcdir@
# Attempt to disable parallel processing.
.NOTPARALLEL:
.NO_PARALLEL:
===================================================================
--- bind-9.10.4-P3.orig/configure.in
+++ bind-9.10.4-P3/configure.in
-@@ -167,26 +167,11 @@ esac
+@@ -157,26 +157,11 @@ esac
#
AC_CONFIG_FILES([make/rules make/includes])
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://get.bitlbee.org/src/ \
http://distcache.FreeBSD.org/local-distfiles/brix/
-PKG_MD5SUM:=9636d7fd89ebb3756c13a9a3387736ca6d56ccf66ec0580d512f07b21db0fa69
+PKG_HASH:=9636d7fd89ebb3756c13a9a3387736ca6d56ccf66ec0580d512f07b21db0fa69
PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/tgraf/bmon/releases/download/v$(PKG_VERSION)/
-PKG_MD5SUM:=02fdc312b8ceeb5786b28bf905f54328f414040ff42f45c83007f24b76cc9f7a
+PKG_HASH:=02fdc312b8ceeb5786b28bf905f54328f414040ff42f45c83007f24b76cc9f7a
PKG_MAINTAINER:=Baptiste Jonglez <openwrt-pkg@bitsofnetworks.org>
PKG_LICENSE:=MIT
PKG_SOURCE_VERSION:=v${PKG_VERSION}
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=ce568c41f60987ed972c53fb8dab92bf45052849c4992e8ae931c1eb505630b7
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-
include $(INCLUDE_DIR)/package.mk
define Package/bridge
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.gropp.org/bwm-ng
-PKG_MD5SUM:=ef0c7669508e95f56250ad4f8db98b7f
+PKG_HASH:=027cf3c960cd96fc9ffacdf7713df62d0fc55eeef4a1388289f8a62ae5e50df0
PKG_MAINTAINER:=Julen Landa Alustiza <julen@zokormazo.info>
PKG_LICENSE:=GPL2-2.0
PKG_LICENSE_FILES:=COPYING
include $(TOPDIR)/rules.mk
PKG_NAME:=cgi-io
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_LICENSE:=GPL-2.0+
close(fds[0]);
close(fds[1]);
- if (execl("/bin/busybox", "/bin/busybox", "md5sum", file, NULL));
+ if (execl("/bin/busybox", "/bin/busybox", "md5sum", file, NULL))
return NULL;
break;
PKG_SOURCE_URL:=https://github.com/ryd/chaosvpn.git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_MIRROR_HASH:=da987a95cb33af730c2b08ceec3af29a61e523625479c7e8b978fad881abbb53
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=Apache-2.0
PKG_MAINTAINER:=Norbert Summer <git@o-g.at>
include $(TOPDIR)/rules.mk
PKG_NAME:=chrony
-PKG_VERSION:=3.1
-PKG_RELEASE:=2
+PKG_VERSION:=3.2
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://download.tuxfamily.org/chrony/
-PKG_HASH:=9d9107dcdb7768a03dc129d33b2a7a25f1eea2f5620bc85eb00cfea07c1b6075
+PKG_HASH:=329f6718dd8c3ece3eee78be1f4821cbbeb62608e7d23f25da293cfa433c4116
PKG_MAINTAINER:=Miroslav Lichvar <mlichvar0@gmail.com>
PKG_LICENSE:=GPL-2.0
diff --git a/sysincl.h b/sysincl.h
-index 30e9b48..8fe16c0 100644
+index a9e4da0..e2a6e78 100644
--- a/sysincl.h
+++ b/sysincl.h
-@@ -70,4 +70,8 @@
- #include <arpa/inet.h>
+@@ -80,4 +80,8 @@
+ #include <sys/random.h>
#endif
+#if defined(LINUX) && !defined(IP_FREEBIND)
PKG_SOURCE_URL:=https://download.samba.org/pub/linux-cifs/cifs-utils/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=b7d75b67fd3987952896d27256c7293d
+PKG_HASH:=38fc63926af435dae4ebcf4406275580a692d9fb9ee3e32170317cf2ba68e6e3
PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
PKG_LICENSE:=GPL-3.0
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=b93de20a288c01c2ba28e96e31ad6da01627f45f
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=2adb27ec56172b18c5beee359dd7898d
+PKG_MIRROR_HASH:=89c9b313881c658a0f6b91329a78bb1a0151878b19bc99b315976081c6355557
PKG_INSTALL:=1
PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=e575ab3d35d75a6f70488001fcba45690ebe9b3e
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=280d2711308a5b051a43788519ae6857394690d3155fe954388c43cd9035ec84
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/daemonlogger
-PKG_MD5SUM:=acb64aa6cd5777e297569f100b5c39ee
+PKG_HASH:=79fcd34d815e9c671ffa1ea3c7d7d50f895bb7a79b4448c4fd1c37857cf44a0b
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/dansguardian
-PKG_MD5SUM:=2a88d0392cd28eaec02b7ee727b2e253
+PKG_HASH:=c74e9a32b97f9a9a056fced3da23fe48fca2bc6aa9af670afe9a53dc819414f5
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://unix4lyfe.org/darkstat
-PKG_MD5SUM:=963145de05cb21f4d93a9c244beeaea0
+PKG_HASH:=aeaf909585f7f43dc032a75328fdb62114e58405b06a92a13c0d3653236dedd7
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/davfs2/
-PKG_MD5SUM:=c9f0b557275b7ec88fec751bf22f30cf
+PKG_HASH:=c9c4e0f0912a782386216b2147eb9c36c47f193b8fcf3d637719e0b9fe7c96e0
PKG_FIXUP:=gettext-version autoreconf
PKG_VERSION:=2.7.6
# Release == build
# increase on changes of services files or tld_names.dat
-PKG_RELEASE:=16
+PKG_RELEASE:=17
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
"dyn.com" "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
"dyndns.org" "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+"dynu.com" "http://api.dynu.com/nic/update?hostname=[DOMAIN]&myipv6=[IP]&username=[USERNAME]&password=[PASSWORD]"
+
"dynv6.com" "http://dynv6.com/api/update?hostname=[DOMAIN]&token=[PASSWORD]&ipv6=[IP]" "updated"
"goip.de" "http://www.goip.de/setip?username=[USERNAME]&password=[PASSWORD]&subdomain=[DOMAIN]&ip6=[IP]"
PKG_SOURCE_URL:=@SAVANNAH/dhcp-fwd/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=9d1ea7939fef93ae7d7caef43397a908
+PKG_HASH:=6abf8e6a72ad01df90efba543c9a18c149b24d50d000e66ce55209780dc04cd5
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_URL:=ftp://roy.marples.name/pub/dhcpcd \
http://roy.marples.name/downloads/dhcpcd
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=b22005c131e7108ecf598b6a4ac091eb
+PKG_HASH:=36ad01619ee81ac3815467d0157c38a14f5db464371326e97f719be362d5ab9c
PKG_LICENSE:=BSD-2c
PKG_LICENSE_FILES:=
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.flyn.org/projects/dmapd
-PKG_MD5SUM:=458adf9d0c0e434fb92ebc8bd9739f68
+PKG_HASH:=5447e8d28cd93739efe479e8ca3e140043b11aca4427676e8990b300618011a1
PKG_FIXUP:=autoreconf
PKG_INSTALL:=2
PKG_NAME:=dnscrypt-proxy
PKG_VERSION:=1.9.5
-PKG_RELEASE:=4
+PKG_RELEASE:=7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://download.dnscrypt.org/dnscrypt-proxy \
+config global
+ # start dnscrypt-proxy from procd interface trigger rather than immediately in init
+ # if needed you can restrict trigger to certain interface(s)
+ # list procd_trigger 'wan'
+ # list procd_trigger 'wan6'
+
config dnscrypt-proxy ns1
option address '127.0.0.1'
option port '5353'
#!/bin/sh /etc/rc.common
-START=50
+START=30
USE_PROCD=1
PROG=/usr/sbin/dnscrypt-proxy
CONFIG_DIR=/var/etc
USER=nobody
-dnscrypt_instance() {
- local config_path="$CONFIG_DIR/dnscrypt-proxy-$1.conf"
+boot() {
+ dnscrypt_boot=1
+ rc_procd start_service
+}
+
+dnscrypt_instance() {
+ local config_path="$CONFIG_DIR/dnscrypt-proxy-$1.conf"
create_config_file $1 "$config_path"
procd_open_instance
config_get client_key $1 'client_key' ''
config_get syslog_prefix $1 'syslog_prefix' 'dnscrypt-proxy'
config_get query_log_file $1 'query_log_file' ''
- config_get log_level $1 'log_level' '6'
+ config_get log_level $1 'log_level' '6'
+ config_get blacklist $1 'blacklist' ''
config_get_bool syslog $1 'syslog' '1'
config_get_bool ephemeral_keys $1 'ephemeral_keys' '0'
config_get_bool local_cache $1 'local_cache' '0'
append_param "LocalAddress" "$address:$port" $config_path
append_param_not_empty "ClientKey" "$client_key" $config_path
append_on_off "EphemeralKeys" $ephemeral_keys $config_path
- append_param "LogLevel" "$log_level" $config_path
+ append_param "LogLevel" "$log_level" $config_path
append_on_off "Syslog" $syslog $config_path
append_param "SyslogPrefix" "$syslog_prefix" $config_path
append_on_off "LocalCache" $local_cache $config_path
append_param_not_empty "QueryLogFile" "$query_log_file" $config_path
- if [ $plugins_support_enabled -ne 0 ]
+
+ if [ $plugins_support_enabled -ne 0 ] && [ $block_ipv6 -ne 0 ]
then
- append_yes_no "BlockIPv6" $block_ipv6 $config_path
- else
- log_ignored_param "block_ipv6"
+ append_yes_no "BlockIPv6" $block_ipv6 $config_path
+ elif [ $block_ipv6 -ne 0 ]
+ then
+ log_ignored_param "block_ipv6"
fi
- if [ $plugins_support_enabled -ne 0 ]
+ if [ $plugins_support_enabled -ne 0 ] && [ -n "$blacklist" ]
then
- config_list_foreach $1 'blacklist' append_blacklists $config_path
- else
- log_ignored_param "blacklist"
+ config_list_foreach $1 'blacklist' append_blacklists $config_path
+ elif [ -n "$blacklist" ]
+ then
+ log_ignored_param "blacklist"
fi
-
}
log_ignored_param() {
- local param_name=$1
- logger -t dnscrypt-proxy -p user.warn dnscrypt-proxy plugins support not present, ignoring $param_name parameter...
+ local param_name=$1
+ logger -t dnscrypt-proxy -p user.warn "dnscrypt-proxy plugins support not present, ignoring '$param_name' parameter."
}
-
append_on_off() {
local param_name=$1
local param_value=$2
if [ $param_value -eq 1 ]
then
- value="on"
+ value="on"
else
value="off"
fi
if [ $param_value -eq 1 ]
then
- value="yes"
+ value="yes"
else
value="no"
fi
append_blacklists() {
local value="$1"
- local config_path="$2"
+ local config_path="$2"
append_param_not_empty "BlackList" "$value" $config_path
}
start_service() {
+ if [ -n "${dnscrypt_boot}" ]
+ then
+ return 0
+ fi
config_load dnscrypt-proxy
config_foreach dnscrypt_instance dnscrypt-proxy
}
service_triggers() {
+ local trigger
+ local triggerlist="$(uci_get dnscrypt-proxy.@global[0].procd_trigger)"
+
+ PROCD_RELOAD_DELAY=2000
+ if [ -n "${triggerlist}" ]
+ then
+ for trigger in ${triggerlist}
+ do
+ procd_add_interface_trigger "interface.*.up" "${trigger}" /etc/init.d/dnscrypt-proxy reload
+ done
+ else
+ procd_add_raw_trigger "interface.*.up" 2000 /etc/init.d/dnscrypt-proxy reload
+ fi
procd_add_reload_trigger 'dnscrypt-proxy'
}
PKG_SOURCE:=v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/$(PKG_NAME)/$(PKG_NAME)/archive/
-PKG_MD5SUM:=70613669ef00a480e3ebb62e12427cf4
+PKG_HASH:=cae011aacf6b250fc021c861fe46e15310349c474bca4553c0f829620e53e3bf
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(VERSION_TRANSFORMED)
PKG_SOURCE:=$(PKG_NAME)-$(VERSION_TRANSFORMED).tgz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=5ee3e5237c6a12059ae9d38380505d38448c2c12787f9fcc603cdb0a1a519312
+PKG_HASH:=5ee3e5237c6a12059ae9d38380505d38448c2c12787f9fcc603cdb0a1a519312
PKG_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/e/etherwake
-PKG_MD5SUM:=628e8b2a28d47f262e4c26c989402a59
+PKG_HASH:=54241c7689579dc86e29e6afbc6d60e69f97135091a1395c8a10f6d5a2daec1d
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).orig
PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/software/network/ethtool
-PKG_MD5SUM:=e9e7286178f172c9f21bafbfb978d6de
+PKG_HASH:=403dfe288e2d8031eab0be3f5d0ca9128e120d61c52c3dc434474fa026eb4a43
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).c
PKG_SOURCE_URL:=http://distfiles.gentoo.org/distfiles/
-PKG_MD5SUM:=d26693c1a7c883d1432e05fb6f7ead6e
+PKG_HASH:=75b321e5d9dddcea2b38035b62ac30f2175ed43f3f187be6da19aaa67c4fe165
PKG_MAINTAINER:=Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
PKG_LICENSE:=GPL-2.0+
UNPACK_CMD=$(CP) $(DL_DIR)/$(PKG_SOURCE) $(1)/
PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/86
-PKG_MD5SUM:=e53236d3049f64f7955ad9556da099eb
+PKG_HASH:=714ff09d7bd75f79783f744f6f8c5af2fe456c8cf876feaa704c205a73e043c9
PKG_LICENSE:=BSD-2-Clause
PKG_LICENSE_FILES:=COPYRIGHT
PKG_SOURCE:=$(PKG_NAME)-src-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.fossil-scm.org/index.html/uv/download
-PKG_MD5SUM:=3d5a7da5c506a47784942236a788b29b
+PKG_HASH:=53a6b83e878feced9ac7705f87e5b6ea82727314e3e19202ae1c46c7e4dba49f
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-src-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/FreeRADIUS/freeradius-server/archive
-PKG_MD5SUM:=612cb1d9ad0d66e881d8b0592cd51720
+PKG_HASH:=f0b32edb90368c3b9523e2baa792a1794d8bad662407f0d210a6c460541379b7
PKG_MAINTAINER:=Lucile Quirion <lucile.quirion@savoirfairelinux.com>
PKG_LICENSE:=GPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.cipherdyne.org/fwknop/download
-PKG_MD5SUM:=e2c49e9674888a028bd443a55c3aaa22
PKG_HASH:=5bf47fe1fd30e862d29464f762c0b8bf89b5e298665c37624d6707826da956d4
PKG_MAINTAINER:=Jonathan Bennett <JBennett@incomsystems.biz>
PKG_LICENSE:=GPLv2
include $(TOPDIR)/rules.mk
PKG_NAME:=git
-PKG_VERSION:=2.13.3
+PKG_VERSION:=2.14.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/software/scm/git/
-PKG_HASH:=91aa23be428f67eb19616f43fa0229d567e9acf4f08fba33eb0b627e4d323e62
+PKG_HASH:=6f724c6d0e9e13114ab35db6f67e1b2c1934b641e89366e6a0e37618231f2cc6
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
--- a/configure.ac
+++ b/configure.ac
-@@ -869,7 +869,8 @@ AC_RUN_IFELSE(
+@@ -926,7 +926,8 @@ AC_RUN_IFELSE(
FILE *f = fopen(".", "r");
- return f && fread(&c, 1, 1, f)]])],
+ return f)]])],
[ac_cv_fread_reads_directories=no],
- [ac_cv_fread_reads_directories=yes])
+ [ac_cv_fread_reads_directories=yes],
])
if test $ac_cv_fread_reads_directories = yes; then
FREAD_READS_DIRECTORIES=UnfortunatelyYes
-@@ -903,7 +904,8 @@ AC_RUN_IFELSE(
+@@ -960,7 +961,8 @@ AC_RUN_IFELSE(
if (snprintf(buf, 3, "%s", "12345") != 5
|| strcmp(buf, "12")) return 1]])],
[ac_cv_snprintf_returns_bogus=no],
])
if test $ac_cv_snprintf_returns_bogus = yes; then
SNPRINTF_RETURNS_BOGUS=UnfortunatelyYes
-@@ -926,7 +928,8 @@ yippeeyeswehaveit
+@@ -983,7 +985,8 @@ yippeeyeswehaveit
#endif
]),
[ac_cv_sane_mode_bits=yes],
--- a/Makefile
+++ b/Makefile
-@@ -1137,7 +1137,7 @@ else
+@@ -1197,7 +1197,7 @@ else
endif
curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
ifeq "$(curl_check)" "072200"
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=b2d96c36682391f45c63b21a91fbe77a969a7b362417c851dd0091a06fcc74d9
PKG_SOURCE_URL:=https://github.com/sitaramc/gitolite.git
PKG_SOURCE_VERSION:=908f8c6f3b8ef5b95829be7155be2557e71f4579
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
include $(TOPDIR)/rules.mk
PKG_NAME:=gnurl
-PKG_VERSION:=7.54.1
+PKG_VERSION:=7.55.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://gnunet.org/sites/default/files
-PKG_HASH:=4481f50a6c2bf3f1e161743333cb1bafea29dffc3cf535137bba2428ca90eb6b
+PKG_HASH:=761b3ddb32946965c62676ca4acf2ebaab38d09068aebeea78caaf6cce8c2b45
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING
include $(TOPDIR)/rules.mk
PKG_NAME:=haproxy
-PKG_VERSION:=1.7.5
-PKG_RELEASE:=01
+PKG_VERSION:=1.7.8
+PKG_RELEASE:=18
PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.haproxy.org/download/1.7/src/
-PKG_MD5SUM:=ed84c80cb97852d2aa3161ed16c48a1c
+PKG_HASH:=ec90153ccedd20ad4015d3eaf76b502ff1f61b431d54c22b8457b5784a9ae142
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0
define Download/lua533
FILE:=lua-5.3.3.tar.gz
URL:=http://www.lua.org/ftp/
- MD5SUM:=703f75caa4fdf4a911c1a72e67a27498
+ HASH:=5113c06884f7de453ce57702abaac1d618307f33f6789fa870e87a59d772aca2
endef
define Build/Prepare
--- /dev/null
+From fa73e6b0d5f64eb8a6fd8a1706d7ec03293a943e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= <flecaille@haproxy.com>
+Date: Thu, 13 Jul 2017 09:07:09 +0200
+Subject: [PATCH 01/18] BUG/MINOR: peers: peer synchronization issue (with
+ several peers sections).
+
+When several stick-tables were configured with several peers sections,
+only a part of them could be synchronized: the ones attached to the last
+parsed 'peers' section. This was due to the fact that, at least, the peer I/O handler
+refered to the wrong peer section list, in fact always the same: the last one parsed.
+
+The fact that the global peer section list was named "struct peers *peers"
+lead to this issue. This variable name is dangerous ;).
+
+So this patch renames global 'peers' variable to 'cfg_peers' to ensure that
+no such wrong references are still in use, then all the functions wich used
+old 'peers' variable have been modified to refer to the correct peer list.
+
+Must be backported to 1.6 and 1.7.
+(cherry picked from commit ed2b4a6b793d062000518e51ed71e014c649c313)
+
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ include/types/peers.h | 2 +-
+ src/cfgparse.c | 18 +++++++++---------
+ src/haproxy.c | 10 +++++-----
+ src/peers.c | 40 ++++++++++++++++++++--------------------
+ src/proxy.c | 6 +++---
+ 5 files changed, 38 insertions(+), 38 deletions(-)
+
+diff --git a/include/types/peers.h b/include/types/peers.h
+index 105dffb0..a77a0942 100644
+--- a/include/types/peers.h
++++ b/include/types/peers.h
+@@ -91,7 +91,7 @@ struct peers {
+ };
+
+
+-extern struct peers *peers;
++extern struct peers *cfg_peers;
+
+ #endif /* _TYPES_PEERS_H */
+
+diff --git a/src/cfgparse.c b/src/cfgparse.c
+index 8c0906bf..1b53006b 100644
+--- a/src/cfgparse.c
++++ b/src/cfgparse.c
+@@ -2124,7 +2124,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
+ goto out;
+ }
+
+- for (curpeers = peers; curpeers != NULL; curpeers = curpeers->next) {
++ for (curpeers = cfg_peers; curpeers != NULL; curpeers = curpeers->next) {
+ /*
+ * If there are two proxies with the same name only following
+ * combinations are allowed:
+@@ -2142,8 +2142,8 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
+ goto out;
+ }
+
+- curpeers->next = peers;
+- peers = curpeers;
++ curpeers->next = cfg_peers;
++ cfg_peers = curpeers;
+ curpeers->conf.file = strdup(file);
+ curpeers->conf.line = linenum;
+ curpeers->last_change = now.tv_sec;
+@@ -2223,7 +2223,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
+ if (strcmp(newpeer->id, localpeer) == 0) {
+ /* Current is local peer, it define a frontend */
+ newpeer->local = 1;
+- peers->local = newpeer;
++ cfg_peers->local = newpeer;
+
+ if (!curpeers->peers_fe) {
+ if ((curpeers->peers_fe = calloc(1, sizeof(struct proxy))) == NULL) {
+@@ -8189,9 +8189,9 @@ int check_config_validity()
+ }
+
+ if (curproxy->table.peers.name) {
+- struct peers *curpeers = peers;
++ struct peers *curpeers;
+
+- for (curpeers = peers; curpeers; curpeers = curpeers->next) {
++ for (curpeers = cfg_peers; curpeers; curpeers = curpeers->next) {
+ if (strcmp(curpeers->id, curproxy->table.peers.name) == 0) {
+ free((void *)curproxy->table.peers.name);
+ curproxy->table.peers.p = curpeers;
+@@ -9279,15 +9279,15 @@ out_uri_auth_compat:
+ if (curproxy->table.peers.p)
+ curproxy->table.peers.p->peers_fe->bind_proc |= curproxy->bind_proc;
+
+- if (peers) {
+- struct peers *curpeers = peers, **last;
++ if (cfg_peers) {
++ struct peers *curpeers = cfg_peers, **last;
+ struct peer *p, *pb;
+
+ /* Remove all peers sections which don't have a valid listener,
+ * which are not used by any table, or which are bound to more
+ * than one process.
+ */
+- last = &peers;
++ last = &cfg_peers;
+ while (*last) {
+ curpeers = *last;
+
+diff --git a/src/haproxy.c b/src/haproxy.c
+index 6d09aed4..25cea0cd 100644
+--- a/src/haproxy.c
++++ b/src/haproxy.c
+@@ -988,7 +988,7 @@ void init(int argc, char **argv)
+ struct peers *pr;
+ struct proxy *px;
+
+- for (pr = peers; pr; pr = pr->next)
++ for (pr = cfg_peers; pr; pr = pr->next)
+ if (pr->peers_fe)
+ break;
+
+@@ -1217,11 +1217,11 @@ void init(int argc, char **argv)
+ if (global.stats_fe)
+ global.maxsock += global.stats_fe->maxconn;
+
+- if (peers) {
++ if (cfg_peers) {
+ /* peers also need to bypass global maxconn */
+- struct peers *p = peers;
++ struct peers *p = cfg_peers;
+
+- for (p = peers; p; p = p->next)
++ for (p = cfg_peers; p; p = p->next)
+ if (p->peers_fe)
+ global.maxsock += p->peers_fe->maxconn;
+ }
+@@ -2067,7 +2067,7 @@ int main(int argc, char **argv)
+ }
+
+ /* we might have to unbind some peers sections from some processes */
+- for (curpeers = peers; curpeers; curpeers = curpeers->next) {
++ for (curpeers = cfg_peers; curpeers; curpeers = curpeers->next) {
+ if (!curpeers->peers_fe)
+ continue;
+
+diff --git a/src/peers.c b/src/peers.c
+index 543c84c1..5b8a287a 100644
+--- a/src/peers.c
++++ b/src/peers.c
+@@ -171,7 +171,7 @@ enum {
+ #define PEER_MINOR_VER 1
+ #define PEER_DWNGRD_MINOR_VER 0
+
+-struct peers *peers = NULL;
++struct peers *cfg_peers = NULL;
+ static void peer_session_forceshutdown(struct appctx *appctx);
+
+ /* This function encode an uint64 to 'dynamic' length format.
+@@ -727,19 +727,19 @@ switchstate:
+ /* if current peer is local */
+ if (curpeer->local) {
+ /* if current host need resyncfrom local and no process assined */
+- if ((peers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FROMLOCAL &&
+- !(peers->flags & PEERS_F_RESYNC_ASSIGN)) {
++ if ((curpeers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FROMLOCAL &&
++ !(curpeers->flags & PEERS_F_RESYNC_ASSIGN)) {
+ /* assign local peer for a lesson, consider lesson already requested */
+ curpeer->flags |= PEER_F_LEARN_ASSIGN;
+- peers->flags |= (PEERS_F_RESYNC_ASSIGN|PEERS_F_RESYNC_PROCESS);
++ curpeers->flags |= (PEERS_F_RESYNC_ASSIGN|PEERS_F_RESYNC_PROCESS);
+ }
+
+ }
+- else if ((peers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FROMREMOTE &&
+- !(peers->flags & PEERS_F_RESYNC_ASSIGN)) {
++ else if ((curpeers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FROMREMOTE &&
++ !(curpeers->flags & PEERS_F_RESYNC_ASSIGN)) {
+ /* assign peer for a lesson */
+ curpeer->flags |= PEER_F_LEARN_ASSIGN;
+- peers->flags |= PEERS_F_RESYNC_ASSIGN;
++ curpeers->flags |= PEERS_F_RESYNC_ASSIGN;
+ }
+
+
+@@ -807,7 +807,7 @@ switchstate:
+ curpeer->statuscode = atoi(trash.str);
+
+ /* Awake main task */
+- task_wakeup(peers->sync_task, TASK_WOKEN_MSG);
++ task_wakeup(curpeers->sync_task, TASK_WOKEN_MSG);
+
+ /* If status code is success */
+ if (curpeer->statuscode == PEER_SESS_SC_SUCCESSCODE) {
+@@ -830,14 +830,14 @@ switchstate:
+ curpeer->flags |= PEER_F_TEACH_PROCESS;
+
+ }
+- else if ((peers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FROMREMOTE &&
+- !(peers->flags & PEERS_F_RESYNC_ASSIGN)) {
++ else if ((curpeers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FROMREMOTE &&
++ !(curpeers->flags & PEERS_F_RESYNC_ASSIGN)) {
+ /* If peer is remote and resync from remote is needed,
+ and no peer currently assigned */
+
+ /* assign peer for a lesson */
+ curpeer->flags |= PEER_F_LEARN_ASSIGN;
+- peers->flags |= PEERS_F_RESYNC_ASSIGN;
++ curpeers->flags |= PEERS_F_RESYNC_ASSIGN;
+ }
+
+ }
+@@ -950,8 +950,8 @@ switchstate:
+
+ if (curpeer->flags & PEER_F_LEARN_ASSIGN) {
+ curpeer->flags &= ~PEER_F_LEARN_ASSIGN;
+- peers->flags &= ~(PEERS_F_RESYNC_ASSIGN|PEERS_F_RESYNC_PROCESS);
+- peers->flags |= (PEERS_F_RESYNC_LOCAL|PEERS_F_RESYNC_REMOTE);
++ curpeers->flags &= ~(PEERS_F_RESYNC_ASSIGN|PEERS_F_RESYNC_PROCESS);
++ curpeers->flags |= (PEERS_F_RESYNC_LOCAL|PEERS_F_RESYNC_REMOTE);
+ }
+ curpeer->confirm++;
+ }
+@@ -959,11 +959,11 @@ switchstate:
+
+ if (curpeer->flags & PEER_F_LEARN_ASSIGN) {
+ curpeer->flags &= ~PEER_F_LEARN_ASSIGN;
+- peers->flags &= ~(PEERS_F_RESYNC_ASSIGN|PEERS_F_RESYNC_PROCESS);
++ curpeers->flags &= ~(PEERS_F_RESYNC_ASSIGN|PEERS_F_RESYNC_PROCESS);
+
+ curpeer->flags |= PEER_F_LEARN_NOTUP2DATE;
+- peers->resync_timeout = tick_add(now_ms, MS_TO_TICKS(5000));
+- task_wakeup(peers->sync_task, TASK_WOKEN_MSG);
++ curpeers->resync_timeout = tick_add(now_ms, MS_TO_TICKS(5000));
++ task_wakeup(curpeers->sync_task, TASK_WOKEN_MSG);
+ }
+ curpeer->confirm++;
+ }
+@@ -1334,8 +1334,8 @@ incomplete:
+
+ /* Need to request a resync */
+ if ((curpeer->flags & PEER_F_LEARN_ASSIGN) &&
+- (peers->flags & PEERS_F_RESYNC_ASSIGN) &&
+- !(peers->flags & PEERS_F_RESYNC_PROCESS)) {
++ (curpeers->flags & PEERS_F_RESYNC_ASSIGN) &&
++ !(curpeers->flags & PEERS_F_RESYNC_PROCESS)) {
+ unsigned char msg[2];
+
+ /* Current peer was elected to request a resync */
+@@ -1351,7 +1351,7 @@ incomplete:
+ appctx->st0 = PEER_SESS_ST_END;
+ goto switchstate;
+ }
+- peers->flags |= PEERS_F_RESYNC_PROCESS;
++ curpeers->flags |= PEERS_F_RESYNC_PROCESS;
+ }
+
+ /* Nothing to read, now we start to write */
+@@ -1624,7 +1624,7 @@ incomplete:
+
+ /* Current peer was elected to request a resync */
+ msg[0] = PEER_MSG_CLASS_CONTROL;
+- msg[1] = ((peers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FINISHED) ? PEER_MSG_CTRL_RESYNCFINISHED : PEER_MSG_CTRL_RESYNCPARTIAL;
++ msg[1] = ((curpeers->flags & PEERS_RESYNC_STATEMASK) == PEERS_RESYNC_FINISHED) ? PEER_MSG_CTRL_RESYNCFINISHED : PEER_MSG_CTRL_RESYNCPARTIAL;
+ /* process final lesson message */
+ repl = bi_putblk(si_ic(si), (char *)msg, sizeof(msg));
+ if (repl <= 0) {
+diff --git a/src/proxy.c b/src/proxy.c
+index 78120d9b..bedc7ae0 100644
+--- a/src/proxy.c
++++ b/src/proxy.c
+@@ -1007,7 +1007,7 @@ void soft_stop(void)
+ p = p->next;
+ }
+
+- prs = peers;
++ prs = cfg_peers;
+ while (prs) {
+ if (prs->peers_fe)
+ stop_proxy(prs->peers_fe);
+@@ -1142,7 +1142,7 @@ void pause_proxies(void)
+ p = p->next;
+ }
+
+- prs = peers;
++ prs = cfg_peers;
+ while (prs) {
+ if (prs->peers_fe)
+ err |= !pause_proxy(prs->peers_fe);
+@@ -1176,7 +1176,7 @@ void resume_proxies(void)
+ p = p->next;
+ }
+
+- prs = peers;
++ prs = cfg_peers;
+ while (prs) {
+ if (prs->peers_fe)
+ err |= !resume_proxy(prs->peers_fe);
+--
+2.13.0
+
--- /dev/null
+From bcc483a9edfeb8ab69d1af83886d9e1323cffd06 Mon Sep 17 00:00:00 2001
+From: Thierry FOURNIER <thierry.fournier@ozon.io>
+Date: Wed, 12 Jul 2017 11:18:00 +0200
+Subject: [PATCH 02/18] BUG/MINOR: lua: In error case, the safe mode is not
+ removed
+
+Just forgot of reset the safe mode. This have not consequences
+the safe mode just set a pointer on fucntion which is called only
+and initialises a longjmp.
+
+Out of lua execution, this longjmp is never executed and the
+function is never called.
+
+This patch should be backported in 1.6 and 1.7
+(cherry picked from commit 0a97620c080232a21ad7fce2c859a2edc9d7147e)
+
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ src/hlua.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/hlua.c b/src/hlua.c
+index c862102d..4c1c2d21 100644
+--- a/src/hlua.c
++++ b/src/hlua.c
+@@ -854,6 +854,7 @@ int hlua_ctx_init(struct hlua *lua, struct task *task)
+ lua->T = lua_newthread(gL.T);
+ if (!lua->T) {
+ lua->Tref = LUA_REFNIL;
++ RESET_SAFE_LJMP(gL.T);
+ return 0;
+ }
+ hlua_sethlua(lua);
+--
+2.13.0
+
--- /dev/null
+From 49d319a677432b69c6a69ef5331ae2ed592075c9 Mon Sep 17 00:00:00 2001
+From: Thierry FOURNIER <thierry.fournier@ozon.io>
+Date: Wed, 12 Jul 2017 13:41:33 +0200
+Subject: [PATCH 03/18] BUG/MINOR: lua: executes the function destroying the
+ Lua session in safe mode
+
+When we destroy the Lua session, we manipulates Lua stack,
+so errors can raises. It will be better to catch these errors.
+
+This patch should be backported in 1.6 and 1.7
+(cherry picked from commit 75d0208009c3189b5d10793e08f27dd62a76c3ae)
+
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ src/hlua.c | 17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/src/hlua.c b/src/hlua.c
+index 4c1c2d21..2d312804 100644
+--- a/src/hlua.c
++++ b/src/hlua.c
+@@ -876,9 +876,15 @@ void hlua_ctx_destroy(struct hlua *lua)
+ /* Purge all the pending signals. */
+ hlua_com_purge(lua);
+
++ if (!SET_SAFE_LJMP(lua->T))
++ return;
+ luaL_unref(lua->T, LUA_REGISTRYINDEX, lua->Mref);
+- luaL_unref(gL.T, LUA_REGISTRYINDEX, lua->Tref);
++ RESET_SAFE_LJMP(lua->T);
+
++ if (!SET_SAFE_LJMP(gL.T))
++ return;
++ luaL_unref(gL.T, LUA_REGISTRYINDEX, lua->Tref);
++ RESET_SAFE_LJMP(gL.T);
+ /* Forces a garbage collecting process. If the Lua program is finished
+ * without error, we run the GC on the thread pointer. Its freed all
+ * the unused memory.
+@@ -889,9 +895,16 @@ void hlua_ctx_destroy(struct hlua *lua)
+ * the garbage collection.
+ */
+ if (lua->flags & HLUA_MUST_GC) {
++ if (!SET_SAFE_LJMP(lua->T))
++ return;
+ lua_gc(lua->T, LUA_GCCOLLECT, 0);
+- if (lua_status(lua->T) != LUA_OK)
++ RESET_SAFE_LJMP(lua->T);
++ if (lua_status(lua->T) != LUA_OK) {
++ if (!SET_SAFE_LJMP(gL.T))
++ return;
+ lua_gc(gL.T, LUA_GCCOLLECT, 0);
++ RESET_SAFE_LJMP(gL.T);
++ }
+ }
+
+ lua->T = NULL;
+--
+2.13.0
+
--- /dev/null
+From 2823f54f706f56304970313cb14a98a4ce20d5ab Mon Sep 17 00:00:00 2001
+From: Thierry FOURNIER <thierry.fournier@ozon.io>
+Date: Sun, 16 Jul 2017 20:48:54 +0200
+Subject: [PATCH 04/18] BUG/MAJOR: lua/socket: resources not detroyed when the
+ socket is aborted
+
+In some cases, the socket is misused. The user can open socket and never
+close it, or open the socket and close it without sending data. This
+causes resources leak on all resources associated to the stream (buffer,
+spoe, ...)
+
+This is caused by the stream_shutdown function which is called outside
+of the stream execution process. Sometimes, the shtudown is required
+while the stream is not started, so the cleanup is ignored.
+
+This patch change the shutdown mode of the session. Now if the session is
+no longer used and the Lua want to destroy it, it just set a destroy flag
+and the session kill itself.
+
+This patch should be backported in 1.6 and 1.7
+
+(cherry picked from cmomit b13b20a19aacb039a33f886e38a181b00c9a6d41)
+
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ include/types/applet.h | 1 +
+ src/hlua.c | 16 ++++++++++++++--
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/include/types/applet.h b/include/types/applet.h
+index 46b2bc10..aee9167e 100644
+--- a/include/types/applet.h
++++ b/include/types/applet.h
+@@ -122,6 +122,7 @@ struct appctx {
+ struct hlua_socket *socket;
+ struct list wake_on_read;
+ struct list wake_on_write;
++ int die;
+ } hlua;
+ struct {
+ struct hlua hlua;
+diff --git a/src/hlua.c b/src/hlua.c
+index 2d312804..eb003558 100644
+--- a/src/hlua.c
++++ b/src/hlua.c
+@@ -1544,6 +1544,15 @@ static void hlua_socket_handler(struct appctx *appctx)
+ struct stream_interface *si = appctx->owner;
+ struct connection *c = objt_conn(si_opposite(si)->end);
+
++ if (appctx->ctx.hlua.die) {
++ si_shutw(si);
++ si_shutr(si);
++ si_ic(si)->flags |= CF_READ_NULL;
++ hlua_com_wake(&appctx->ctx.hlua.wake_on_read);
++ hlua_com_wake(&appctx->ctx.hlua.wake_on_write);
++ stream_shutdown(si_strm(si), SF_ERR_KILLED);
++ }
++
+ /* If the connection object is not avalaible, close all the
+ * streams and wakeup everithing waiting for.
+ */
+@@ -1619,9 +1628,10 @@ __LJMP static int hlua_socket_gc(lua_State *L)
+
+ /* Remove all reference between the Lua stack and the coroutine stream. */
+ appctx = objt_appctx(socket->s->si[0].end);
+- stream_shutdown(socket->s, SF_ERR_KILLED);
+ socket->s = NULL;
+ appctx->ctx.hlua.socket = NULL;
++ appctx->ctx.hlua.die = 1;
++ appctx_wakeup(appctx);
+
+ return 0;
+ }
+@@ -1641,10 +1651,11 @@ __LJMP static int hlua_socket_close(lua_State *L)
+ return 0;
+
+ /* Close the stream and remove the associated stop task. */
+- stream_shutdown(socket->s, SF_ERR_KILLED);
+ appctx = objt_appctx(socket->s->si[0].end);
+ appctx->ctx.hlua.socket = NULL;
+ socket->s = NULL;
++ appctx->ctx.hlua.die = 1;
++ appctx_wakeup(appctx);
+
+ return 0;
+ }
+@@ -2316,6 +2327,7 @@ __LJMP static int hlua_socket_new(lua_State *L)
+
+ appctx->ctx.hlua.socket = socket;
+ appctx->ctx.hlua.connected = 0;
++ appctx->ctx.hlua.die = 0;
+ LIST_INIT(&appctx->ctx.hlua.wake_on_write);
+ LIST_INIT(&appctx->ctx.hlua.wake_on_read);
+
+--
+2.13.0
+
--- /dev/null
+From ea3b479be6cacb399a6541a00b1bdce17b0179d0 Mon Sep 17 00:00:00 2001
+From: Thierry FOURNIER <thierry.fournier@ozon.io>
+Date: Mon, 17 Jul 2017 00:44:40 +0200
+Subject: [PATCH 05/18] BUG/MEDIUM: lua: bad memory access
+
+We cannot perform garbage collection on unreferenced thread.
+This memory is now free and another Lua process can use it for
+other things.
+
+HAProxy is monothread, so this bug doesn't cause crash.
+
+This patch must be backported in 1.6 and 1.7
+(cherry picked from commit 7bd10d58d3aecf7cf1e5ee7df01193e07128a52d)
+
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ src/hlua.c | 12 +++---------
+ 1 file changed, 3 insertions(+), 9 deletions(-)
+
+diff --git a/src/hlua.c b/src/hlua.c
+index eb003558..a998860e 100644
+--- a/src/hlua.c
++++ b/src/hlua.c
+@@ -895,16 +895,10 @@ void hlua_ctx_destroy(struct hlua *lua)
+ * the garbage collection.
+ */
+ if (lua->flags & HLUA_MUST_GC) {
+- if (!SET_SAFE_LJMP(lua->T))
++ if (!SET_SAFE_LJMP(gL.T))
+ return;
+- lua_gc(lua->T, LUA_GCCOLLECT, 0);
+- RESET_SAFE_LJMP(lua->T);
+- if (lua_status(lua->T) != LUA_OK) {
+- if (!SET_SAFE_LJMP(gL.T))
+- return;
+- lua_gc(gL.T, LUA_GCCOLLECT, 0);
+- RESET_SAFE_LJMP(gL.T);
+- }
++ lua_gc(gL.T, LUA_GCCOLLECT, 0);
++ RESET_SAFE_LJMP(gL.T);
+ }
+
+ lua->T = NULL;
+--
+2.13.0
+
--- /dev/null
+From 20850d19250eb530cab889bb9059a630b3f805a3 Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Tue, 18 Jul 2017 06:56:40 +0200
+Subject: [PATCH 06/18] DOC: update CONTRIBUTING regarding optional parts and
+ message format
+
+Make it clear that optional components must not break when disabled,
+that openssl is the only officially supported library and its support
+must not be broken, and that bug fixes must always be detailed.
+(cherry picked from commit 9d84cd602f4adb3954209eb14c94eea9254d1b5b)
+
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ CONTRIBUTING | 21 ++++++++++++++++++++-
+ 1 file changed, 20 insertions(+), 1 deletion(-)
+
+diff --git a/CONTRIBUTING b/CONTRIBUTING
+index 74a099bc..b2c2b493 100644
+--- a/CONTRIBUTING
++++ b/CONTRIBUTING
+@@ -69,6 +69,16 @@ code :
+ Since most of these restrictions are just a matter of coding style, it is
+ normally not a problem to comply.
+
++When modifying some optional subsystem (SSL, Lua, compression, device detection
++engines), please make sure the code continues to build (and to work) when these
++features are disabled. Similarly, when modifying the SSL stack, please always
++ensure that supported OpenSSL versions continue to build and to work, especially
++if you modify support for alternate libraries. Clean support for the legacy
++OpenSSL libraries is mandatory, support for its derivatives is a bonus and may
++occasionally break eventhough a great care is taken. In other words, if you
++provide a patch for OpenSSL you don't need to test its derivatives, but if you
++provide a patch for a derivative you also need to test with OpenSSL.
++
+ If your work is very confidential and you can't publicly discuss it, you can
+ also mail willy@haproxy.org directly about it, but your mail may be waiting
+ several days in the queue before you get a response, if you get a response at
+@@ -441,13 +451,22 @@ do not think about them anymore after a few patches.
+ way the subject is built. Please see the section below for more information
+ regarding this formatting.
+
+- As a rule of thumb, your patch must never be made only of a subject line,
++ As a rule of thumb, your patch MUST NEVER be made only of a subject line,
+ it *must* contain a description. Even one or two lines, or indicating
+ whether a backport is desired or not. It turns out that single-line commits
+ are so rare in the Git world that they require special manual (hence
+ painful) handling when they are backported, and at least for this reason
+ it's important to keep this in mind.
+
++ Each patch fixing a bug MUST be tagged with "BUG", a severity level, an
++ indication of the affected subsystem and a brief description of the nature
++ of the issue in the subject line, and a detailed analysis in the message
++ body. The explanation of the user-visible impact and the need for
++ backporting to stable branches or not are MANDATORY. Bug fixes with no
++ indication will simply be rejected as they are very likely to cause more
++ harm when nobody is able to tell whether or not the patch needs to be
++ backported or can be reverted in case of regression.
++
+ 12) Discuss on the mailing list
+
+ When submitting changes, please always CC the mailing list address so that
+--
+2.13.0
+
--- /dev/null
+From 8d99949c4c51d95c14fb2b09d18e1cff058f0c17 Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Tue, 18 Jul 2017 06:58:16 +0200
+Subject: [PATCH 07/18] DOC: update the list of OpenSSL versions in the README
+
+1.1.0 is also supported nowadays. Also mention the best effort support
+for derivatives.
+(cherry picked from commit 7ab16868bc6e9d5ef879e1046effa035789835cc)
+
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ README | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/README b/README
+index 839d06ec..8ad70e66 100644
+--- a/README
++++ b/README
+@@ -113,8 +113,12 @@ build fails due to missing symbols such as deflateInit(), then try again with
+ Your are strongly encouraged to always use an up-to-date version of OpenSSL, as
+ found on https://www.openssl.org/ as vulnerabilities are occasionally found and
+ you don't want them on your systems. HAProxy is known to build correctly on all
+-currently supported branches (0.9.8, 1.0.0, 1.0.1 and 1.0.2 at the time of
+-writing). Branch 1.0.2 is recommended for the richest features.
++currently supported branches (0.9.8, 1.0.0, 1.0.1, 1.0.2 and 1.1.0 at the time
++of writing). Branch 1.0.2 is currently recommended for the best combination of
++features and stability. Asynchronous engines require OpenSSL 1.1.0 though. It's
++worth mentionning that some OpenSSL derivatives are also reported to work but
++may occasionally break. Patches to fix them are welcome but please read the
++CONTRIBUTING file first.
+
+ To link OpenSSL statically against haproxy, build OpenSSL with the no-shared
+ keyword and install it to a local directory, so your system is not affected :
+--
+2.13.0
+
--- /dev/null
+From 3e21b8d25ad148ef4e6544f28a8b2305f9484a7b Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Wed, 19 Jul 2017 19:05:29 +0200
+Subject: [PATCH 08/18] MINOR: tools: add a portable timegm() alternative
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+timegm() is not provided everywhere and the documentation on how to
+replace it is bogus as it proposes an inefficient and non-thread safe
+alternative.
+
+Here we reimplement everything needed to compute the number of seconds
+since Epoch based on the broken down fields in struct tm. It is only
+guaranteed to return correct values for correct inputs. It was successfully
+tested with all possible 32-bit values of time_t converted to struct tm
+using gmtime() and back to time_t using the legacy timegm() and this
+function, and both functions always produced the same result.
+
+Thanks to Benoît Garnier for an instructive discussion and detailed
+explanations of the various time functions, leading to this solution.
+(cherry picked from commit cb1949b8b30b8db7e05546da2939eff2b5973321)
+
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ include/common/standard.h | 21 ++++++++++++++++++
+ src/standard.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 75 insertions(+)
+
+diff --git a/include/common/standard.h b/include/common/standard.h
+index 87f90a65..c19c368b 100644
+--- a/include/common/standard.h
++++ b/include/common/standard.h
+@@ -624,6 +624,27 @@ static inline void get_gmtime(const time_t now, struct tm *tm)
+ gmtime_r(&now, tm);
+ }
+
++/* Counts a number of elapsed days since 01/01/0000 based solely on elapsed
++ * years and assuming the regular rule for leap years applies. It's fake but
++ * serves as a temporary origin. It's worth remembering that it's the first
++ * year of each period that is leap and not the last one, so for instance year
++ * 1 sees 366 days since year 0 was leap. For this reason we have to apply
++ * modular arithmetics which is why we offset the year by 399 before
++ * subtracting the excess at the end. No overflow here before ~11.7 million
++ * years.
++ */
++static inline unsigned int days_since_zero(unsigned int y)
++{
++ return y * 365 + (y + 399) / 4 - (y + 399) / 100 + (y + 399) / 400
++ - 399 / 4 + 399 / 100;
++}
++
++/* Returns the number of seconds since 01/01/1970 0:0:0 GMT for GMT date <tm>.
++ * It is meant as a portable replacement for timegm() for use with valid inputs.
++ * Returns undefined results for invalid dates (eg: months out of range 0..11).
++ */
++extern time_t my_timegm(const struct tm *tm);
++
+ /* This function parses a time value optionally followed by a unit suffix among
+ * "d", "h", "m", "s", "ms" or "us". It converts the value into the unit
+ * expected by the caller. The computation does its best to avoid overflows.
+diff --git a/src/standard.c b/src/standard.c
+index 8df1da6c..e1d414f3 100644
+--- a/src/standard.c
++++ b/src/standard.c
+@@ -2841,6 +2841,60 @@ char *localdate2str_log(char *dst, time_t t, struct tm *tm, size_t size)
+ return dst;
+ }
+
++/* Returns the number of seconds since 01/01/1970 0:0:0 GMT for GMT date <tm>.
++ * It is meant as a portable replacement for timegm() for use with valid inputs.
++ * Returns undefined results for invalid dates (eg: months out of range 0..11).
++ */
++time_t my_timegm(const struct tm *tm)
++{
++ /* Each month has 28, 29, 30 or 31 days, or 28+N. The date in the year
++ * is thus (current month - 1)*28 + cumulated_N[month] to count the
++ * sum of the extra N days for elapsed months. The sum of all these N
++ * days doesn't exceed 30 for a complete year (366-12*28) so it fits
++ * in a 5-bit word. This means that with 60 bits we can represent a
++ * matrix of all these values at once, which is fast and efficient to
++ * access. The extra February day for leap years is not counted here.
++ *
++ * Jan : none = 0 (0)
++ * Feb : Jan = 3 (3)
++ * Mar : Jan..Feb = 3 (3 + 0)
++ * Apr : Jan..Mar = 6 (3 + 0 + 3)
++ * May : Jan..Apr = 8 (3 + 0 + 3 + 2)
++ * Jun : Jan..May = 11 (3 + 0 + 3 + 2 + 3)
++ * Jul : Jan..Jun = 13 (3 + 0 + 3 + 2 + 3 + 2)
++ * Aug : Jan..Jul = 16 (3 + 0 + 3 + 2 + 3 + 2 + 3)
++ * Sep : Jan..Aug = 19 (3 + 0 + 3 + 2 + 3 + 2 + 3 + 3)
++ * Oct : Jan..Sep = 21 (3 + 0 + 3 + 2 + 3 + 2 + 3 + 3 + 2)
++ * Nov : Jan..Oct = 24 (3 + 0 + 3 + 2 + 3 + 2 + 3 + 3 + 2 + 3)
++ * Dec : Jan..Nov = 26 (3 + 0 + 3 + 2 + 3 + 2 + 3 + 3 + 2 + 3 + 2)
++ */
++ uint64_t extra =
++ ( 0ULL << 0*5) + ( 3ULL << 1*5) + ( 3ULL << 2*5) + /* Jan, Feb, Mar, */
++ ( 6ULL << 3*5) + ( 8ULL << 4*5) + (11ULL << 5*5) + /* Apr, May, Jun, */
++ (13ULL << 6*5) + (16ULL << 7*5) + (19ULL << 8*5) + /* Jul, Aug, Sep, */
++ (21ULL << 9*5) + (24ULL << 10*5) + (26ULL << 11*5); /* Oct, Nov, Dec, */
++
++ unsigned int y = tm->tm_year + 1900;
++ unsigned int m = tm->tm_mon;
++ unsigned long days = 0;
++
++ /* days since 1/1/1970 for full years */
++ days += days_since_zero(y) - days_since_zero(1970);
++
++ /* days for full months in the current year */
++ days += 28 * m + ((extra >> (m * 5)) & 0x1f);
++
++ /* count + 1 after March for leap years. A leap year is a year multiple
++ * of 4, unless it's multiple of 100 without being multiple of 400. 2000
++ * is leap, 1900 isn't, 1904 is.
++ */
++ if ((m > 1) && !(y & 3) && ((y % 100) || !(y % 400)))
++ days++;
++
++ days += tm->tm_mday - 1;
++ return days * 86400ULL + tm->tm_hour * 3600 + tm->tm_min * 60 + tm->tm_sec;
++}
++
+ /* This function check a char. It returns true and updates
+ * <date> and <len> pointer to the new position if the
+ * character is found.
+--
+2.13.0
+
--- /dev/null
+From df1655a6c0e4431317cc66c67693281092a952b0 Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Wed, 19 Jul 2017 19:08:48 +0200
+Subject: [PATCH 09/18] BUILD: lua: replace timegm() with my_timegm() to fix
+ build on Solaris 10
+
+Akhnin Nikita reported that Lua doesn't build on Solaris 10 because
+the code uses timegm() to parse a date, which is not provided there.
+The recommended way to implement timegm() is broken in the man page,
+as it is based on a change of the TZ environment variable at run time
+before calling the function (which is obviously not thread safe, and
+terribly inefficient).
+
+Here instead we rely on the new my_timegm() function, it should be
+sufficient for all known use cases.
+(cherry picked from commit abd9bb20b76818c9f461a82b72b10818736ff8b3)
+
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ src/hlua_fcn.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
+index 58905d7d..fe899a4a 100644
+--- a/src/hlua_fcn.c
++++ b/src/hlua_fcn.c
+@@ -287,7 +287,7 @@ static int hlua_parse_date(lua_State *L, int (*fcn)(const char *, int, struct tm
+ * the timezone from the broken-down time, it must be fixed
+ * after the conversion.
+ */
+- time = timegm(&tm);
++ time = my_timegm(&tm);
+ if (time == -1) {
+ lua_pushnil(L);
+ return 1;
+--
+2.13.0
+
--- /dev/null
+From e14ec1d816de60b648dd7cb6c55b665f5163156b Mon Sep 17 00:00:00 2001
+From: ben51degrees <ben@51degrees.com>
+Date: Wed, 19 Jul 2017 16:22:04 +0100
+Subject: [PATCH 10/18] DOC: Updated 51Degrees git URL to point to a stable
+ version.
+
+The previously documented location doesn't work anymore and must not be
+used. Warning for backports, different branches are in use depending on
+the version (v3.2.10 for 1.7, v3.2.5 for 1.6).
+(cherry picked from commit ac752ff68cd3ac88a7a27ce17daa5c3f0c839694)
+
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+---
+ doc/51Degrees-device-detection.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/doc/51Degrees-device-detection.txt b/doc/51Degrees-device-detection.txt
+index 1ee912d9..71b2eb76 100644
+--- a/doc/51Degrees-device-detection.txt
++++ b/doc/51Degrees-device-detection.txt
+@@ -14,7 +14,7 @@ headers as configurable parameters.
+ In order to enable 51Degrees download the 51Degrees source code from the
+ official github repository :
+
+- git clone https://github.com/51Degrees/Device-Detection
++ git clone https://git.51Degrees.com/Device-Detection.git -b v3.2.10
+
+ then run 'make' with USE_51DEGREES and 51DEGREES_SRC set. Both 51DEGREES_INC
+ and 51DEGREES_LIB may additionally be used to force specific different paths
+--
+2.13.0
+
--- /dev/null
+From 9304b76fb37a36f6249ec963093d74210bd237f6 Mon Sep 17 00:00:00 2001
+From: Christopher Faulet <cfaulet@haproxy.com>
+Date: Tue, 18 Jul 2017 10:35:55 +0200
+Subject: [PATCH 11/18] BUG/MINOR: http: Set the response error state in
+ http_sync_res_state
+
+This is just typo. It may only report a wrong response message state in
+"show errors" on the CLI.
+
+This patch must be backported in 1.7.
+
+(cherry picked from commit a3992e06a6e74142d9784d18d8cb3527fadb64d6)
+Signed-off-by: William Lallemand <wlallemand@haproxy.org>
+---
+ src/proto_http.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index 94c8d639..796955f5 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -5530,7 +5530,7 @@ int http_sync_res_state(struct stream *s)
+ goto http_msg_closed;
+ }
+ else if (chn->flags & CF_SHUTW) {
+- txn->req.err_state = txn->req.msg_state;
++ txn->rsp.err_state = txn->rsp.msg_state;
+ txn->rsp.msg_state = HTTP_MSG_ERROR;
+ s->be->be_counters.cli_aborts++;
+ if (objt_server(s->target))
+--
+2.13.0
+
--- /dev/null
+From a49007a187ab7fddfcec58e1d9fc8a707e4531c9 Mon Sep 17 00:00:00 2001
+From: Christopher Faulet <cfaulet@haproxy.com>
+Date: Tue, 18 Jul 2017 11:18:46 +0200
+Subject: [PATCH 12/18] MINOR: http: Reorder/rewrite checks in
+ http_resync_states
+
+The previous patch removed the forced symmetry of the TUNNEL mode during the
+state synchronization. Here, we take care to remove body analyzer only on the
+channel in TUNNEL mode. In fact, today, this change has no effect because both
+sides are switched in same time. But this way, with some changes, it will be
+possible to keep body analyzer on a side (to finish the states synchronization)
+with the other one in TUNNEL mode.
+
+WARNING: This patch will be used to fix a bug. The fix will be commited in a
+very next commit. So if the fix is backported, this one must be backported too.
+
+(cherry picked from commit f77bb539d4846ab278269b99a3165a5608ca0cf4)
+Signed-off-by: William Lallemand <wlallemand@haproxy.org>
+---
+ src/proto_http.c | 48 +++++++++++++++++++++++++++++-------------------
+ 1 file changed, 29 insertions(+), 19 deletions(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index 796955f5..aaf9f648 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -5577,34 +5577,27 @@ int http_resync_states(struct stream *s)
+
+ /* OK, both state machines agree on a compatible state.
+ * There are a few cases we're interested in :
+- * - HTTP_MSG_TUNNEL on either means we have to disable both analysers
+ * - HTTP_MSG_CLOSED on both sides means we've reached the end in both
+ * directions, so let's simply disable both analysers.
+- * - HTTP_MSG_CLOSED on the response only means we must abort the
+- * request.
+- * - HTTP_MSG_CLOSED on the request and HTTP_MSG_DONE on the response
+- * with server-close mode means we've completed one request and we
+- * must re-initialize the server connection.
++ * - HTTP_MSG_CLOSED on the response only or HTTP_MSG_ERROR on either
++ * means we must abort the request.
++ * - HTTP_MSG_TUNNEL on either means we have to disable analyser on
++ * corresponding channel.
++ * - HTTP_MSG_DONE or HTTP_MSG_CLOSED on the request and HTTP_MSG_DONE
++ * on the response with server-close mode means we've completed one
++ * request and we must re-initialize the server connection.
+ */
+-
+- if (txn->req.msg_state == HTTP_MSG_TUNNEL ||
+- txn->rsp.msg_state == HTTP_MSG_TUNNEL ||
+- (txn->req.msg_state == HTTP_MSG_CLOSED &&
+- txn->rsp.msg_state == HTTP_MSG_CLOSED)) {
++ if (txn->req.msg_state == HTTP_MSG_CLOSED &&
++ txn->rsp.msg_state == HTTP_MSG_CLOSED) {
+ s->req.analysers &= AN_REQ_FLT_END;
+ channel_auto_close(&s->req);
+ channel_auto_read(&s->req);
+ s->res.analysers &= AN_RES_FLT_END;
+ channel_auto_close(&s->res);
+ channel_auto_read(&s->res);
+- if (txn->req.msg_state == HTTP_MSG_TUNNEL && HAS_REQ_DATA_FILTERS(s))
+- s->req.analysers |= AN_REQ_FLT_XFER_DATA;
+- if (txn->rsp.msg_state == HTTP_MSG_TUNNEL && HAS_RSP_DATA_FILTERS(s))
+- s->res.analysers |= AN_RES_FLT_XFER_DATA;
+- }
+- else if ((txn->req.msg_state >= HTTP_MSG_DONE &&
+- (txn->rsp.msg_state == HTTP_MSG_CLOSED || (s->res.flags & CF_SHUTW))) ||
+- txn->rsp.msg_state == HTTP_MSG_ERROR ||
++ }
++ else if (txn->rsp.msg_state == HTTP_MSG_CLOSED ||
++ txn->rsp.msg_state == HTTP_MSG_ERROR ||
+ txn->req.msg_state == HTTP_MSG_ERROR) {
+ s->res.analysers &= AN_RES_FLT_END;
+ channel_auto_close(&s->res);
+@@ -5615,6 +5608,23 @@ int http_resync_states(struct stream *s)
+ channel_auto_read(&s->req);
+ channel_truncate(&s->req);
+ }
++ else if (txn->req.msg_state == HTTP_MSG_TUNNEL ||
++ txn->rsp.msg_state == HTTP_MSG_TUNNEL) {
++ if (txn->req.msg_state == HTTP_MSG_TUNNEL) {
++ s->req.analysers &= AN_REQ_FLT_END;
++ if (HAS_REQ_DATA_FILTERS(s))
++ s->req.analysers |= AN_REQ_FLT_XFER_DATA;
++ }
++ if (txn->rsp.msg_state == HTTP_MSG_TUNNEL) {
++ s->res.analysers &= AN_RES_FLT_END;
++ if (HAS_RSP_DATA_FILTERS(s))
++ s->res.analysers |= AN_RES_FLT_XFER_DATA;
++ }
++ channel_auto_close(&s->req);
++ channel_auto_read(&s->req);
++ channel_auto_close(&s->res);
++ channel_auto_read(&s->res);
++ }
+ else if ((txn->req.msg_state == HTTP_MSG_DONE ||
+ txn->req.msg_state == HTTP_MSG_CLOSED) &&
+ txn->rsp.msg_state == HTTP_MSG_DONE &&
+--
+2.13.0
+
--- /dev/null
+From 1430a0c0f62fcff4303706f5baf2b544e00fcda3 Mon Sep 17 00:00:00 2001
+From: Christopher Faulet <cfaulet@haproxy.com>
+Date: Tue, 18 Jul 2017 10:48:24 +0200
+Subject: [PATCH 13/18] MINOR: http: Switch requests/responses in TUNNEL mode
+ only by checking txn flags
+
+Today, the only way to have a request or a response in HTTP_MSG_TUNNEL state is
+to have the flag TX_CON_WANT_TUN set on the transaction. So this is a symmetric
+state. Both the request and the response are switch in same time in this
+state. This can be done only by checking transaction flags instead of relying on
+the other side state. This is the purpose of this patch.
+
+This way, if for any reason we need to switch only one side in TUNNEL mode, it
+will be possible. And to prepare asymmetric cases, we check channel flags in
+DONE _AND_ TUNNEL states.
+
+WARNING: This patch will be used to fix a bug. The fix will be commited in a
+very next commit. So if the fix is backported, this one must be backported too.
+
+(cherry picked from commit 4be9803914ae7156109c915659aad216e4a3c6c1)
+Signed-off-by: William Lallemand <wlallemand@haproxy.org>
+---
+ src/proto_http.c | 65 +++++++++++++++++++-------------------------------------
+ 1 file changed, 22 insertions(+), 43 deletions(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index aaf9f648..00a92cdb 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -5294,7 +5294,7 @@ int http_sync_req_state(struct stream *s)
+ unsigned int old_flags = chn->flags;
+ unsigned int old_state = txn->req.msg_state;
+
+- if (unlikely(txn->req.msg_state < HTTP_MSG_BODY))
++ if (unlikely(txn->req.msg_state < HTTP_MSG_DONE))
+ return 0;
+
+ if (txn->req.msg_state == HTTP_MSG_DONE) {
+@@ -5338,13 +5338,6 @@ int http_sync_req_state(struct stream *s)
+ goto wait_other_side;
+ }
+
+- if (txn->rsp.msg_state == HTTP_MSG_TUNNEL) {
+- /* if any side switches to tunnel mode, the other one does too */
+- channel_auto_read(chn);
+- txn->req.msg_state = HTTP_MSG_TUNNEL;
+- goto wait_other_side;
+- }
+-
+ /* When we get here, it means that both the request and the
+ * response have finished receiving. Depending on the connection
+ * mode, we'll have to wait for the last bytes to leave in either
+@@ -5377,20 +5370,7 @@ int http_sync_req_state(struct stream *s)
+ }
+ }
+
+- if (chn->flags & (CF_SHUTW|CF_SHUTW_NOW)) {
+- /* if we've just closed an output, let's switch */
+- s->si[1].flags |= SI_FL_NOLINGER; /* we want to close ASAP */
+-
+- if (!channel_is_empty(chn)) {
+- txn->req.msg_state = HTTP_MSG_CLOSING;
+- goto http_msg_closing;
+- }
+- else {
+- txn->req.msg_state = HTTP_MSG_CLOSED;
+- goto http_msg_closed;
+- }
+- }
+- goto wait_other_side;
++ goto check_channel_flags;
+ }
+
+ if (txn->req.msg_state == HTTP_MSG_CLOSING) {
+@@ -5419,6 +5399,16 @@ int http_sync_req_state(struct stream *s)
+ goto wait_other_side;
+ }
+
++ check_channel_flags:
++ /* Here, we are in HTTP_MSG_DONE or HTTP_MSG_TUNNEL */
++ if (chn->flags & (CF_SHUTW|CF_SHUTW_NOW)) {
++ /* if we've just closed an output, let's switch */
++ s->si[1].flags |= SI_FL_NOLINGER; /* we want to close ASAP */
++ txn->req.msg_state = HTTP_MSG_CLOSING;
++ goto http_msg_closing;
++ }
++
++
+ wait_other_side:
+ return txn->req.msg_state != old_state || chn->flags != old_flags;
+ }
+@@ -5438,7 +5428,7 @@ int http_sync_res_state(struct stream *s)
+ unsigned int old_flags = chn->flags;
+ unsigned int old_state = txn->rsp.msg_state;
+
+- if (unlikely(txn->rsp.msg_state < HTTP_MSG_BODY))
++ if (unlikely(txn->rsp.msg_state < HTTP_MSG_DONE))
+ return 0;
+
+ if (txn->rsp.msg_state == HTTP_MSG_DONE) {
+@@ -5461,14 +5451,6 @@ int http_sync_res_state(struct stream *s)
+ goto wait_other_side;
+ }
+
+- if (txn->req.msg_state == HTTP_MSG_TUNNEL) {
+- /* if any side switches to tunnel mode, the other one does too */
+- channel_auto_read(chn);
+- txn->rsp.msg_state = HTTP_MSG_TUNNEL;
+- chn->flags |= CF_NEVER_WAIT;
+- goto wait_other_side;
+- }
+-
+ /* When we get here, it means that both the request and the
+ * response have finished receiving. Depending on the connection
+ * mode, we'll have to wait for the last bytes to leave in either
+@@ -5506,18 +5488,7 @@ int http_sync_res_state(struct stream *s)
+ txn->rsp.msg_state = HTTP_MSG_TUNNEL;
+ }
+
+- if (chn->flags & (CF_SHUTW|CF_SHUTW_NOW)) {
+- /* if we've just closed an output, let's switch */
+- if (!channel_is_empty(chn)) {
+- txn->rsp.msg_state = HTTP_MSG_CLOSING;
+- goto http_msg_closing;
+- }
+- else {
+- txn->rsp.msg_state = HTTP_MSG_CLOSED;
+- goto http_msg_closed;
+- }
+- }
+- goto wait_other_side;
++ goto check_channel_flags;
+ }
+
+ if (txn->rsp.msg_state == HTTP_MSG_CLOSING) {
+@@ -5548,6 +5519,14 @@ int http_sync_res_state(struct stream *s)
+ goto wait_other_side;
+ }
+
++ check_channel_flags:
++ /* Here, we are in HTTP_MSG_DONE or HTTP_MSG_TUNNEL */
++ if (chn->flags & (CF_SHUTW|CF_SHUTW_NOW)) {
++ /* if we've just closed an output, let's switch */
++ txn->rsp.msg_state = HTTP_MSG_CLOSING;
++ goto http_msg_closing;
++ }
++
+ wait_other_side:
+ /* We force the response to leave immediately if we're waiting for the
+ * other side, since there is no pending shutdown to push it out.
+--
+2.13.0
+
--- /dev/null
+From f82344c1cf20afcf77e8c3df8f9d341d659da93b Mon Sep 17 00:00:00 2001
+From: Christopher Faulet <cfaulet@haproxy.com>
+Date: Tue, 18 Jul 2017 11:42:08 +0200
+Subject: [PATCH 14/18] BUG/MEDIUM: http: Switch HTTP responses in TUNNEL mode
+ when body length is undefined
+
+When the body length of a HTTP response is undefined, the HTTP parser is blocked
+in the body parsing. Before HAProxy 1.7, in this case, because
+AN_RES_HTTP_XFER_BODY is never set, there is no visible effect. When the server
+closes its connection to terminate the response, HAProxy catches it as a normal
+closure. Since 1.7, we always set this analyzer to enter at least once in
+http_response_forward_body. But, in the present case, when the server connection
+is closed, http_response_forward_body is called one time too many. The response
+is correctly sent to the client, but an error is catched and logged with "SD--"
+flags.
+
+To reproduce the bug, you can use the configuration "tests/test-fsm.cfg". The
+tests 3 and 21 hit the bug.
+
+Idea to fix the bug is to switch the response in TUNNEL mode without switching
+the request. This is possible because of previous patches.
+
+First, we need to detect responses with undefined body length during states
+synchronization. Excluding tunnelled transactions, when the response length is
+undefined, TX_CON_WANT_CLO is always set on the transaction. So, when states are
+synchronized, if TX_CON_WANT_CLO is set, the response is switched in TUNNEL mode
+and the request remains unchanged.
+
+Then, in http_msg_forward_body, we add a specific check to switch the response
+in DONE mode if the body length is undefined and if there is no data filter.
+
+This patch depends on following previous commits:
+
+ * MINOR: http: Switch requests/responses in TUNNEL mode only by checking txn flags
+ * MINOR: http: Reorder/rewrite checks in http_resync_states
+
+This patch must be backported in 1.7 with 2 previous ones.
+
+(cherry picked from commit 1486b0ab6de744e14ae684af105951345534f9ec)
+Signed-off-by: William Lallemand <wlallemand@haproxy.org>
+---
+ src/proto_http.c | 37 +++++++++++++++++++++++++------------
+ 1 file changed, 25 insertions(+), 12 deletions(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index 00a92cdb..e776e4d5 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -5354,7 +5354,16 @@ int http_sync_req_state(struct stream *s)
+ * let's enforce it now that we're not expecting any new
+ * data to come. The caller knows the stream is complete
+ * once both states are CLOSED.
++ *
++ * However, there is an exception if the response
++ * length is undefined. In this case, we need to wait
++ * the close from the server. The response will be
++ * switched in TUNNEL mode until the end.
+ */
++ if (!(txn->rsp.flags & HTTP_MSGF_XFER_LEN) &&
++ txn->rsp.msg_state != HTTP_MSG_CLOSED)
++ goto check_channel_flags;
++
+ if (!(chn->flags & (CF_SHUTW|CF_SHUTW_NOW))) {
+ channel_shutr_now(chn);
+ channel_shutw_now(chn);
+@@ -5471,8 +5480,16 @@ int http_sync_res_state(struct stream *s)
+ * let's enforce it now that we're not expecting any new
+ * data to come. The caller knows the stream is complete
+ * once both states are CLOSED.
++ *
++ * However, there is an exception if the response length
++ * is undefined. In this case, we switch in TUNNEL mode.
+ */
+- if (!(chn->flags & (CF_SHUTW|CF_SHUTW_NOW))) {
++ if (!(txn->rsp.flags & HTTP_MSGF_XFER_LEN)) {
++ channel_auto_read(chn);
++ txn->rsp.msg_state = HTTP_MSG_TUNNEL;
++ chn->flags |= CF_NEVER_WAIT;
++ }
++ else if (!(chn->flags & (CF_SHUTW|CF_SHUTW_NOW))) {
+ channel_shutr_now(chn);
+ channel_shutw_now(chn);
+ }
+@@ -6952,14 +6969,6 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit
+ if ((msg->flags & HTTP_MSGF_TE_CHNK) || (msg->flags & HTTP_MSGF_COMPRESSING))
+ res->flags |= CF_EXPECT_MORE;
+
+- /* If there is neither content-length, nor transfer-encoding header
+- * _AND_ there is no data filtering, we can safely forward all data
+- * indefinitely. */
+- if (!(msg->flags & HTTP_MSGF_XFER_LEN) && !HAS_DATA_FILTERS(s, res)) {
+- buffer_flush(res->buf);
+- channel_forward_forever(res);
+- }
+-
+ /* the stream handler will take care of timeouts and errors */
+ return 0;
+
+@@ -7036,9 +7045,13 @@ http_msg_forward_body(struct stream *s, struct http_msg *msg)
+ goto missing_data_or_waiting;
+ }
+
+- /* The server still sending data that should be filtered */
+- if (!(msg->flags & HTTP_MSGF_XFER_LEN) && !(chn->flags & CF_SHUTR))
+- goto missing_data_or_waiting;
++ /* This check can only be true for a response. HTTP_MSGF_XFER_LEN is
++ * always set for a request. */
++ if (!(msg->flags & HTTP_MSGF_XFER_LEN)) {
++ /* The server still sending data that should be filtered */
++ if (!(chn->flags & CF_SHUTR) && HAS_DATA_FILTERS(s, chn))
++ goto missing_data_or_waiting;
++ }
+
+ msg->msg_state = HTTP_MSG_ENDING;
+
+--
+2.13.0
+
--- /dev/null
+From af9b52e92be8ca6a07f9156dcb0b08dd2ad8db75 Mon Sep 17 00:00:00 2001
+From: Christopher Faulet <cfaulet@haproxy.com>
+Date: Thu, 20 Jul 2017 11:05:10 +0200
+Subject: [PATCH 15/18] BUG/MAJOR: http: Fix possible infinity loop in
+ http_sync_(req|res)_state
+
+In commit "MINOR: http: Switch requests/responses in TUNNEL mode only by
+checking txn flags", it is possible to have an infinite loop on HTTP_MSG_CLOSING
+state.
+
+(cherry picked from commit 56d260916f61e48c8b2f1fd2f9431afac776d160)
+Signed-off-by: William Lallemand <wlallemand@haproxy.org>
+---
+ src/proto_http.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index e776e4d5..4a030013 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -5394,8 +5394,8 @@ int http_sync_req_state(struct stream *s)
+ else if (chn->flags & CF_SHUTW) {
+ txn->req.err_state = txn->req.msg_state;
+ txn->req.msg_state = HTTP_MSG_ERROR;
+- goto wait_other_side;
+ }
++ goto wait_other_side;
+ }
+
+ if (txn->req.msg_state == HTTP_MSG_CLOSED) {
+@@ -5523,8 +5523,8 @@ int http_sync_res_state(struct stream *s)
+ s->be->be_counters.cli_aborts++;
+ if (objt_server(s->target))
+ objt_server(s->target)->counters.cli_aborts++;
+- goto wait_other_side;
+ }
++ goto wait_other_side;
+ }
+
+ if (txn->rsp.msg_state == HTTP_MSG_CLOSED) {
+--
+2.13.0
+
--- /dev/null
+From c00347899e9f0c3420f98c53eab1469644e28e06 Mon Sep 17 00:00:00 2001
+From: Nenad Merdanovic <nmerdan@haproxy.com>
+Date: Sun, 23 Jul 2017 22:04:58 -0400
+Subject: [PATCH 16/18] BUG/MINOR: lua: Fix Server.get_addr() port values
+
+The get_addr() method of the Lua Server class was using the
+'sockaddr_storage addr' member to get the port value. HAProxy does not
+store ports in this member as it uses a separate member, called
+'svc_port'.
+
+This fix should be backported to 1.7.
+
+(cherry picked from commit 3849473828f319829aff422d2fbbce0823e65d64)
+Signed-off-by: William Lallemand <wlallemand@haproxy.org>
+---
+ src/hlua_fcn.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
+index fe899a4a..0752220e 100644
+--- a/src/hlua_fcn.c
++++ b/src/hlua_fcn.c
+@@ -545,8 +545,7 @@ int hlua_server_get_addr(lua_State *L)
+ addr, INET_ADDRSTRLEN);
+ luaL_addstring(&b, addr);
+ luaL_addstring(&b, ":");
+- snprintf(addr, INET_ADDRSTRLEN, "%d",
+- ntohs(((struct sockaddr_in *)&srv->addr)->sin_port));
++ snprintf(addr, INET_ADDRSTRLEN, "%d", srv->svc_port);
+ luaL_addstring(&b, addr);
+ break;
+ case AF_INET6:
+@@ -554,8 +553,7 @@ int hlua_server_get_addr(lua_State *L)
+ addr, INET_ADDRSTRLEN);
+ luaL_addstring(&b, addr);
+ luaL_addstring(&b, ":");
+- snprintf(addr, INET_ADDRSTRLEN, "%d",
+- ntohs(((struct sockaddr_in6 *)&srv->addr)->sin6_port));
++ snprintf(addr, INET_ADDRSTRLEN, "%d", srv->svc_port);
+ luaL_addstring(&b, addr);
+ break;
+ case AF_UNIX:
+--
+2.13.0
+
--- /dev/null
+From e79fe9bc0ae363e91555f1ba64889e2ddf475b8e Mon Sep 17 00:00:00 2001
+From: Nenad Merdanovic <nmerdan@haproxy.com>
+Date: Sun, 23 Jul 2017 22:04:59 -0400
+Subject: [PATCH 17/18] BUG/MINOR: lua: Correctly use INET6_ADDRSTRLEN in
+ Server.get_addr()
+
+The get_addr() method of the Lua Server class incorrectly used
+INET_ADDRSTRLEN for IPv6 addresses resulting in failing to convert
+longer IPv6 addresses to strings.
+
+This fix should be backported to 1.7.
+
+(cherry picked from commit a9f040453acc09e888c3f2dc983f15dcf3fa66e3)
+Signed-off-by: William Lallemand <wlallemand@haproxy.org>
+---
+ src/hlua_fcn.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
+index 0752220e..f8b9b5ec 100644
+--- a/src/hlua_fcn.c
++++ b/src/hlua_fcn.c
+@@ -550,7 +550,7 @@ int hlua_server_get_addr(lua_State *L)
+ break;
+ case AF_INET6:
+ inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&srv->addr)->sin6_addr,
+- addr, INET_ADDRSTRLEN);
++ addr, INET6_ADDRSTRLEN);
+ luaL_addstring(&b, addr);
+ luaL_addstring(&b, ":");
+ snprintf(addr, INET_ADDRSTRLEN, "%d", srv->svc_port);
+--
+2.13.0
+
--- /dev/null
+From dd18f945c26fc30872a52c66b06b5a0a86b10060 Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Mon, 24 Jul 2017 17:35:27 +0200
+Subject: [PATCH 18/18] BUG/MINOR: lua: always detach the tcp/http tasks before
+ freeing them
+
+In hlua_{http,tcp}_applet_release(), a call to task_free() is performed
+to release the task, but no task_delete() is made on these tasks. Till
+now it wasn't much of a problem because this was normally not done with
+the task in the run queue, and the task was never put into the wait queue
+since it doesn't have any timer. But with threading it will become an
+issue. And not having this already prevents another bug from being fixed.
+
+Thanks to Christopher for spotting this one. A backport to 1.7 and 1.6 is
+preferred for safety.
+
+(cherry picked from commit bd7fc95edbce821f1d7b745a7b75deef4d6b1e27)
+Signed-off-by: William Lallemand <wlallemand@haproxy.org>
+---
+ src/hlua.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/hlua.c b/src/hlua.c
+index a998860e..67b9458c 100644
+--- a/src/hlua.c
++++ b/src/hlua.c
+@@ -5948,6 +5948,7 @@ error:
+
+ static void hlua_applet_tcp_release(struct appctx *ctx)
+ {
++ task_delete(ctx->ctx.hlua_apptcp.task);
+ task_free(ctx->ctx.hlua_apptcp.task);
+ ctx->ctx.hlua_apptcp.task = NULL;
+ hlua_ctx_destroy(&ctx->ctx.hlua_apptcp.hlua);
+@@ -6226,6 +6227,7 @@ error:
+
+ static void hlua_applet_http_release(struct appctx *ctx)
+ {
++ task_delete(ctx->ctx.hlua_apphttp.task);
+ task_free(ctx->ctx.hlua_apphttp.task);
+ ctx->ctx.hlua_apphttp.task = NULL;
+ hlua_ctx_destroy(&ctx->ctx.hlua_apphttp.hlua);
+--
+2.13.0
+
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-git.tar.gz
+PKG_MIRROR_HASH:=3a677e504e8a1f27c899dfbf39da8c94412b24b08bb2eab0de7807cef07d078b
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=git://github.com/br101/horst.git
PKG_SOURCE_PROTO:=git
PKG_NAME:=htpdate
PKG_VERSION:=1.1.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.vervest.org/htp/archive/c/
-PKG_MD5SUM:=c612f63282e3f23b709f37a5c81d4739
+PKG_HASH:=0d75f91cb61f8869c8298d198fa52b9a139ae505b366e9d4d331af8bc1c04880
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=
CATEGORY:=Network
TITLE:=an HTP (Hypertext Time Protocol) implementation
URL:=http://www.vervest.com/htp/
- MAINTAINER:=Tijs Van Buggenhout <tvbuggen@netzerk.be>
+ MAINTAINER:=Tijs Van Buggenhout <tvbuggen@netzerk.be>, \
+ Marcin Jurkowski <marcin1j@gmail.com>
endef
define Package/htpdate/description
endef
define Package/htpdate/conffiles
-/etc/default/htpdate
+/etc/config/htpdate
endef
define Build/Compile
define Package/htpdate/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/htpdate $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/etc/default/
- $(INSTALL_CONF) ./files/htpdate.default $(1)/etc/default/htpdate
+ $(INSTALL_DIR) $(1)/etc/config/
+ $(INSTALL_CONF) ./files/htpdate.conf $(1)/etc/config/htpdate
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) ./files/htpdate.init $(1)/etc/init.d/htpdate
endef
--- /dev/null
+config htpdate 'htpdate'
+ option enabled 1
+ list server 'www.google.com'
+ list server 'www.yahoo.com'
+ list server 'www.linux.com'
+ list server 'www.freebsd.org'
+ option proxy_host ''
+ option proxy_port '8080'
+ option debug 0
+ option sanity_check 1
+ #list option '-4'
+++ /dev/null
-OPTIONS="www.google.com www.yahoo.com www.linux.org www.freebsd.org"
# Copyright (C) 2006 OpenWrt.org
START=49
-BIN=htpdate
-DEFAULT=/etc/default/$BIN
-RUN_D=/var/run
-PID_F=$RUN_D/$BIN.pid
-
-start() {
- [ -f $DEFAULT ] && . $DEFAULT
- mkdir -p $RUN_D
- $BIN -l -s -t $OPTIONS && $BIN -D $OPTIONS
+USE_PROCD=1
+PROG=/usr/sbin/htpdate
+
+
+
+
+validate_htpdate_section() {
+ uci_validate_section htpdate htpdate "${1}" \
+ 'server:list(host)' \
+ 'proxy_host:host' \
+ 'proxy_port:port:8080' \
+ 'debug:bool:0' \
+ 'sanity_check:bool:1' \
+ 'option:list(string)' \
+ 'enabled:bool:1'
}
-stop() {
- [ -f $PID_F ] && kill $(cat $PID_F)
+
+start_service() {
+ local server proxy debug sanity_check option enabled
+
+ validate_htpdate_section htpdate || {
+ echo "validation failed"
+ return 1
+ }
+
+ [ "$enabled" = 0 ] && return
+
+
+ procd_open_instance
+ procd_set_param command "$PROG" -f
+
+ [ -n "$proxy" ] && procd_append_param command -P $proxy:$proxy_port
+ [ "$debug" = "1" ] && procd_append_param command -d
+ [ "$sanity_check" = "0" ] && procd_append_param command -t
+ [ -n "$option" ] && procd_append_param command $option
+ for peer in $server; do
+ procd_append_param command $peer
+ done
+
+ procd_set_param stdout 1
+ procd_set_param stderr 1
+ procd_set_param respawn
+ procd_close_instance
}
+service_triggers() {
+ procd_add_reload_trigger "htpdate"
+ procd_add_validation validate_htpdate_section
+}
--- /dev/null
+--- a/htpdate.c
++++ b/htpdate.c
+@@ -395,6 +395,7 @@ Usage: htpdate [-046abdhlqstxD] [-i pid
+ -b burst mode\n\
+ -d debug mode\n\
+ -D daemon mode\n\
++ -f run in foreground\n\
+ -h help\n\
+ -i pid file\n\
+ -l use syslog for output\n\
+@@ -510,7 +511,7 @@ int main( int argc, char *argv[] ) {
+
+
+ /* Parse the command line switches and arguments */
+- while ( (param = getopt(argc, argv, "046abdhi:lm:p:qstu:xDM:P:") ) != -1)
++ while ( (param = getopt(argc, argv, "046abdhi:lm:p:qstu:xDfM:P:") ) != -1)
+ switch( param ) {
+
+ case '0': /* HTTP/1.0 */
+@@ -593,6 +594,9 @@ int main( int argc, char *argv[] ) {
+ daemonize = 1;
+ logmode = 1;
+ break;
++ case 'f': /* run in foreground */
++ daemonize = 2;
++ break;
+ case 'M': /* maximum poll interval */
+ if ( ( maxsleep = atoi(optarg) ) <= 0 ) {
+ fputs( "Invalid sleep time\n", stderr );
+@@ -631,7 +635,9 @@ int main( int argc, char *argv[] ) {
+
+ /* Run as a daemonize when -D is set */
+ if ( daemonize ) {
+- runasdaemon( pidfile );
++ if ( daemonize == 1 ) {
++ runasdaemon( pidfile );
++ }
+ /* Query only mode doesn't exist in daemon mode */
+ if ( !setmode )
+ setmode = 1;
--- /dev/null
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=httping
+PKG_VERSION:=2.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://www.vanheusden.com/httping
+PKG_HASH:=3e895a0a6d7bd79de25a255a1376d4da88eb09c34efdd0476ab5a907e75bfaf8
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/httping/Default
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=Httping is like 'ping' but for http-requests
+ URL:=http://www.vanheusden.com/httping/
+ DEPENDS:=$(INTL_DEPENDS)
+ MAINTAINER:=Marcin Jurkowski <marcin1j@gmail.com>
+endef
+
+define Package/httping/Default/description
+ Give it an url, and it'll show you how long it takes to connect, send a
+ request and retrieve the reply (only the headers). Be aware that the
+ transmission across the network also takes time!
+endef
+
+define Package/httping
+ $(call Package/httping/Default)
+ DEPENDS+= +libopenssl
+ TITLE+= (with SSL support)
+ VARIANT:=ssl
+endef
+
+define Package/httping/description
+ $(call Package/httping/Default/description)
+ This package is built with SSL support.
+endef
+
+define Package/httping-nossl
+ $(call Package/httping/Default)
+ TITLE+= (without SSL support)
+ VARIANT:=nossl
+endef
+
+define Package/httping-nossl/description
+ $(call Package/httping/Default/description)
+ This package is built without SSL support.
+endef
+
+define Build/Configure
+endef
+
+TARGET_LDFLAGS += $(INTL_LDFLAGS) $(if $(INTL_FULL),-lintl)
+
+MAKE_FLAGS += \
+ DEBUG="no" \
+ FW="no" \
+ NC="no" \
+ TFO="no" \
+ JSON="no" \
+ NAGIOS="no" \
+ HELP="yes" \
+ FULLHELP="no"
+
+
+ifeq ($(BUILD_VARIANT),nossl)
+ MAKE_FLAGS += SSL="no"
+endif
+
+define Package/httping/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/httping $(1)/usr/bin/
+endef
+
+Package/httping-nossl/install = $(Package/httping/install)
+
+$(eval $(call BuildPackage,httping))
+$(eval $(call BuildPackage,httping-nossl))
--- /dev/null
+--- a/Makefile
++++ b/Makefile
+@@ -115,9 +115,6 @@ install: $(TARGET) $(TRANSLATIONS)
+ $(INSTALLMAN) $(MAN_RU) $(DESTDIR)/$(MANDIR)/ru/man1
+ $(INSTALLDIR) $(DESTDIR)/$(DOCDIR)
+ $(INSTALLDOC) $(DOCS) $(DESTDIR)/$(DOCDIR)
+-ifneq ($(DEBUG),yes)
+- $(STRIP) $(DESTDIR)/$(BINDIR)/$(TARGET)
+-endif
+ mkdir -p $(DESTDIR)/$(PREFIX)/share/locale/nl/LC_MESSAGES
+ cp nl.mo $(DESTDIR)/$(PREFIX)/share/locale/nl/LC_MESSAGES/httping.mo
+ mkdir -p $(DESTDIR)/$(PREFIX)/share/locale/ru/LC_MESSAGES
--- /dev/null
+--- a/http.c
++++ b/http.c
+@@ -4,6 +4,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <stdlib.h>
+ #ifndef NO_SSL
+ #include <openssl/ssl.h>
+ #include "mssl.h"
--- /dev/null
+--- a/utils.c
++++ b/utils.c
+@@ -18,12 +18,11 @@
+ double get_ts(void)
+ {
+ struct timeval ts;
+- struct timezone tz;
+
+- if (gettimeofday(&ts, &tz) == -1)
++ if (gettimeofday(&ts, NULL) == -1)
+ error_exit(gettext("gettimeofday failed"));
+
+- return (double)ts.tv_sec + ((double)ts.tv_usec)/1000000.0 + (double)(tz.tz_minuteswest * 60);
++ return (double)ts.tv_sec + ((double)ts.tv_usec)/1000000.0;
+ }
+
+ void split_string(const char *in, const char *split, char ***list, int *list_n)
--- /dev/null
+--- a/main.c
++++ b/main.c
+@@ -51,25 +51,40 @@ volatile int stop = 0;
+
+ int quiet = 0;
+ char machine_readable = 0;
++#ifdef ENABLE_JSON
+ char json_output = 0;
++#else
++#define json_output 0
++#endif
+ char show_ts = 0;
+
++#ifdef ENABLE_HELP_FORMAT
+ int max_x = 80, max_y = 24;
++#endif
+
++#ifdef ENABLE_NAGIOS
+ char nagios_mode = 0;
++#else
++#define nagios_mode 0
++#endif
++#ifdef NC
+ char ncurses_mode = 0;
++#else
++#define ncurses_mode 0
++#endif
+
+ int fd = -1;
+
+ volatile char got_sigquit = 0;
+
+-void handler_quit(int s)
++void handler_quit()
+ {
+ signal(SIGQUIT, handler_quit);
+
+ got_sigquit = 1;
+ }
+
++#ifdef ENABLE_HELP_FORMAT
+ void determine_terminal_size(int *max_y, int *max_x)
+ {
+ struct winsize size;
+@@ -104,6 +119,7 @@ void determine_terminal_size(int *max_y,
+ *max_y = 24;
+ }
+ }
++#endif
+
+ void emit_statuslines(double run_time)
+ {
+@@ -159,6 +175,7 @@ void emit_headers(char *in)
+ #endif
+ }
+
++#ifdef ENABLE_JSON
+ void emit_json(char ok, int seq, double start_ts, stats_t *t_resolve, stats_t *t_connect, stats_t *t_request, int http_code, const char *msg, int header_size, int data_size, double Bps, const char *host, const char *ssl_fp, double toff_diff_ts, char tfo_success, stats_t *t_ssl, stats_t *t_write, stats_t *t_close, int n_cookies, stats_t *stats_to, stats_t *tcp_rtt_stats, int re_tx, int pmtu, int recv_tos, stats_t *t_total)
+ {
+ if (seq > 1)
+@@ -203,6 +220,7 @@ void emit_json(char ok, int seq, double
+ printf("\"tos\" : \"%02x\" ", recv_tos);
+ printf("}");
+ }
++#endif
+
+ char *get_ts_str(int verbose)
+ {
+@@ -240,8 +258,13 @@ void emit_error(int verbose, int seq, do
+ if (!quiet && !machine_readable && !nagios_mode && !json_output)
+ printf("%s%s%s%s\n", ts ? ts : "", c_error, get_error(), c_normal);
+
++#ifdef ENABLE_JSON
+ if (json_output)
+ emit_json(0, seq, start_ts, NULL, NULL, NULL, -1, get_error(), -1, -1, -1, "", "", -1, 0, NULL, NULL, NULL, 0, NULL, NULL, 0, 0, 0, NULL);
++#else
++ (void) seq;
++ (void) start_ts;
++#endif
+
+ clear_error();
+
+@@ -590,6 +613,7 @@ void fetch_proxy_settings(char **proxy_u
+ }
+ }
+
++#ifdef ENABLE_NAGIOS
+ void parse_nagios_settings(const char *in, double *nagios_warn, double *nagios_crit)
+ {
+ char *dummy = strchr(in, ',');
+@@ -600,6 +624,7 @@ void parse_nagios_settings(const char *i
+
+ *nagios_crit = atof(dummy + 1);
+ }
++#endif
+
+ void parse_bind_to(const char *in, struct sockaddr_in *bind_to_4, struct sockaddr_in6 *bind_to_6, struct sockaddr_in **bind_to)
+ {
+@@ -722,6 +747,7 @@ char check_compressed(const char *reply)
+ return 0;
+ }
+
++#ifdef ENABLE_NAGIOS
+ int nagios_result(int ok, int nagios_mode, int nagios_exit_code, double avg_httping_time, double nagios_warn, double nagios_crit)
+ {
+ if (nagios_mode == 1)
+@@ -762,6 +788,7 @@ int nagios_result(int ok, int nagios_mod
+
+ return -1;
+ }
++#endif
+
+ void proxy_to_host_and_port(char *in, char **proxy_host, int *proxy_port)
+ {
+@@ -896,8 +923,10 @@ int main(int argc, char *argv[])
+ int n_static_cookies = 0, n_dynamic_cookies = 0;
+ char resolve_once = 0;
+ char have_resolved = 0;
++#ifdef ENABLE_NAGIOS
+ double nagios_warn=0.0, nagios_crit=0.0;
+ int nagios_exit_code = 2;
++#endif
+ double avg_httping_time = -1.0;
+ int get_instead_of_head = 0;
+ char show_Bps = 0, ask_compression = 0;
+@@ -928,9 +957,17 @@ int main(int argc, char *argv[])
+ stats_t t_connect, t_request, t_total, t_resolve, t_write, t_ssl, t_close, stats_to, tcp_rtt_stats, stats_header_size;
+ char first_resolve = 1;
+ double graph_limit = MY_DOUBLE_INF;
++#ifdef NC
++#ifdef FW
+ char nc_graph = 1;
++#else
++ #define nc_graph 1
++#endif
++#endif
+ char adaptive_interval = 0;
++#ifdef NC
+ double show_slow_log = MY_DOUBLE_INF;
++#endif
+ char use_tcp_nodelay = 1;
+ int max_mtu = -1;
+ int write_sleep = 500; /* in us (microseconds), determines resolution of transmit time determination */
+@@ -980,8 +1017,10 @@ int main(int argc, char *argv[])
+ {"user-agent", 1, NULL, 'I' },
+ {"referer", 1, NULL, 'S' },
+ {"resolve-once",0, NULL, 'r' },
++#ifdef ENABLE_NAGIOS
+ {"nagios-mode-1", 1, NULL, 'n' },
+ {"nagios-mode-2", 1, NULL, 'n' },
++#endif
+ {"bind-to", 1, NULL, 'y' },
+ {"quiet", 0, NULL, 'q' },
+ {"username", 1, NULL, 'U' },
+@@ -1052,7 +1091,9 @@ int main(int argc, char *argv[])
+ #endif
+ init_statst(&stats_header_size);
+
++#ifdef ENABLE_HELP_FORMAT
+ determine_terminal_size(&max_y, &max_x);
++#endif
+
+ signal(SIGPIPE, SIG_IGN);
+
+@@ -1108,11 +1149,11 @@ int main(int argc, char *argv[])
+ case 14:
+ draw_phase = 1;
+ break;
+-#endif
+
+ case 13:
+ show_slow_log = atof(optarg);
+ break;
++#endif
+
+ case 12:
+ adaptive_interval = 1;
+@@ -1144,9 +1185,11 @@ int main(int argc, char *argv[])
+ fprintf(stderr, gettext("\n *** -A is no longer required ***\n\n"));
+ break;
+
++#ifdef ENABLE_JSON
+ case 'M':
+ json_output = 1;
+ break;
++#endif
+
+ case 'v':
+ verbose++;
+@@ -1338,6 +1381,7 @@ int main(int argc, char *argv[])
+ version();
+ return 0;
+
++#ifdef ENABLE_NAGIOS
+ case 'n':
+ if (nagios_mode)
+ error_exit(gettext("-n and -N are mutual exclusive\n"));
+@@ -1352,6 +1396,7 @@ int main(int argc, char *argv[])
+ nagios_mode = 2;
+ nagios_exit_code = atoi(optarg);
+ break;
++#endif
+
+ case 'P':
+ auth_password = optarg;
+@@ -1497,8 +1542,10 @@ int main(int argc, char *argv[])
+ printf("PING %s%s:%s%d%s (%s):\n", c_green, hostname, c_bright, portnr, c_normal, get);
+ }
+
++#ifdef ENABLE_JSON
+ if (json_output)
+ printf("[\n");
++#endif
+
+ if (adaptive_interval && wait <= 0.0)
+ error_exit(gettext("Interval must be > 0 when using adaptive interval"));
+@@ -1593,7 +1640,10 @@ int main(int argc, char *argv[])
+ int age = -1;
+ char *sc = NULL, *scdummy = NULL;
+ char *fp = NULL;
+- int re_tx = 0, pmtu = 0, recv_tos = 0;
++ int recv_tos = 0;
++#if defined(NC) || defined(ENABLE_JSON)
++ int re_tx = 0, pmtu = 0;
++#endif
+ socklen_t recv_tos_len = sizeof recv_tos;
+
+ dstart = get_ts();
+@@ -1607,7 +1657,9 @@ int main(int argc, char *argv[])
+ char req_sent = 0;
+ double dummy_ms = 0.0;
+ double their_est_ts = -1.0, toff_diff_ts = -1.0;
++#if defined(ENABLE_JSON) || defined(TCP_TFO)
+ char tfo_success = 0;
++#endif
+ double ssl_handshake = 0.0;
+ char cur_have_resolved = 0;
+ #if defined(linux) || defined(__FreeBSD__)
+@@ -2114,7 +2166,7 @@ persistent_loop:
+
+ update_statst(&tcp_rtt_stats, (double)info.tcpi_rtt / 1000.0);
+
+-#ifdef linux
++#if defined(linux) && (defined(NC) || defined(ENABLE_JSON))
+ re_tx = info.tcpi_retransmits;
+ pmtu = info.tcpi_pmtu;
+ #endif
+@@ -2134,6 +2186,7 @@ persistent_loop:
+ toff_diff_ts = ((double)their_ts - their_est_ts) * 1000.0;
+ update_statst(&stats_to, toff_diff_ts);
+
++#ifdef ENABLE_JSON
+ if (json_output)
+ {
+ char current_host[4096] = { 0 };
+@@ -2145,7 +2198,9 @@ persistent_loop:
+
+ emit_json(1, curncount, dstart, &t_resolve, &t_connect, &t_request, atoi(sc ? sc : "-1"), sc ? sc : "?", headers_len, len, Bps, current_host, fp, toff_diff_ts, tfo_success, &t_ssl, &t_write, &t_close, n_dynamic_cookies, &stats_to, &tcp_rtt_stats, re_tx, pmtu, recv_tos, &t_total);
+ }
+- else if (machine_readable)
++ else
++#endif
++ if (machine_readable)
+ {
+ if (sc)
+ {
+@@ -2404,14 +2459,18 @@ persistent_loop:
+ stats_line(1, complete_url, count, curncount, err, ok, started_at, verbose, &t_total, avg_httping_time, show_Bps ? &bps : NULL);
+
+ error_exit:
++#ifdef ENABLE_NAGIOS
+ if (nagios_mode)
+ return nagios_result(ok, nagios_mode, nagios_exit_code, avg_httping_time, nagios_warn, nagios_crit);
++#endif
+
+ if (!json_output && !machine_readable)
+ printf("%s", c_very_normal);
+
++#ifdef ENABLE_JSON
+ if (json_output)
+ printf("\n]\n");
++#endif
+
+ free_cookies(static_cookies, n_static_cookies);
+ free_cookies(dynamic_cookies, n_dynamic_cookies);
+--- a/help.c
++++ b/help.c
+@@ -93,6 +93,8 @@ void version(void)
+ fprintf(stderr, gettext("\n"));
+ }
+
++#ifdef ENABLE_HELP
++#ifdef ENABLE_HELP_FORMAT
+ void format_help(const char *short_str, const char *long_str, const char *descr)
+ {
+ int par_width = SWITCHES_COLUMN_WIDTH, max_wrap_width = par_width / 2, cur_par_width = 0;
+@@ -167,9 +169,30 @@ void format_help(const char *short_str,
+ p = n;
+ }
+ }
++#else
++void format_help(const char *short_str, const char *long_str, const char *descr)
++{
++ if (short_str)
++ {
++ fputs(short_str, stderr);
++ fputc(' ', stderr);
++ }
++
++ if (long_str)
++ {
++ fputs(long_str, stderr);
++ fputc(' ', stderr);
++ }
++
++ fputs(descr, stderr);
++ fputc('\n', stderr);
++}
++#endif
++#endif
+
+ void usage(const char *me)
+ {
++#ifdef ENABLE_HELP
+ char *dummy = NULL, has_color = 0;
+ char host[256] = { 0 };
+
+@@ -270,11 +293,15 @@ void usage(const char *me)
+ fprintf(stderr, gettext(" *** output mode settings ***\n"));
+ format_help("-q", "--quiet", gettext("quiet, only returncode"));
+ format_help("-m", "--parseable-output", gettext("give machine parseable output (see also -o and -e)"));
++#ifdef ENABLE_JSON
+ format_help("-M", NULL, gettext("json output, cannot be combined with -m"));
++#endif
+ format_help("-o rc,rc,...", "--ok-result-codes", gettext("what http results codes indicate 'ok' comma separated WITHOUT spaces inbetween default is 200, use with -e"));
+ format_help("-e x", "--result-string", gettext("string to display when http result code doesn't match"));
++#ifdef ENABLE_NAGIOS
+ format_help("-n warn,crit", "--nagios-mode-1 / --nagios-mode-2", gettext("Nagios-mode: return 1 when avg. response time >= warn, 2 if >= crit, otherwhise return 0"));
+ format_help("-N x", NULL, gettext("Nagios mode 2: return 0 when all fine, 'x' when anything failes"));
++#endif
+ format_help("-C cookie=value", "--cookie", gettext("add a cookie to the request"));
+ format_help("-Y", "--colors", gettext("add colors"));
+ format_help("-a", "--audible-ping", gettext("audible ping"));
+@@ -309,5 +336,6 @@ void usage(const char *me)
+ fprintf(stderr, gettext("Example:\n"));
+ fprintf(stderr, "\t%s %s%s -s -Z\n\n", me, host, has_color ? " -Y" : "");
+
++#endif
+ new_version_alert();
+ }
+--- a/Makefile
++++ b/Makefile
+@@ -88,6 +88,22 @@ OBJS+=fft.o
+ LDFLAGS+=-lfftw3
+ endif
+
++ifeq ($(JSON),yes)
++CFLAGS+=-DENABLE_JSON
++endif
++
++ifeq ($(NAGIOS),yes)
++CFLAGS+=-DENABLE_NAGIOS
++endif
++
++ifeq ($(HELP),yes)
++CFLAGS+=-DENABLE_HELP
++endif
++
++ifeq ($(HELPFORMAT),yes)
++CFLAGS+=-DENABLE_HELP_FORMAT
++endif
++
+ ifeq ($(DEBUG),yes)
+ CFLAGS+=-D_DEBUG -ggdb
+ LDFLAGS+=-g
PKG_RELEASE=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=befd075fd8175bb5322de8eeb8c7be218fd4ec255814cbf07051216f613fe2e6
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.ibr.cs.tu-bs.de/projects/ibr-dtn/releases
-PKG_MD5SUM:=3e527cedc6132739403fc210e4f8abe2
+PKG_HASH:=eab066cf15f9c322d769c6c9c58adfb474cba7d446fd12e8de5ff6344376795b
PKG_MAINTAINER:=Johannes Morgenroth <jm@m-network.de>
PKG_LICENSE:=Apache-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.ibr.cs.tu-bs.de/projects/ibr-dtn/releases
-PKG_MD5SUM:=933d37bf777700a6e1709d0f7a129613
+PKG_HASH:=9bd79636154093ab6bf4fd10d6c62d67c6db45141460847b19def327c93771ed
PKG_MAINTAINER:=Johannes Morgenroth <jm@m-network.de>
PKG_LICENSE:=Apache-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://gael.roualland.free.fr/ifstat/
-PKG_MD5SUM:=8599063b7c398f9cfef7a9ec699659b25b1c14d2bc0f535aed05ce32b7d9f507
+PKG_HASH:=8599063b7c398f9cfef7a9ec699659b25b1c14d2bc0f535aed05ce32b7d9f507
PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
PKG_LICENSE:=GPL-2.0
include $(TOPDIR)/rules.mk
PKG_NAME:=inadyn
-PKG_VERSION=2017-02-02
+PKG_VERSION=2.2
PKG_RELEASE:=1
PKG_MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/troglobit/inadyn
-PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=3b9ae1c22f96194232cc86ded33af9e0a1602af2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MIRROR_HASH:=9db6cd8d2b421d8bc61d4ae60c8215a86d73657746a1b06d79f4fbfd79734f6e
+PKG_SOURCE_URL:=https://github.com/troglobit/inadyn/releases/download/v$(PKG_VERSION)
+PKG_HASH:=27aed84a3d04591540b01ef91a5af4b02cbd0e0c20db36a2660453780bd645f6
PKG_FIXUP:=autoreconf
define Package/inadyn/install
$(INSTALL_DIR) $(1)/etc
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/examples/dyndns.conf $(1)/etc/inadyn.conf
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/inadyn $(1)/usr/sbin/
endef
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://code.kryo.se/iodine/
-PKG_MD5SUM:=fdbf3b81cd69caf5230d76a8b039fd99
+PKG_HASH:=ad2b40acf1421316ec15800dcde0f587ab31d7d6f891fa8b9967c4ded93c013e
PKG_MAINTAINER:=Uwe Kleine-König <uwe+openwrt@kleine-koenig.org>
PKG_LICENSE:=ISC
PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz
PKG_SOURCE_URL:=http://mirrors.kernel.org/${PKG_NAME}/${PKG_VERSION}/
-PKG_MD5SUM:=7dcd9f0f48263c6b27a2c3d085dd7278b5c0feed1dfec8872a04899707fa23d8
+PKG_HASH:=7dcd9f0f48263c6b27a2c3d085dd7278b5c0feed1dfec8872a04899707fa23d8
PKG_USE_MIPS16:=0
PKG_BUILD_DEPENDS:=boost
PKG_TINYCBOR_PROTO:=git
PKG_TINYCBOR_VERSION:=0.4
PKG_TINYCBOR_SOURCE_VERSION:=a088996aa5f59b4f27f20fadad053d88bee357d4
+PKG_TINYCBOR_MIRROR_HASH:=77c600bd7362df8291148fa3d94ca780815ea2b74b817dca7565310ea0abff96
PKG_TINYCBOR_SOURCE:=$(PKG_TINYCBOR_NAME)-$(PKG_TINYCBOR_VERSION).tar.bz2
PKG_TINYCBOR_SOURCE_URL:=https://github.com/01org/tinycbor.git
PKG_TINYCBOR_SUBDIR:=$(PKG_TINYCBOR_NAME)
define Download/iotivity-tinycbor
FILE:=$(PKG_TINYCBOR_SOURCE)
URL:=$(PKG_TINYCBOR_SOURCE_URL)
+ MIRROR_HASH:=$(PKG_TINYCBOR_MIRROR_HASH)
PROTO:=$(PKG_TINYCBOR_PROTO)
VERSION:=$(PKG_TINYCBOR_SOURCE_VERSION)
SUBDIR:=$(PKG_TINYCBOR_SUBDIR)
PKG_NAME:=ipsec-tools
PKG_VERSION:=0.8.2
-PKG_RELEASE:=6
+PKG_RELEASE:=7
PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>, \
Vitaly Protsko <villy@sft.ru>
PKG_LICENSE := BSD-3-Clause
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/ipsec-tools
-PKG_MD5SUM:=d53ec14a0a3ece64e09e5e34b3350b41
+PKG_HASH:=8eb6b38716e2f3a8a72f1f549c9444c2bc28d52c9536792690564c74fe722f2d
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
--- /dev/null
+Description: Fix remotely exploitable DoS. http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10396
+Source: vendor; https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=51682
+Bug-debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=867986
+
+Index: ipsec-tools-0.8.2/src/racoon/isakmp_frag.c
+===================================================================
+--- ipsec-tools-0.8.2.orig/src/racoon/isakmp_frag.c
++++ ipsec-tools-0.8.2/src/racoon/isakmp_frag.c
+@@ -1,4 +1,4 @@
+-/* $NetBSD: isakmp_frag.c,v 1.5 2009/04/22 11:24:20 tteras Exp $ */
++/* $NetBSD: isakmp_frag.c,v 1.5.36.1 2017/04/21 16:50:42 bouyer Exp $ */
+
+ /* Id: isakmp_frag.c,v 1.4 2004/11/13 17:31:36 manubsd Exp */
+
+@@ -173,6 +173,43 @@ vendorid_frag_cap(gen)
+ return ntohl(hp[MD5_DIGEST_LENGTH / sizeof(*hp)]);
+ }
+
++static int
++isakmp_frag_insert(struct ph1handle *iph1, struct isakmp_frag_item *item)
++{
++ struct isakmp_frag_item *pitem = NULL;
++ struct isakmp_frag_item *citem = iph1->frag_chain;
++
++ /* no frag yet, just insert at beginning of list */
++ if (iph1->frag_chain == NULL) {
++ iph1->frag_chain = item;
++ return 0;
++ }
++
++ do {
++ /* duplicate fragment number, abort (CVE-2016-10396) */
++ if (citem->frag_num == item->frag_num)
++ return -1;
++
++ /* need to insert before current item */
++ if (citem->frag_num > item->frag_num) {
++ if (pitem != NULL)
++ pitem->frag_next = item;
++ else
++ /* insert at the beginning of the list */
++ iph1->frag_chain = item;
++ item->frag_next = citem;
++ return 0;
++ }
++
++ pitem = citem;
++ citem = citem->frag_next;
++ } while (citem != NULL);
++
++ /* we reached the end of the list, insert */
++ pitem->frag_next = item;
++ return 0;
++}
++
+ int
+ isakmp_frag_extract(iph1, msg)
+ struct ph1handle *iph1;
+@@ -224,39 +261,43 @@ isakmp_frag_extract(iph1, msg)
+ item->frag_next = NULL;
+ item->frag_packet = buf;
+
+- /* Look for the last frag while inserting the new item in the chain */
+- if (item->frag_last)
+- last_frag = item->frag_num;
++ /* Check for the last frag before inserting the new item in the chain */
++ if (item->frag_last) {
++ /* if we have the last fragment, indices must match */
++ if (iph1->frag_last_index != 0 &&
++ item->frag_last != iph1->frag_last_index) {
++ plog(LLV_ERROR, LOCATION, NULL,
++ "Repeated last fragment index mismatch\n");
++ racoon_free(item);
++ vfree(buf);
++ return -1;
++ }
+
+- if (iph1->frag_chain == NULL) {
+- iph1->frag_chain = item;
+- } else {
+- struct isakmp_frag_item *current;
++ last_frag = iph1->frag_last_index = item->frag_num;
++ }
+
+- current = iph1->frag_chain;
+- while (current->frag_next) {
+- if (current->frag_last)
+- last_frag = item->frag_num;
+- current = current->frag_next;
+- }
+- current->frag_next = item;
++ /* insert fragment into chain */
++ if (isakmp_frag_insert(iph1, item) == -1) {
++ plog(LLV_ERROR, LOCATION, NULL,
++ "Repeated fragment index mismatch\n");
++ racoon_free(item);
++ vfree(buf);
++ return -1;
+ }
+
+- /* If we saw the last frag, check if the chain is complete */
++ /* If we saw the last frag, check if the chain is complete
++ * we have a sorted list now, so just walk through */
+ if (last_frag != 0) {
++ item = iph1->frag_chain;
+ for (i = 1; i <= last_frag; i++) {
+- item = iph1->frag_chain;
+- do {
+- if (item->frag_num == i)
+- break;
+- item = item->frag_next;
+- } while (item != NULL);
+-
++ if (item->frag_num != i)
++ break;
++ item = item->frag_next;
+ if (item == NULL) /* Not found */
+ break;
+ }
+
+- if (item != NULL) /* It is complete */
++ if (i > last_frag) /* It is complete */
+ return 1;
+ }
+
+@@ -291,15 +332,9 @@ isakmp_frag_reassembly(iph1)
+ }
+ data = buf->v;
+
++ item = iph1->frag_chain;
+ for (i = 1; i <= frag_count; i++) {
+- item = iph1->frag_chain;
+- do {
+- if (item->frag_num == i)
+- break;
+- item = item->frag_next;
+- } while (item != NULL);
+-
+- if (item == NULL) {
++ if (item->frag_num != i) {
+ plog(LLV_ERROR, LOCATION, NULL,
+ "Missing fragment #%d\n", i);
+ vfree(buf);
+@@ -308,6 +343,7 @@ isakmp_frag_reassembly(iph1)
+ }
+ memcpy(data, item->frag_packet->v, item->frag_packet->l);
+ data += item->frag_packet->l;
++ item = item->frag_next;
+ }
+
+ out:
+Index: ipsec-tools-0.8.2/src/racoon/isakmp_inf.c
+===================================================================
+--- ipsec-tools-0.8.2.orig/src/racoon/isakmp_inf.c
++++ ipsec-tools-0.8.2/src/racoon/isakmp_inf.c
+@@ -720,6 +720,7 @@ isakmp_info_send_nx(isakmp, remote, loca
+ #endif
+ #ifdef ENABLE_FRAG
+ iph1->frag = 0;
++ iph1->frag_last_index = 0;
+ iph1->frag_chain = NULL;
+ #endif
+
+Index: ipsec-tools-0.8.2/src/racoon/isakmp.c
+===================================================================
+--- ipsec-tools-0.8.2.orig/src/racoon/isakmp.c
++++ ipsec-tools-0.8.2/src/racoon/isakmp.c
+@@ -1071,6 +1071,7 @@ isakmp_ph1begin_i(rmconf, remote, local)
+ iph1->frag = 1;
+ else
+ iph1->frag = 0;
++ iph1->frag_last_index = 0;
+ iph1->frag_chain = NULL;
+ #endif
+ iph1->approval = NULL;
+@@ -1175,6 +1176,7 @@ isakmp_ph1begin_r(msg, remote, local, et
+ #endif
+ #ifdef ENABLE_FRAG
+ iph1->frag = 0;
++ iph1->frag_last_index = 0;
+ iph1->frag_chain = NULL;
+ #endif
+ iph1->approval = NULL;
+Index: ipsec-tools-0.8.2/src/racoon/handler.h
+===================================================================
+--- ipsec-tools-0.8.2.orig/src/racoon/handler.h
++++ ipsec-tools-0.8.2/src/racoon/handler.h
+@@ -1,4 +1,4 @@
+-/* $NetBSD: handler.h,v 1.25 2010/11/17 10:40:41 tteras Exp $ */
++/* $NetBSD: handler.h,v 1.26 2017/01/24 19:23:56 christos Exp $ */
+
+ /* Id: handler.h,v 1.19 2006/02/25 08:25:12 manubsd Exp */
+
+@@ -141,6 +141,7 @@ struct ph1handle {
+ #endif
+ #ifdef ENABLE_FRAG
+ int frag; /* IKE phase 1 fragmentation */
++ int frag_last_index;
+ struct isakmp_frag_item *frag_chain; /* Received fragments */
+ #endif
+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://fedorahosted.org/releases/i/p/iptraf-ng/
-PKG_MD5SUM:=de27cfeeede96e2acfb0edc8439b034a
+PKG_HASH:=79140cf07c0cceb1b5723242847a73aa86f5e4f9dccfe8970fda6801d347eb09
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_NAME:=isc-dhcp
UPSTREAM_NAME:=dhcp
-PKG_VERSION:=4.3.5
-PKG_RELEASE:=2
+PKG_VERSION:=4.3.6
+PKG_RELEASE:=1
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE_URL:=ftp://ftp.isc.org/isc/dhcp/$(PKG_VERSION) \
http://ftp.funet.fi/pub/mirrors/ftp.isc.org/isc/dhcp/$(PKG_VERSION) \
http://ftp.iij.ad.jp/pub/network/isc/dhcp/$(PKG_VERSION)
-PKG_MD5SUM:=2b5e5b2fa31c2e27e487039d86f83d3f
-PKG_HASH:=eb95936bf15d2393c55dd505bc527d1d4408289cec5a9fa8abb99f7577e7f954
+PKG_HASH:=a41eaf6364f1377fe065d35671d9cf82bbbc8f21207819b2b9f33f652aec6f1b
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_SOURCE_VERSION:=997a81bb5f5e9d82aa122fd37b7c890e44a245dd
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=a2c41119be251d4d962234fc78d7122568a5e62484969cc4e80229a0c7422fd4
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= http://www.keepalived.org/software
-PKG_MD5SUM:=5c98b06639dd50a6bff76901b53febb6
PKG_HASH:=32fbae732c1cd854cacd7a930d4a26f5bad6372cdecb5e3139f0c17e87493853
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.kismetwireless.net/code
-PKG_MD5SUM:=7fa6e86c5078a0e7d91fc9bf954c5107
+PKG_HASH:=bdb21f153311f1ff3b16621bf0d6740f66369bf0982b0a289c9a12af8847e237
PKG_BUILD_DEPENDS:=libpcap libncurses libpcre
include $(TOPDIR)/rules.mk
PKG_NAME:=knxd
-PKG_VERSION=2017-01-18
+PKG_VERSION:=0.14.18
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/knxd/knxd.git
-PKG_SOURCE_VERSION:=8255bf08b6e1a972c1489012b570bf0ff8679cb0
+PKG_SOURCE_VERSION:=5e707fdb7430009a299d3ad849aecf9ccbc8fdf6
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=96d5dd7b1513ccf871aed2bdd2601ca2a2f2d1005462fb1c631e5683e2e86e4e
PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
endef
define Package/knxd/conffiles
-/etc/config/knxd
-endef
-
-define Package/knxd-tools
- SECTION:=net
- CATEGORY:=Network
- TITLE:=EIB KNX Utils
- DEPENDS:=+libstdcpp +libev
-endef
-
-define Package/knxd-tools/description
-EIB KNX Tools
+/etc/config/knxd.ini
endef
TARGET_CXXFLAGS+= -std=c++0x
TARGET_CXX=$(TARGET_CC)
CONFIGURE_ARGS+= \
- --enable-eibnetip \
- --enable-eibnetiptunnel \
- --enable-eibnetipserver \
--disable-systemd
EXTRA_LDFLAGS+= \
-largp -lstdc++
define Package/knxd/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libeibclient.so* $(1)/usr/lib/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/knxd_args $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
- $(RM) $(1)/usr/bin/knxtool
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/knxd/eibwrite-cgi $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/knxd/eibread-cgi $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/knxd.init $(1)/etc/init.d/knxd
$(INSTALL_DIR) $(1)/etc/config
- $(INSTALL_DATA) ./files/knxd.config $(1)/etc/config/knxd
-endef
-
-define Package/knxd-tools/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libeibclient.so* $(1)/usr/lib/
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knxtool $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/knxd/eibwrite-cgi $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/knxd/eibread-cgi $(1)/usr/bin/
+ $(INSTALL_DATA) ./files/knxd.ini $(1)/etc/config/knxd.ini
endef
$(eval $(call BuildPackage,knxd))
-$(eval $(call BuildPackage,knxd-tools))
+++ /dev/null
-config daemon args
- # driver:[arg] a Layer-2 driver to use (knxd supports more than one)
- option layer2 ""
- # enable caching of group communication networkstate
- option GroupCache 0
- # FILE start the programm as daemon. Output will be written to FILE if given
- option daemon "/var/log/knxd.log"
- #enable the EIBnet/IP server to answer discovery and description requests (SEARCH, DESCRIPTION)
- option Discovery 1
- # EIBADDR set our EIB address to EIBADDR (default 0.0.1)
- option eibaddr "0.0.1"
- # CLIENT-ADDRS assign addresses ADDRSTART through ADDRSTART+n
- option client-addrs "0.0.2:10"
- # LEVEL set error level
- option error 0
- # PORT listen at TCP port PORT (default 6720)
- option listen_tcp "6720"
- # Interface to use
- option Interface ""
- # wait while sending
- option send-delay ""
- # SERVERNAME name of the EIBnet/IP server (default is 'knxd')
- option Name "OpenWrt"
- # the next Layer2 interface may not enter monitor mode
- option no_monitor 0
- # enable EIBnet/IP Routing in the EIBnet/IP server
- option Routing 0
- # [ip[:port]] starts an EIBnet/IP multicast server
- option Server 1
- # MASK set trace flags (bitmask)
- option trace 0
- # tpuarts backend should generate L2 acks for all group telegrams
- option tpuarts_ack_all_group 0
- # tpuarts backend should generate L2 acks for all individual telegrams
- option tpuarts_ack_all_individual 0
- # tpuarts backend should should use a full interface reset (for Disch TPUART interfaces)
- option tpuarts_disch_reset 0
- # enable EIBnet/IP Tunneling in the EIBnet/IP server
- option Tunnelling 1
- # FILE listen at Unix domain socket FILE (default /tmp/eib)
- option listen_local "/var/run/knxd"
- # example with tpuarts interface
- # option url 'tpuarts:/dev/ttyAMA0'
- # example with IP interface in tunnel mode
- option url 'ip:'
--- /dev/null
+[A.tcp]
+server = knxd_tcp
+systemd-ignore = true
+[B.ip]
+driver = ip
+[debug-server]
+name = mcast:knxd
+[main]
+addr = 0.0.1
+background = true
+client-addrs = 0.0.2:10
+connections = A.tcp,server,B.ip
+[server]
+debug = debug-server
+discover = true
+server = ets_router
+tunnel = tunnel
---- a/src/client/Makefile.am 2014-12-21 20:17:14.000000000 +0100
-+++ b/src/client/Makefile.am 2014-12-21 20:18:50.639995000 +0100
+--- a/src/client/Makefile.am 2017-01-25 20:17:14.000000000 +0100
++++ b/src/client/Makefile.am 2017-01-25 20:18:50.639995000 +0100
@@ -4,5 +4,5 @@
BUILDJAVA =
endif
--SUBDIRS=def c $(BUILDJAVA) php perl cs python pascal ruby lua .
+-SUBDIRS=def c $(BUILDJAVA) php perl cs python pascal ruby lua go .
+SUBDIRS=def c $(BUILDJAVA) php perl cs .
include $(TOPDIR)/rules.mk
PKG_NAME:=kplex
-PKG_VERSION:=20150809
+PKG_VERSION:=1.3.4
+PKG_RELEASE=1
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/stripydog/kplex.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=fec47cd1877ec7903969adefa4220838a706d940
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://www.stripydog.com/download
+PKG_HASH:=b507d85d5f1def40303326459268a6262d37ea5f13fb73b37b72854e53594dcc
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=COPYING
define Package/kplex/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/kplex $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_CONF) $(PKG_BUILD_DIR)/kplex.conf.ex $(1)/etc/kplex.conf
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/kplex.init $(1)/etc/init.d/kplex
endef
PKG_SOURCE:=krb5-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://web.mit.edu/kerberos/dist/krb5/1.14/
-PKG_MD5SUM:=2e35f0af0344d68aba99cef616d3a64f
+PKG_HASH:=6bcad7e6778d1965e4ce4af21d2efdc15b274c5ce5c69031c58e4c954cda8b27
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/l7-filter
-PKG_MD5SUM:=91be154d12134dcdbc560cc7aa7fe4ce
+PKG_HASH:=d6bf98a69268558543bd32fccea287cb3f14b37521d18c790e2b6f8dcfaa5381
include $(INCLUDE_DIR)/uclibc++.mk
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.flyn.org/projects/lcdringer
-PKG_MD5SUM:=ff3fe82593792c9111f957dd533369fb
+PKG_HASH:=34f8a5325cb20bf404ac1a10fe63d013a077a12814c4558df4e55d95262ff618
PKG_BUILD_DEPENDS:=+vala
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://lftp.tech/ftp/ \
ftp://ftp.st.ryukoku.ac.jp/pub/network/ftp/lftp/
-PKG_MD5SUM:=88c1505f8264429353ea7f249597eeb7
+PKG_HASH:=53b5c5eba2e38b418bcf451776f2df596050dff4db90ab4ea73d872f8b1fd0d8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://download.lighttpd.net/lighttpd/releases-1.4.x
-PKG_MD5SUM:=a128e1eda76899ce3fd115efae5fe631
+PKG_HASH:=1c97225deea33eefba6d4158c2cef27913d47553263516bbe9d2e2760fc43a3f
PKG_LICENSE:=BSD-3c
PKG_LICENSE_FILES:=COPYING
PKG_NAME:=linknx
PKG_VERSION:=0.0.1.33
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/linknx/linknx.git
-PKG_SOURCE_VERSION:=f627ed44feaea5a1f67c53f2810c44a14c059cef
+PKG_SOURCE_VERSION:=6166831eff645f21a7fd22ec3f7855f36005b8d9
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
-PKG_SOURCE:=$(PKG_NAME)-${PKG_VERSION}.tar.gz
+PKG_SOURCE:=$(PKG_NAME)-${PKG_VERSION}.tar.xz
+PKG_MIRROR_HASH:=9d38d3a5b4bd935f841fbacf0ee00a9bb9e75ac7a7e7609864254ebb5bbdb960
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_BUILD_DEPENDS:=argp-standalone
PKG_MAINTAINER:=Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)/v$(PKG_VERSION)
-PKG_MD5SUM:=5688cdfe57932273e1dbf35b3b97b9a0
PKG_HASH:=fa8e00f6ec73cefa7bb313dce7f60dfe5eb9e2bde3353594e9ac18edc93e5165
PKG_LICENSE:=GPL-2.0
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MIRROR_HASH:=584300e1a59cc976f3599213487ea8425f94300887a51c9804f0292cf2f0c8cc
PKG_SOURCE_URL:=git://github.com/LISPmob/lispmob.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/lksctp
-PKG_MD5SUM:=708bb0b5a6806ad6e8d13c55b067518e
+PKG_HASH:=0903dd526b7f30a89d5031aa2c82757612becc38ed7bc6e4f972f8deae351f26
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=37d83cbc9c07266d6c957d27bf75285b305eceab
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=13429f1a870121cdbbfb687e0581967904798000eca1f8f9c1e9dc87dee5669b
PKG_LICENSE:=GPL-2.0+
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_SOURCE:=mDNSResponder-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://opensource.apple.com/tarballs/mDNSResponder/
-PKG_MD5SUM:=940057ac8b513b00e8e9ca12ef796762
+PKG_HASH:=4737cb51378377e11d0edb7bcdd1bec79cbdaa7b27ea09c13e3006e58f8d92c0
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_LICENSE:=Apache-2.0
include $(TOPDIR)/rules.mk
PKG_NAME:=memcached
-PKG_VERSION:=1.4.36
+PKG_VERSION:=1.5.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://memcached.org/files
-PKG_MD5SUM:=1e028fbab7288911fcaa5ed2a21817fe
+PKG_HASH:=a87908936b51d1bd3ef10a2347eef5647f003b63407a5d8161fa7928b1cd6b5c
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
PKG_SOURCE_VERSION:=115f1af2494ded1fcd21c8419d5e289bc4df380f
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=b67157e2912dd210b3e3184b358db6759177a1d8ed6916763e5a629f154f9d7a
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=203d92e60ed09466d6676c6ad20ad6cb2ce08a5d
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=175d4d9b69c3195ef850eaffd8ac63d012a052089b4a9d074b4d3aef96888b8f
PKG_FIXUP:=autoreconf
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
config_get_bool no_remote "$1" no_remote_access 0
if [ "$no_remote" -eq 1 ]; then
- echo "bind_address 127.0.0.1" >> $TCONF
+ echo "bind_address localhost" >> $TCONF
fi
config_get port "$1" port 1883
append_if "$1" protocol
append_if "$1" max_inflight_messages
append_if "$1" max_queued_messages
+ append_if "$1" sys_interval
}
convert_persistence() {
fi
append_if "$1" protocol
+ append_if "$1" http_dir
+ append_optional_bool "$1" use_username_as_clientid use_username_as_clientid
+ append_if "$1" cafile
+ append_if "$1" capath
+ append_if "$1" certfile
+ append_if "$1" keyfile
+ append_if "$1" tls_version
+ append_optional_bool "$1" require_certificate require_certificate
+ append_optional_bool "$1" use_identity_as_username use_identity_as_username
+ append_if "$1" crlfile
+ append_if "$1" ciphers
+ append_if "$1" psk_hint
}
add_topic() {
append_optional_bool "$1" cleansession cleansession
append_optional_bool "$1" try_private try_private
append_optional_bool "$1" notifications notifications
-
- append_if "$1" clientid
+ append_optional_bool "$1" round_robin round_robin
+
+ # Note, deprecated upstream, preserve old uci configs
+ append_if "$1" clientid remote_clientid
+ append_if "$1" remote_clientid
+ append_if "$1" local_clientid
+ append_if "$1" notification_topic
+ append_if "$1" keepalive_interval
+ append_if "$1" start_type
+ append_if "$1" restart_timeout
+ append_if "$1" idle_timeout
+ append_if "$1" threshold
+ append_if "$1" protocol_version bridge_protocol_version
+ append_optional_bool "$1" attempt_unsubscribe bridge_attempt_unsubscribe
append_if "$1" identity bridge_identity
append_if "$1" psk bridge_psk
append_if "$1" tls_version bridge_tls_version
append_if "$1" cafile bridge_cafile
append_if "$1" certfile bridge_certfile
append_if "$1" keyfile bridge_keyfile
+ # Note, deprecated upstream, preserve old uci configs
append_if "$1" username remote_username
+ # Note, deprecated upstream, preserve old uci configs
append_if "$1" password remote_password
+ append_if "$1" remote_username
+ append_if "$1" remote_password
}
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=4911c96ee4b3c31692664a845dccddabdfef107646d4861b21fd4053bd2b76e8
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
include $(TOPDIR)/rules.mk
PKG_NAME:=mwan3
-PKG_VERSION:=2.5.3
-PKG_RELEASE:=5
+PKG_VERSION:=2.6.6
+PKG_RELEASE:=1
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
PKG_LICENSE:=GPLv2
define Build/Compile
endef
+define Package/mwan3/postinst
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+ /etc/init.d/rpcd restart
+fi
+exit 0
+endef
+
+define Package/mwan3/postrm
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+ /etc/init.d/rpcd restart
+fi
+exit 0
+endef
+
define Package/mwan3/install
$(CP) ./files/* $(1)
endef
--- /dev/null
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/mwan3/mwan3.sh
+. /lib/functions/network.sh
+
+[ "$ACTION" = "ifup" -o "$ACTION" = "ifdown" ] || exit 1
+[ -n "$INTERFACE" ] || exit 2
+
+if [ "$ACTION" = "ifup" ]; then
+ [ -n "$DEVICE" ] || exit 3
+fi
+
+config_load mwan3
+config_get local_source globals local_source 'none'
+[ "${local_source}" = "none" ] && {
+ exit 0
+}
+
+[ "${local_source}" = "$INTERFACE" ] || {
+ exit 0
+}
+
+mwan3_lock
+src_ip=$(uci_get_state mwan3 globals src_ip)
+[ "${src_ip}" != "" ] && {
+ ip route del default via "${src_ip}" dev lo 1>/dev/null 2>&1
+ ip addr del "${src_ip}/32" dev lo 1>/dev/null 2>&1
+}
+
+usleep 10000
+
+[ "$ACTION" = "ifup" ] && {
+ network_get_ipaddr src_ip "${local_source}"
+ if [ "${src_ip}" = "" ]; then
+ $LOG warn "Unable to set source ip for own initiated traffic (${local_source})"
+ else
+ ip addr add "${src_ip}/32" dev lo
+ ip route add default via "${src_ip}" dev lo
+ uci_toggle_state mwan3 globals src_ip "${src_ip}"
+ fi
+}
+mwan3_unlock
+
+exit 0
. /lib/functions.sh
. /lib/functions/network.sh
. /lib/mwan3/mwan3.sh
+. /usr/share/libubox/jshn.sh
[ "$ACTION" == "ifup" -o "$ACTION" == "ifdown" ] || exit 1
[ -n "$INTERFACE" ] || exit 2
[ -n "$DEVICE" ] || exit 3
fi
+mwan3_lock
mwan3_set_connected_iptables
+mwan3_unlock
config_load mwan3
config_get enabled $INTERFACE enabled 0
+config_get initial_state $INTERFACE initial_state "online"
[ "$enabled" == "1" ] || exit 0
if [ "$ACTION" == "ifup" ]; then
ubus call network.interface.${INTERFACE}_4 status &>/dev/null
if [ "$?" -eq "0" ]; then
network_get_gateway gateway ${INTERFACE}_4
+ network_get_ipaddr src_ip ${INTERFACE}_4
else
network_get_gateway gateway $INTERFACE
+ network_get_ipaddr src_ip ${INTERFACE}
fi
elif [ "$family" = "ipv6" ]; then
ubus call network.interface.${INTERFACE}_6 status &>/dev/null
if [ "$?" -eq "0" ]; then
network_get_gateway6 gateway ${INTERFACE}_6
+ network_get_ipaddr6 src_ip ${INTERFACE}_6
else
network_get_gateway6 gateway ${INTERFACE}
+ network_get_ipaddr6 src_ip ${INTERFACE}
fi
fi
[ -n "$gateway" ] || exit 9
fi
+if [ "$initial_state" = "offline" ]; then
+ json_load "$(ubus call mwan3 status '{"section":"interfaces"}')"
+ json_select "interfaces"
+ json_select "${INTERFACE}"
+ json_get_var running running
+ json_get_var status status
+else
+ status=online
+ running=1
+fi
+
mwan3_lock
-$LOG notice "$ACTION interface $INTERFACE (${DEVICE:-unknown})"
+$LOG notice "Execute "$ACTION" event on interface $INTERFACE (${DEVICE:-unknown})"
case "$ACTION" in
ifup)
mwan3_set_general_rules
mwan3_set_general_iptables
- mwan3_create_iface_rules $INTERFACE $DEVICE
mwan3_create_iface_iptables $INTERFACE $DEVICE
+ mwan3_create_iface_rules $INTERFACE $DEVICE
mwan3_create_iface_route $INTERFACE $DEVICE
- mwan3_track $INTERFACE $DEVICE
- mwan3_set_policies_iptables
- mwan3_set_user_rules
- mwan3_flush_conntrack $INTERFACE $DEVICE "ifup"
+ if [ ${running} -eq 1 -a "${status}" = "online" ]; then
+ $LOG notice "Starting tracker on interface $INTERFACE (${DEVICE:-unknown})"
+ mwan3_set_iface_hotplug_state $INTERFACE "online"
+ mwan3_track $INTERFACE $DEVICE "online" "$src_ip"
+ mwan3_set_policies_iptables
+ mwan3_set_user_rules
+ mwan3_flush_conntrack $INTERFACE $DEVICE "ifup"
+ else
+ $LOG notice "Starting tracker on interface $INTERFACE (${DEVICE:-unknown})"
+ mwan3_set_iface_hotplug_state $INTERFACE "offline"
+ mwan3_track $INTERFACE $DEVICE "unknown" "$src_ip"
+ fi
;;
ifdown)
- mwan3_delete_iface_rules $INTERFACE
- mwan3_delete_iface_iptables $INTERFACE
- mwan3_delete_iface_route $INTERFACE
+ mwan3_set_iface_hotplug_state $INTERFACE "offline"
mwan3_delete_iface_ipset_entries $INTERFACE
mwan3_track_signal $INTERFACE $DEVICE
mwan3_set_policies_iptables
IPS="ipset"
IPT4="iptables -t mangle -w"
IPT6="ip6tables -t mangle -w"
-LOG="logger -t mwan3 -p"
+LOG="logger -t mwan3[$$] -p"
CONNTRACK_FILE="/proc/net/nf_conntrack"
+MWAN3_STATUS_DIR="/var/run/mwan3"
+MWAN3TRACK_STATUS_DIR="/var/run/mwan3track"
+
+[ -d $MWAN3_STATUS_DIR ] || mkdir -p $MWAN3_STATUS_DIR/iface_state
+# mwan3's MARKing mask (at least 3 bits should be set)
+if [ -e "${MWAN3_STATUS_DIR}/mmx_mask" ]; then
+ MMX_MASK=$(cat "${MWAN3_STATUS_DIR}/mmx_mask")
+else
+ config_load mwan3
+ config_get MMX_MASK globals mmx_mask '0xff00'
+ echo "$MMX_MASK" > "${MWAN3_STATUS_DIR}/mmx_mask"
+ $LOG notice "Using firewall mask ${MMX_MASK}"
+fi
+
+# counts how many bits are set to 1
+# n&(n-1) clears the lowest bit set to 1
+mwan3_count_one_bits()
+{
+ local count n
+ count=0
+ n=$(($1))
+ while [ "$n" -gt "0" ]; do
+ n=$((n&(n-1)))
+ count=$((count+1))
+ done
+ echo $count
+}
+
+# maps the 1st parameter so it only uses the bits allowed by the bitmask (2nd parameter)
+# which means spreading the bits of the 1st parameter to only use the bits that are set to 1 in the 2nd parameter
+# 0 0 0 0 0 1 0 1 (0x05) 1st parameter
+# 1 0 1 0 1 0 1 0 (0xAA) 2nd parameter
+# 1 0 1 result
+mwan3_id2mask()
+{
+ local bit_msk bit_val result
+ bit_val=0
+ result=0
+ for bit_msk in $(seq 0 31); do
+ if [ $((($2>>bit_msk)&1)) = "1" ]; then
+ if [ $((($1>>bit_val)&1)) = "1" ]; then
+ result=$((result|(1<<bit_msk)))
+ fi
+ bit_val=$((bit_val+1))
+ fi
+ done
+ printf "0x%x" $result
+}
+
+# mark mask constants
+MM_BIT_CNT=$(mwan3_count_one_bits MMX_MASK)
+MM_DEFAULT=$(((1<<MM_BIT_CNT)-1))
+MM_BLACKHOLE=$(($MM_DEFAULT-2))
+MM_UNREACHABLE=$(($MM_DEFAULT-1))
+
+# MMX_DEFAULT should equal MMX_MASK
+MMX_DEFAULT=$(mwan3_id2mask MM_DEFAULT MMX_MASK)
+MMX_BLACKHOLE=$(mwan3_id2mask MM_BLACKHOLE MMX_MASK)
+MMX_UNREACHABLE=$(mwan3_id2mask MM_UNREACHABLE MMX_MASK)
+
mwan3_lock() {
lock /var/run/mwan3.lock
}
lock -u /var/run/mwan3.lock
}
+mwan3_lock_clean() {
+ rm -rf /var/run/mwan3.lock
+}
+
mwan3_get_iface_id()
{
local _tmp _iface _iface_count
for IP in "$IP4" "$IP6"; do
- if [ -z "$($IP rule list | awk '$1 == "2253:"')" ]; then
- $IP rule add pref 2253 fwmark 0xfd00/0xff00 blackhole
+ RULE_NO=$(($MM_BLACKHOLE+2000))
+ if [ -z "$($IP rule list | awk -v var="$RULE_NO:" '$1 == var')" ]; then
+ $IP rule add pref $RULE_NO fwmark $MMX_BLACKHOLE/$MMX_MASK blackhole
fi
- if [ -z "$($IP rule list | awk '$1 == "2254:"')" ]; then
- $IP rule add pref 2254 fwmark 0xfe00/0xff00 unreachable
+ RULE_NO=$(($MM_UNREACHABLE+2000))
+ if [ -z "$($IP rule list | awk -v var="$RULE_NO:" '$1 == var')" ]; then
+ $IP rule add pref $RULE_NO fwmark $MMX_UNREACHABLE/$MMX_MASK unreachable
fi
done
}
if ! $IPT -S mwan3_connected &> /dev/null; then
$IPT -N mwan3_connected
$IPS -! create mwan3_connected list:set
- $IPT -A mwan3_connected -m set --match-set mwan3_connected dst -j MARK --set-xmark 0xff00/0xff00
+ $IPT -A mwan3_connected -m set --match-set mwan3_connected dst -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
fi
if ! $IPT -S mwan3_ifaces_out &> /dev/null; then
if ! $IPT -S mwan3_hook &> /dev/null; then
$IPT -N mwan3_hook
- $IPT -A mwan3_hook -j CONNMARK --restore-mark --nfmask 0xff00 --ctmask 0xff00
- $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_ifaces_in
- $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_connected
- $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_ifaces_out
- $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_rules
- $IPT -A mwan3_hook -j CONNMARK --save-mark --nfmask 0xff00 --ctmask 0xff00
- $IPT -A mwan3_hook -m mark ! --mark 0xff00/0xff00 -j mwan3_connected
+ $IPT -A mwan3_hook -j CONNMARK --restore-mark --nfmask $MMX_MASK --ctmask $MMX_MASK
+ $IPT -A mwan3_hook -m mark --mark 0x0/$MMX_MASK -j mwan3_ifaces_in
+ $IPT -A mwan3_hook -m mark --mark 0x0/$MMX_MASK -j mwan3_connected
+ $IPT -A mwan3_hook -m mark --mark 0x0/$MMX_MASK -j mwan3_ifaces_out
+ $IPT -A mwan3_hook -m mark --mark 0x0/$MMX_MASK -j mwan3_rules
+ $IPT -A mwan3_hook -j CONNMARK --save-mark --nfmask $MMX_MASK --ctmask $MMX_MASK
+ $IPT -A mwan3_hook -m mark ! --mark $MMX_DEFAULT/$MMX_MASK -j mwan3_connected
fi
if ! $IPT -S PREROUTING | grep mwan3_hook &> /dev/null; then
fi
$IPT4 -F mwan3_iface_in_$1
- $IPT4 -A mwan3_iface_in_$1 -i $2 -m set --match-set mwan3_connected src -m mark --mark 0x0/0xff00 -m comment --comment "default" -j MARK --set-xmark 0xff00/0xff00
- $IPT4 -A mwan3_iface_in_$1 -i $2 -m mark --mark 0x0/0xff00 -m comment --comment "$1" -j MARK --set-xmark $(($id*256))/0xff00
+ $IPT4 -A mwan3_iface_in_$1 -i $2 -m set --match-set mwan3_connected src -m mark --mark 0x0/$MMX_MASK -m comment --comment "default" -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
+ $IPT4 -A mwan3_iface_in_$1 -i $2 -m mark --mark 0x0/$MMX_MASK -m comment --comment "$1" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
- $IPT4 -D mwan3_ifaces_in -m mark --mark 0x0/0xff00 -j mwan3_iface_in_$1 &> /dev/null
- $IPT4 -A mwan3_ifaces_in -m mark --mark 0x0/0xff00 -j mwan3_iface_in_$1
+ $IPT4 -D mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1 &> /dev/null
+ $IPT4 -A mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1
$IPT4 -F mwan3_iface_out_$1
- $IPT4 -A mwan3_iface_out_$1 -s $src_ip -m mark --mark 0x0/0xff00 -m comment --comment "$1" -j MARK --set-xmark $(($id*256))/0xff00
+ $IPT4 -A mwan3_iface_out_$1 -s $src_ip -m mark --mark 0x0/$MMX_MASK -m comment --comment "$1" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
- $IPT4 -D mwan3_ifaces_out -m mark --mark 0x0/0xff00 -j mwan3_iface_out_$1 &> /dev/null
- $IPT4 -A mwan3_ifaces_out -m mark --mark 0x0/0xff00 -j mwan3_iface_out_$1
+ $IPT4 -D mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1 &> /dev/null
+ $IPT4 -A mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1
fi
if [ "$family" == "ipv6" ]; then
fi
$IPT6 -F mwan3_iface_in_$1
- $IPT6 -A mwan3_iface_in_$1 -i $2 -m set --match-set mwan3_connected_v6 src -m mark --mark 0x0/0xff00 -m comment --comment "default" -j MARK --set-xmark 0xff00/0xff00
- $IPT6 -A mwan3_iface_in_$1 -i $2 -m mark --mark 0x0/0xff00 -m comment --comment "$1" -j MARK --set-xmark $(($id*256))/0xff00
+ $IPT6 -A mwan3_iface_in_$1 -i $2 -m set --match-set mwan3_connected_v6 src -m mark --mark 0x0/$MMX_MASK -m comment --comment "default" -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
+ $IPT6 -A mwan3_iface_in_$1 -i $2 -m mark --mark 0x0/$MMX_MASK -m comment --comment "$1" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
- $IPT6 -D mwan3_ifaces_in -m mark --mark 0x0/0xff00 -j mwan3_iface_in_$1 &> /dev/null
- $IPT6 -A mwan3_ifaces_in -m mark --mark 0x0/0xff00 -j mwan3_iface_in_$1
+ $IPT6 -D mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1 &> /dev/null
+ $IPT6 -A mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1
$IPT6 -F mwan3_iface_out_$1
- $IPT6 -A mwan3_iface_out_$1 -s $src_ipv6 -m mark --mark 0x0/0xff00 -m comment --comment "$1" -j MARK --set-xmark $(($id*256))/0xff00
+ $IPT6 -A mwan3_iface_out_$1 -s $src_ipv6 -m mark --mark 0x0/$MMX_MASK -m comment --comment "$1" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
- $IPT6 -D mwan3_ifaces_out -m mark --mark 0x0/0xff00 -j mwan3_iface_out_$1 &> /dev/null
- $IPT6 -A mwan3_ifaces_out -m mark --mark 0x0/0xff00 -j mwan3_iface_out_$1
+ $IPT6 -D mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1 &> /dev/null
+ $IPT6 -A mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1
fi
}
if [ "$family" == "ipv4" ]; then
- $IPT4 -D mwan3_ifaces_in -m mark --mark 0x0/0xff00 -j mwan3_iface_in_$1 &> /dev/null
+ $IPT4 -D mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1 &> /dev/null
$IPT4 -F mwan3_iface_in_$1 &> /dev/null
$IPT4 -X mwan3_iface_in_$1 &> /dev/null
- $IPT4 -D mwan3_ifaces_out -m mark --mark 0x0/0xff00 -j mwan3_iface_out_$1 &> /dev/null
+ $IPT4 -D mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1 &> /dev/null
$IPT4 -F mwan3_iface_out_$1 &> /dev/null
$IPT4 -X mwan3_iface_out_$1 &> /dev/null
fi
if [ "$family" == "ipv6" ]; then
- $IPT6 -D mwan3_ifaces_in -m mark --mark 0x0/0xff00 -j mwan3_iface_in_$1 &> /dev/null
+ $IPT6 -D mwan3_ifaces_in -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_in_$1 &> /dev/null
$IPT6 -F mwan3_iface_in_$1 &> /dev/null
$IPT6 -X mwan3_iface_in_$1 &> /dev/null
- $IPT6 -D mwan3_ifaces_out -m mark --mark 0x0/0xff00 -j mwan3_iface_out_$1 &> /dev/null
+ $IPT6 -D mwan3_ifaces_out -m mark --mark 0x0/$MMX_MASK -j mwan3_iface_out_$1 &> /dev/null
$IPT6 -F mwan3_iface_out_$1 &> /dev/null
$IPT6 -X mwan3_iface_out_$1 &> /dev/null
fi
done
$IP4 rule add pref $(($id+1000)) iif $2 lookup main
- $IP4 rule add pref $(($id+2000)) fwmark $(($id*256))/0xff00 lookup $id
+ $IP4 rule add pref $(($id+2000)) fwmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK lookup $id
fi
if [ "$family" == "ipv6" ]; then
done
$IP6 rule add pref $(($id+1000)) iif $2 lookup main
- $IP6 rule add pref $(($id+2000)) fwmark $(($id*256))/0xff00 lookup $id
+ $IP6 rule add pref $(($id+2000)) fwmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK lookup $id
fi
}
[ -n "$id" ] || return 0
for setname in $(ipset -n list | grep ^mwan3_sticky_); do
- for entry in $(ipset list $setname | grep "$(echo $(($id*256)) | awk '{ printf "0x%08x", $1; }')" | cut -d ' ' -f 1); do
+ for entry in $(ipset list $setname | grep "$(echo $(mwan3_id2mask id MMX_MASK) | awk '{ printf "0x%08x", $1; }')" | cut -d ' ' -f 1); do
$IPS del $setname $entry
done
done
mwan3_list_track_ips()
{
- track_ips="$1 $track_ips"
+ track_ips="$track_ips $1"
}
config_list_foreach $1 track_ip mwan3_list_track_ips
- kill $(pgrep -f "mwan3track $1") &> /dev/null
+ kill $(pgrep -f "mwan3track $1 $2") &> /dev/null
if [ -n "$track_ips" ]; then
- [ -x /usr/sbin/mwan3track ] && /usr/sbin/mwan3track $1 $2 $track_ips &
+ [ -x /usr/sbin/mwan3track ] && /usr/sbin/mwan3track "$1" "$2" "$3" "$4" $track_ips &
fi
}
{
local pid
- pid="$(pgrep -f "mwan3track $1")"
+ pid="$(pgrep -f "mwan3track $1 $2")"
if [ "${pid}" != "" ]; then
kill -USR1 "${pid}"
else
if [ "$family" == "ipv4" ]; then
- if [ -n "$($IP4 route list table $id)" ]; then
+ if [ "$(mwan3_get_iface_hotplug_state $iface)" = "online" ]; then
if [ "$metric" -lt "$lowest_metric_v4" ]; then
total_weight_v4=$weight
$IPT4 -F mwan3_policy_$policy
- $IPT4 -A mwan3_policy_$policy -m mark --mark 0x0/0xff00 -m comment --comment "$iface $weight $weight" -j MARK --set-xmark $(($id*256))/0xff00
+ $IPT4 -A mwan3_policy_$policy -m mark --mark 0x0/$MMX_MASK -m comment --comment "$iface $weight $weight" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
lowest_metric_v4=$metric
probability="-m statistic --mode random --probability $probability"
- $IPT4 -I mwan3_policy_$policy -m mark --mark 0x0/0xff00 $probability -m comment --comment "$iface $weight $total_weight_v4" -j MARK --set-xmark $(($id*256))/0xff00
+ $IPT4 -I mwan3_policy_$policy -m mark --mark 0x0/$MMX_MASK $probability -m comment --comment "$iface $weight $total_weight_v4" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
fi
fi
fi
if [ "$family" == "ipv6" ]; then
- if [ -n "$($IP6 route list table $id)" ]; then
+ if [ "$(mwan3_get_iface_hotplug_state $iface)" = "online" ]; then
if [ "$metric" -lt "$lowest_metric_v6" ]; then
total_weight_v6=$weight
$IPT6 -F mwan3_policy_$policy
- $IPT6 -A mwan3_policy_$policy -m mark --mark 0x0/0xff00 -m comment --comment "$iface $weight $weight" -j MARK --set-xmark $(($id*256))/0xff00
+ $IPT6 -A mwan3_policy_$policy -m mark --mark 0x0/$MMX_MASK -m comment --comment "$iface $weight $weight" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
lowest_metric_v6=$metric
probability="-m statistic --mode random --probability $probability"
- $IPT6 -I mwan3_policy_$policy -m mark --mark 0x0/0xff00 $probability -m comment --comment "$iface $weight $total_weight_v6" -j MARK --set-xmark $(($id*256))/0xff00
+ $IPT6 -I mwan3_policy_$policy -m mark --mark 0x0/$MMX_MASK $probability -m comment --comment "$iface $weight $total_weight_v6" -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
fi
fi
fi
case "$last_resort" in
blackhole)
- $IPT -A mwan3_policy_$1 -m mark --mark 0x0/0xff00 -m comment --comment "blackhole" -j MARK --set-xmark 0xfd00/0xff00
+ $IPT -A mwan3_policy_$1 -m mark --mark 0x0/$MMX_MASK -m comment --comment "blackhole" -j MARK --set-xmark $MMX_BLACKHOLE/$MMX_MASK
;;
default)
- $IPT -A mwan3_policy_$1 -m mark --mark 0x0/0xff00 -m comment --comment "default" -j MARK --set-xmark 0xff00/0xff00
+ $IPT -A mwan3_policy_$1 -m mark --mark 0x0/$MMX_MASK -m comment --comment "default" -j MARK --set-xmark $MMX_DEFAULT/$MMX_MASK
;;
*)
- $IPT -A mwan3_policy_$1 -m mark --mark 0x0/0xff00 -m comment --comment "unreachable" -j MARK --set-xmark 0xfe00/0xff00
+ $IPT -A mwan3_policy_$1 -m mark --mark 0x0/$MMX_MASK -m comment --comment "unreachable" -j MARK --set-xmark $MMX_UNREACHABLE/$MMX_MASK
;;
esac
done
for IPT in "$IPT4" "$IPT6"; do
if [ -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" -a -n "$($IPT -S mwan3_iface_out_$1 2> /dev/null)" ]; then
- $IPT -I mwan3_rule_$rule -m mark --mark $(($id*256))/0xff00 -m set ! --match-set mwan3_sticky_$rule src,src -j MARK --set-xmark 0x0/0xff00
- $IPT -I mwan3_rule_$rule -m mark --mark 0/0xff00 -j MARK --set-xmark $(($id*256))/0xff00
+ $IPT -I mwan3_rule_$rule -m mark --mark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK -m set ! --match-set mwan3_sticky_$rule src,src -j MARK --set-xmark 0x0/$MMX_MASK
+ $IPT -I mwan3_rule_$rule -m mark --mark 0/$MMX_MASK -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
fi
done
fi
if [ -n "$use_policy" ]; then
if [ "$use_policy" == "default" ]; then
- policy="MARK --set-xmark 0xff00/0xff00"
+ policy="MARK --set-xmark $MMX_DEFAULT/$MMX_MASK"
elif [ "$use_policy" == "unreachable" ]; then
- policy="MARK --set-xmark 0xfe00/0xff00"
+ policy="MARK --set-xmark $MMX_UNREACHABLE/$MMX_MASK"
elif [ "$use_policy" == "blackhole" ]; then
- policy="MARK --set-xmark 0xfd00/0xff00"
+ policy="MARK --set-xmark $MMX_BLACKHOLE/$MMX_MASK"
else
if [ "$sticky" -eq 1 ]; then
$IPT -F mwan3_rule_$1
done
- $IPS -! create mwan3_sticky_v4_$rule hash:ip,mark markmask 0xff00 timeout $timeout
- $IPS -! create mwan3_sticky_v6_$rule hash:ip,mark markmask 0xff00 timeout $timeout family inet6
+ $IPS -! create mwan3_sticky_v4_$rule hash:ip,mark markmask $MMX_MASK timeout $timeout
+ $IPS -! create mwan3_sticky_v6_$rule hash:ip,mark markmask $MMX_MASK timeout $timeout family inet6
$IPS -! create mwan3_sticky_$rule list:set
$IPS -! add mwan3_sticky_$rule mwan3_sticky_v4_$rule
$IPS -! add mwan3_sticky_$rule mwan3_sticky_v6_$rule
config_foreach mwan3_set_sticky_iptables interface
for IPT in "$IPT4" "$IPT6"; do
- $IPT -A mwan3_rule_$1 -m mark --mark 0/0xff00 -j $policy
+ $IPT -A mwan3_rule_$1 -m mark --mark 0/$MMX_MASK -j $policy
$IPT -A mwan3_rule_$1 -m mark ! --mark 0xfc00/0xfc00 -j SET --del-set mwan3_sticky_$rule src,src
$IPT -A mwan3_rule_$1 -m mark ! --mark 0xfc00/0xfc00 -j SET --add-set mwan3_sticky_$rule src,src
done
for IPT in "$IPT4" "$IPT6"; do
case $proto in
tcp|udp)
- $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/0xff00 -m comment --comment "$1" -j $policy &> /dev/null
+ $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/$MMX_MASK -m comment --comment "$1" -j $policy &> /dev/null
;;
*)
- $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m mark --mark 0/0xff00 -m comment --comment "$1" -j $policy &> /dev/null
+ $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m mark --mark 0/$MMX_MASK -m comment --comment "$1" -j $policy &> /dev/null
;;
esac
done
case $proto in
tcp|udp)
- $IPT4 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/0xff00 -m comment --comment "$1" -j $policy &> /dev/null
+ $IPT4 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/$MMX_MASK -m comment --comment "$1" -j $policy &> /dev/null
;;
*)
- $IPT4 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m mark --mark 0/0xff00 -m comment --comment "$1" -j $policy &> /dev/null
+ $IPT4 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m mark --mark 0/$MMX_MASK -m comment --comment "$1" -j $policy &> /dev/null
;;
esac
case $proto in
tcp|udp)
- $IPT6 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/0xff00 -m comment --comment "$1" -j $policy &> /dev/null
+ $IPT6 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/$MMX_MASK -m comment --comment "$1" -j $policy &> /dev/null
;;
*)
- $IPT6 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m mark --mark 0/0xff00 -m comment --comment "$1" -j $policy &> /dev/null
+ $IPT6 -A mwan3_rules -p $proto -s $src_ip -d $dest_ip $ipset -m mark --mark 0/$MMX_MASK -m comment --comment "$1" -j $policy &> /dev/null
;;
esac
fi
config_foreach mwan3_set_user_iptables_rule rule
}
+mwan3_set_iface_hotplug_state() {
+ local iface=$1
+ local state=$2
+
+ echo -n $state > $MWAN3_STATUS_DIR/iface_state/$iface
+}
+
+mwan3_get_iface_hotplug_state() {
+ local iface=$1
+
+ cat $MWAN3_STATUS_DIR/iface_state/$iface 2>/dev/null || echo "unknown"
+}
+
mwan3_report_iface_status()
{
local device result track_ips tracking IP IPT
if [ -z "$id" -o -z "$device" ]; then
result="unknown"
- elif [ -n "$($IP rule | awk '$1 == "'$(($id+1000)):'"')"i -a -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" -a -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" -a -n "$($IPT -S mwan3_iface_out_$1 2> /dev/null)" -a -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
- result="online"
+ elif [ -n "$($IP rule | awk '$1 == "'$(($id+1000)):'"')" -a -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" -a -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" -a -n "$($IPT -S mwan3_iface_out_$1 2> /dev/null)" -a -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
+ result="$(mwan3_get_iface_hotplug_state $1)"
elif [ -n "$($IP rule | awk '$1 == "'$(($id+1000)):'"')" -o -n "$($IP rule | awk '$1 == "'$(($id+2000)):'"')" -o -n "$($IPT -S mwan3_iface_in_$1 2> /dev/null)" -o -n "$($IPT -S mwan3_iface_out_$1 2> /dev/null)" -o -n "$($IP route list table $id default dev $device 2> /dev/null)" ]; then
result="error"
+ elif [ "$enabled" == "1" ]; then
+ result="offline"
else
- if [ "$enabled" == "1" ]; then
- result="offline"
- else
- result="disabled"
- fi
+ result="disabled"
fi
mwan3_list_track_ips()
config_list_foreach $1 track_ip mwan3_list_track_ips
if [ -n "$track_ips" ]; then
- if [ -n "$(pgrep -f "mwan3track $1")" ]; then
+ if [ -n "$(pgrep -f "mwan3track $1 $device")" ]; then
tracking="active"
else
tracking="down"
$LOG warning "connection tracking not enabled"
fi
}
+
+mwan3_track_clean()
+{
+ rm -rf "$MWAN3_STATUS_DIR/${1}" &> /dev/null
+ [ -d "$MWAN3_STATUS_DIR" ] && {
+ if [ -z "$(ls -A "$MWAN3_STATUS_DIR")" ]; then
+ rm -rf "$MWAN3_STATUS_DIR"
+ fi
+ }
+}
#!/bin/sh
. /lib/functions.sh
+. /lib/functions/network.sh
. /usr/share/libubox/jshn.sh
-MWAN3_STATUS_DIR="/var/run/mwan3track"
-MWAN3_PID_FILE="/var/run/mwan3track"
+MWAN3TRACK_STATUS_DIR="/var/run/mwan3track"
IPS="ipset"
IPT4="iptables -t mangle -w"
local iface="${1}"
local iface_select="${2}"
local running="0"
- local pid
+ local age=0
+ local pid device time_p time_n
+
+ network_get_device device $1
if [ "${iface}" = "${iface_select}" ] || [ "${iface_select}" = "" ]; then
- pid="$(pgrep -f "mwan3track $iface_selected")"
+ pid="$(pgrep -f "mwan3track $iface $device")"
if [ "${pid}" != "" ]; then
running="1"
fi
+ time_p="$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/TIME")"
+ [ -z "${time_p}" ] || {
+ time_n="$(date +'%s')"
+ let age=time_n-time_p
+ }
+
json_add_object "${iface}"
- json_add_string "score" "$(cat "$MWAN3_STATUS_DIR/${iface}/SCORE")"
- json_add_string "lost" "$(cat "$MWAN3_STATUS_DIR/${iface}/LOST")"
- json_add_string "turn" "$(cat "$MWAN3_STATUS_DIR/${iface}/TURN")"
- json_add_string "status" "$(cat "$MWAN3_STATUS_DIR/${iface}/STATUS")"
+ json_add_int age "$age"
+ json_add_int "score" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/SCORE")"
+ json_add_int "lost" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/LOST")"
+ json_add_int "turn" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/TURN")"
+ json_add_string "status" "$(cat "$MWAN3TRACK_STATUS_DIR/${iface}/STATUS")"
json_add_boolean "running" "${running}"
json_add_array "track_ip"
- for file in $MWAN3_STATUS_DIR/${iface}/*; do
+ for file in $MWAN3TRACK_STATUS_DIR/${iface}/*; do
track="${file#*/TRACK_}"
if [ "${track}" != "${file}" ]; then
json_add_object
ACTION=ifdown INTERFACE=$1 /sbin/hotplug-call iface
- kill $(pgrep -f "mwan3track $1") &> /dev/null
+ kill $(pgrep -f "mwan3track $1 $2") &> /dev/null
+ mwan3_track_clean $1
}
ifup()
killall mwan3track &> /dev/null
+ config_load mwan3
+ config_foreach mwan3_track_clean interface
+
for IP in "$IP4" "$IP6"; do
for route in $($IP route list table all | sed 's/.*table \([^ ]*\) .*/\1/' | awk '{print $1}' | awk '{for(i=1;i<=NF;i++) if($i+0>0) if($i+0<255) {print;break}}'); do
for ipset in $($IPS -n list | grep mwan3 | grep -E '_v4|_v6'); do
$IPS -q destroy $ipset
done
+
+ mwan3_lock_clean
+ rm -rf $MWAN3_STATUS_DIR $MWAN3TRACK_STATUS_DIR
}
restart() {
clean_up() {
$LOG notice "Stopping mwan3track for interface \"${INTERFACE}\""
- if [ "$(pgrep -f "mwan3track ${INTERFACE}")" = "" ]; then
- rm -rf "/var/run/mwan3track/${INTERFACE}" &> /dev/null
- fi
- if [ -z "$(ls -A "/var/run/mwan3track")" ]; then
- rm -rf "/var/run/mwan3track"
- fi
exit 0
}
IFDOWN_EVENT=1
}
+validate_track_method() {
+ case "$1" in
+ ping)
+ # Assume that ping is installed
+ ;;
+ arping)
+ which arping 1>/dev/null 2>&1 || {
+ $LOG warn "Missing arping. Please install iputils-arping package."
+ return 1
+ }
+ ;;
+ httping)
+ which httping 1>/dev/null 2>&1 || {
+ $LOG warn "Missing httping. Please install httping package."
+ return 1
+ }
+ ;;
+ *)
+ $LOG warn "Unsupported tracking method: $track_method"
+ return 2
+ ;;
+ esac
+}
+
main() {
local reliability count timeout interval failure_interval
local recovery_interval down up size
+ local keep_failure_interval
- [ -z "$3" ] && echo "Error: should not be started manually" && exit 0
+ [ -z "$5" ] && echo "Error: should not be started manually" && exit 0
INTERFACE=$1
DEVICE=$2
+ STATUS=$3
+ SRC_IP=$4
mkdir -p /var/run/mwan3track/$1
trap clean_up SIGINT SIGTERM
trap if_down SIGUSR1
config_load mwan3
+ config_get track_method $1 track_method ping
+ validate_track_method $track_method || {
+ $LOG warn "Using ping to track interface $INTERFACE avaliability"
+ track_method=ping
+ }
config_get reliability $1 reliability 1
config_get count $1 count 1
config_get timeout $1 timeout 4
config_get up $1 up 5
config_get size $1 size 56
config_get failure_interval $1 failure_interval $interval
+ config_get_bool keep_failure_interval $1 keep_failure_interval 0
config_get recovery_interval $1 recovery_interval $interval
local score=$(($down+$up))
- local track_ips=$(echo $* | cut -d ' ' -f 3-99)
+ local track_ips=$(echo $* | cut -d ' ' -f 5-99)
local host_up_count=0
local lost=0
local sleep_time=0
local turn=0
- echo "offline" > /var/run/mwan3track/$1/STATUS
+ if [ "$STATUS" = "unknown" ]; then
+ echo "unknown" > /var/run/mwan3track/$1/STATUS
+ score=0
+ else
+ echo "online" > /var/run/mwan3track/$1/STATUS
+ fi
while true; do
sleep_time=$interval
for track_ip in $track_ips; do
- ping -I $2 -c $count -W $timeout -s $size -q $track_ip &> /dev/null
- if [ $? -eq 0 ]; then
- let host_up_count++
- echo "up" > /var/run/mwan3track/$1/TRACK_${track_ip}
+ if [ $host_up_count -lt $reliability ]; then
+ case "$track_method" in
+ ping)
+ ping -I $DEVICE -c $count -W $timeout -s $size -q $track_ip &> /dev/null ;;
+ arping)
+ arping -I $DEVICE -c $count -w $timeout -q $track_ip &> /dev/null ;;
+ httping)
+ httping -y $SRC_IP -c $count -t $timeout -q $track_ip &> /dev/null ;;
+ esac
+ if [ $? -eq 0 ]; then
+ let host_up_count++
+ echo "up" > /var/run/mwan3track/$1/TRACK_${track_ip}
+ else
+ let lost++
+ echo "down" > /var/run/mwan3track/$1/TRACK_${track_ip}
+ fi
else
- let lost++
- echo "down" > /var/run/mwan3track/$1/TRACK_${track_ip}
+ echo "skipped" > /var/run/mwan3track/$1/TRACK_${track_ip}
fi
done
if [ $score -lt $up ]; then
score=0
+ [ ${keep_failure_interval} -eq 1 ] && {
+ sleep_time=$failure_interval
+ }
else
sleep_time=$failure_interval
fi
if [ $score -eq $up ]; then
$LOG notice "Interface $1 ($2) is online"
+ echo "online" > /var/run/mwan3track/$1/STATUS
env -i ACTION=ifup INTERFACE=$1 DEVICE=$2 /sbin/hotplug-call iface
- rm -rf "/var/run/mwan3track/${1}" &> /dev/null
exit 0
fi
fi
echo "${lost}" > /var/run/mwan3track/$1/LOST
echo "${score}" > /var/run/mwan3track/$1/SCORE
echo "${turn}" > /var/run/mwan3track/$1/TURN
+ echo "$(date +'%s')" > /var/run/mwan3track/$1/TIME
host_up_count=0
sleep "${sleep_time}" &
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@SF/nbd
-PKG_MD5SUM:=73d11644a28b9f335292cdb3bdc4b74b
+PKG_HASH:=14420f74cb16dc609a9302ed1efd653064bed7a8357e9d73daabc33608e3f2a0
PKG_LICENSE:=GPL-2.0+
PKG_MAINTAINER:=Marcin Jurkowski <marcin1j@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://dl.fefe.de/
-PKG_MD5SUM:=421c4855bd3148b7d0a4342942b4bf13
+PKG_HASH:=6cfa72edd5f7717bf7a4a93ccc74c4abd89892360e2e0bb095a73c24b9359b88
PKG_BUILD_DEPENDS:=libowfat
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/net-snmp
-PKG_MD5SUM:=d4a3459e1577d0efa8d96ca70a885e53
+PKG_HASH:=12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0
PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
PKG_LICENSE:=MIT BSD-3-Clause-Clear
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=0a29eff1736ddb5effd0b1ec1f6fe0ef
+PKG_HASH:=b55af0bbdf5acc02d1eb6ab18da2acd77a400bafd074489003f3df09676332bb
PKG_MAINTAINER:=Adam Gensler <openwrt@a.gnslr.us>
PKG_LICENSE:=GPL-2.0
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-LINUXONLY.tar.gz
PKG_SOURCE_URL:=@SF/netdiscover
-PKG_MD5SUM:=8780e66d00496e933b4064cfe9ae61da
+PKG_HASH:=01c6e090c3b06e374005f7efcead3b5b2f63f47bfb94383c1dbde9abcf1cd8aa
PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
PKG_LICENSE:=GPL-2.0
+++ /dev/null
-if PACKAGE_netopeer2-server
-
-config SSH_SERVER
- bool "Install the default ssh server (openssh-server)"
- default y
-
-endif
PKG_LICENSE:=BSD-3-Clause
PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
-PKG_VERSION:=0.3.65
+PKG_VERSION:=0.4.0
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=c204b59f9c2bb7e63eb907f33c44adbf208295ee
-PKG_MIRROR_HASH:=61a2b3e0ee9a3cf2f73715843f059c79292446ad3643f4eeb85d48d1e185c3b9
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_SOURCE_VERSION:=d028c1f931819db4b3e3cb1fd2d349a4fd5c0459
+PKG_MIRROR_HASH:=7f5b3ad49aaf2a8ceea2c17a37e276f5694af570ef904cfc5a6f53d295809cef
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/CESNET/Netopeer2.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_BUILD_ROOT:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
-define Package/netopeer2-server/config
- source "$(SOURCE)/Config_server.in"
-endef
-
define Package/netopeer2-keystored/config
source "$(SOURCE)/Config_keystored.in"
endef
CATEGORY:=Utilities
TITLE:=NETCONF server
URL:=$(PKG_SOURCE_URL)
- DEPENDS:=+libpthread +libyang +libnetconf2 +netopeer2-keystored +libsysrepo +sysrepocfg +sysrepoctl +sysrepo +SSH_SERVER:openssh-server
+ DEPENDS:=+libpthread +libyang +libnetconf2 +netopeer2-keystored +libsysrepo +sysrepocfg +sysrepoctl +sysrepo
MENU:=1
endef
sysrepoctl --install --yang=/etc/sysrepo/yang/ietf-netconf-server.yang -o root:root -p 600
sysrepoctl -m ietf-netconf-server -e listen
sysrepoctl -m ietf-netconf-server -e ssh-listen
- sysrepoctl -m ietf-netconf-server -e tls-listen
- sysrepoctl -m ietf-netconf-server -e call-home
- sysrepoctl -m ietf-netconf-server -e ssh-call-home
- sysrepoctl -m ietf-netconf-server -e tls-call-home
if [ -x /bin/sysrepocfg ]; then
sysrepocfg -d startup -i /usr/share/netopeer2-server/stock_config.xml ietf-netconf-server
rm /usr/share/netopeer2-server/stock_config.xml
--- /dev/null
+Index: netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/server/ietf_netconf_server.c
+===================================================================
+--- netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459.orig/server/ietf_netconf_server.c
++++ netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/server/ietf_netconf_server.c
+@@ -1161,8 +1161,8 @@ feature_change_ietf_netconf_server(const
+ {
+ int rc, rc2 = 0;
+ const char *path = NULL;
+- sr_val_iter_t *sr_iter;
+- sr_val_t *sr_val;
++ sr_val_t *values;
++ size_t value_cnt;
+
+ assert(feature_name);
+
+@@ -1180,26 +1180,26 @@ feature_change_ietf_netconf_server(const
+ return EXIT_SUCCESS;
+ }
+
+- rc = sr_get_items_iter(np2srv.sr_sess.srs, path, &sr_iter);
++ rc =sr_get_items(np2srv.sr_sess.srs, path, &values, &value_cnt);
+ if (rc != SR_ERR_OK) {
+ ERR("Failed to get \"%s\" values iterator from sysrepo (%s).", sr_strerror(rc));
+ return EXIT_FAILURE;
+ }
+
+- while ((rc = sr_get_item_next(np2srv.sr_sess.srs, sr_iter, &sr_val)) == SR_ERR_OK) {
+- if (sr_val->type == SR_LIST_T) {
++ size_t i;
++ for(i = 0; i < value_cnt; i++) {
++ if (values[i].type == SR_LIST_T) {
+ /* no semantic meaning */
+ continue;
+ }
+
+- rc2 = module_change_resolve(np2srv.sr_sess.srs, SR_OP_CREATED, NULL, sr_val, NULL, NULL);
+- sr_free_val(sr_val);
++ rc2 = module_change_resolve(np2srv.sr_sess.srs, SR_OP_CREATED, NULL, &values[i], NULL, NULL);
+ if (rc2) {
+ ERR("Failed to enable nodes depending on the \"%s\" ietf-netconf-server feature.", feature_name);
+ break;
+ }
+ }
+- sr_free_val_iter(sr_iter);
++ sr_free_values(values, value_cnt);
+ if (rc2) {
+ return EXIT_FAILURE;
+ } else if ((rc != SR_ERR_OK) && (rc != SR_ERR_NOT_FOUND)) {
--- /dev/null
+Index: netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/cli/CMakeLists.txt
+===================================================================
+--- netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459.orig/cli/CMakeLists.txt
++++ netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/cli/CMakeLists.txt
+@@ -67,6 +67,9 @@ if(NOT MAN_INSTALL_DIR)
+ set(MAN_INSTALL_DIR share/man)
+ endif()
+
++include(CheckFunctionExists)
++check_function_exists(eaccess HAVE_EACCESS)
++
+ # install binary
+ install(TARGETS netopeer2-cli DESTINATION ${BIN_INSTALL_DIR})
+
+Index: netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/cli/commands.c
+===================================================================
+--- netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459.orig/cli/commands.c
++++ netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/cli/commands.c
+@@ -37,6 +37,10 @@
+ # include <openssl/x509v3.h>
+ #endif
+
++#ifndef HAVE_EACCESS
++#define eaccess access
++#endif
++
+ #include "commands.h"
+ #include "configuration.h"
+ #include "completion.h"
+Index: netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/cli/completion.c
+===================================================================
+--- netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459.orig/cli/completion.c
++++ netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/cli/completion.c
+@@ -27,6 +27,10 @@
+
+ #include <nc_client.h>
+
++#ifndef HAVE_EACCESS
++#define eaccess access
++#endif
++
+ #include "commands.h"
+ #include "linenoise/linenoise.h"
+
+Index: netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/cli/configuration.c
+===================================================================
+--- netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459.orig/cli/configuration.c
++++ netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/cli/configuration.c
+@@ -28,6 +28,10 @@
+ #include <libyang/libyang.h>
+ #include <nc_client.h>
+
++#ifndef HAVE_EACCESS
++#define eaccess access
++#endif
++
+ #include "configuration.h"
+ #include "commands.h"
+ #include "linenoise/linenoise.h"
--- /dev/null
+Index: netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/cli/CMakeLists.txt
+===================================================================
+--- netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459.orig/cli/CMakeLists.txt
++++ netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/cli/CMakeLists.txt
+@@ -69,6 +69,10 @@ endif()
+
+ include(CheckFunctionExists)
+ check_function_exists(eaccess HAVE_EACCESS)
++check_function_exists(mkstemps HAVE_MKSTEMPS)
++if(HAVE_MKSTEMPS)
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_MKSTEMPS")
++endif(HAVE_MKSTEMPS)
+
+ # install binary
+ install(TARGETS netopeer2-cli DESTINATION ${BIN_INSTALL_DIR})
+Index: netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/cli/completion.c
+===================================================================
+--- netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459.orig/cli/completion.c
++++ netopeer2-0.4.0-d028c1f931819db4b3e3cb1fd2d349a4fd5c0459/cli/completion.c
+@@ -120,6 +120,7 @@ readinput(const char *instruction, const
+ char* tmpname = NULL, *input = NULL, *old_content = NULL, *ptr, *ptr2;
+
+ /* Create a unique temporary file */
++#ifdef HAVE_MKSTEMPS
+ if (asprintf(&tmpname, "/tmp/tmpXXXXXX.xml") == -1) {
+ ERROR(__func__, "asprintf() failed (%s).", strerror(errno));
+ goto fail;
+@@ -129,6 +130,23 @@ readinput(const char *instruction, const
+ ERROR(__func__, "Failed to create a temporary file (%s).", strerror(errno));
+ goto fail;
+ }
++#else
++ if (asprintf(&tmpname, "/tmp/tmpXXXXXX") == -1) {
++ ERROR(__func__, "asprintf() failed (%s).", strerror(errno));
++ goto fail;
++ }
++ /* cannot fail */
++ mktemp(tmpname);
++ if (asprintf(&tmpname, ".xml") == -1) {
++ ERROR(__func__, "asprintf() failed (%s).", strerror(errno));
++ goto fail;
++ }
++ tmpfd = open(tmpname, O_RDWR | O_CREAT | O_EXCL, 0600);
++ if (tmpfd == -1) {
++ ERROR(__func__, "Failed to create a temporary file (%s).", strerror(errno));
++ goto fail;
++ }
++#endif /* #ifdef HAVE_MKSTEMPS */
+
+ /* Read the old content, if any */
+ if (old_tmp != NULL) {
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.netperf.org/netperf/
-PKG_MD5SUM:=ad1c5342d61f297c417a93133aeba65a
+PKG_HASH:=842af17655835c8be7203808c3393e6cb327a8067f3ed1f1053eb78b4e40375a
include $(INCLUDE_DIR)/package.mk
PKG_NAME:=nfs-kernel-server
PKG_VERSION:=2.1.1
PKG_RELEASE:=1
-PKG_MD5SUM:=1157abcfaa8670f990f408cf280426b4
+PKG_HASH:=0a28416948516c26f3bfe90425b0de09b79364dc1f508bf1dda8de66e1edbb09
PKG_SOURCE_URL:=@SF/nfs
PKG_SOURCE:=nfs-utils-$(PKG_VERSION).tar.bz2
include $(TOPDIR)/rules.mk
PKG_NAME:=nginx
-PKG_VERSION:=1.12.0
+PKG_VERSION:=1.12.1
PKG_RELEASE:=1
PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://nginx.org/download/
-PKG_HASH:=b4222e26fdb620a8d3c3a3a8b955e08b713672e1bc5198d1e4f462308a795b30
-PKG_MD5SUM:=995eb0a140455cf0cfc497e5bd7f94b3
+PKG_HASH:=8793bf426485a30f91021b6b945a9fd8a84d87d17b566562c3797aba8fac76fb
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
PKG_LICENSE:=2-clause BSD-like license
endef
define Download/lua-nginx
- VERSION:=1967998b0eedab1ff51bff8fafa5fc3db47976aa
+ VERSION:=cdd2ae921f67bf396c743406493127be496e57ce
SUBDIR:=lua-nginx
FILE:=lua-nginx-module-$(PKG_VERSION)-$$(VERSION).tar.gz
URL:=https://github.com/openresty/lua-nginx-module.git
PKG_SOURCE_URL:= \
http://ngircd.barton.de/pub/ngircd/ \
ftp://ftp.berlios.de/pub/ngircd/
-PKG_MD5SUM:=59b2d56f6eb55b85225e91ebfbfc848b
+PKG_HASH:=3e00a7da52c81fc1e02bb996a27bf43da905ba7037bf8c6bb3bd13321e0c85ab
PKG_INSTALL:=1
--- /dev/null
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nlbwmon
+PKG_RELEASE:=2
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/jow-/nlbwmon.git
+PKG_SOURCE_DATE:=2017-08-02
+PKG_SOURCE_VERSION:=32fc0925cbc30a4a8f71392e976aa94b586c4086
+PKG_MIRROR_HASH:=caedb66cf6dcbdcee0d1525923e203d003ef15f34a13a328686794666f16171f
+
+CMAKE_INSTALL:=1
+
+PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
+PKG_LICENSE:=ISC
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
+
+define Package/nlbwmon
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=+libubox +libnl-tiny +zlib +kmod-nf-conntrack-netlink
+ TITLE:=LEDE Traffic Usage Monitor
+endef
+
+define Package/nlbwmon/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nlbwmon $(1)/usr/sbin/nlbwmon
+ $(LN) nlbwmon $(1)/usr/sbin/nlbw
+ $(INSTALL_DIR) $(1)/usr/share/nlbwmon
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/protocols.txt $(1)/usr/share/nlbwmon/protocols
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/nlbwmon.init $(1)/etc/init.d/nlbwmon
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_CONF) ./files/nlbwmon.config $(1)/etc/config/nlbwmon
+endef
+
+define Package/nlbwmon/conffiles
+/usr/share/nlbwmon/protocols
+endef
+
+
+$(eval $(call BuildPackage,nlbwmon))
--- /dev/null
+config nlbwmon
+ # Interval at which the temporary in-memory database is committed to
+ # the persistent database directory
+ option commit_interval 24h
+
+ # Interval at which traffic counters of still established connections
+ # are refreshed from netlink information
+ option refresh_interval 30s
+
+ # Storage directory for the database files
+ option database_directory /var/lib/nlbwmon
+
+ # Amount of database generations to retain. If the limit is reached,
+ # the oldest database files are deleted.
+ option database_generations 10
+
+ # Accounting period interval; may be either in the format YYYY-MM-DD/NN
+ # to start a new accounting period exactly every NN days, beginning at
+ # the given date, or a number specifiying the day of month at which to
+ # start the next accounting period.
+ #option database_interval '2017-01-17/14' # every 14 days, starting at Tue
+ #option database_interval '-2' # second last day of month, e.g. 30th in March
+ option database_interval '1' # first day of month (default)
+
+ # The maximum amount of entries that should be put into the database,
+ # setting the limit to 0 will allow databases to grow indefinitely.
+ option database_limit 10000
+
+ # Whether to preallocate the maximum possible database size in memory.
+ # This is mainly useful for memory constrained systems which might not
+ # be able to satisfy memory allocation after longer uptime periods.
+ # Only effective in conjunction with database_limit, ignored otherwise.
+ #option database_prealloc 0
+
+ # Whether to gzip compress archive databases. Compressing the database
+ # files makes accessing old data slightly slower but helps to reduce
+ # storage requirements.
+ #option database_compress 1
+
+ # Protocol description file, used to distinguish traffic streams by
+ # IP protocol number and port
+ option protocol_database /usr/share/nlbwmon/protocols
+
+ # List of local subnets. Only conntrack streams from or to any of these
+ # subnets are counted. Logical interface names may be specified to
+ # resolve the local subnets on the fly.
+ list local_network '192.168.0.0/16'
+ list local_network '172.16.0.0/12'
+ list local_network '10.0.0.0/8'
+ list local_network 'lan'
+
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+START=60
+
+USE_PROCD=1
+NAME=nlbwmon
+PROG=/usr/sbin/nlbwmon
+
+add_subnet() {
+ local network="$1"
+ local range ranges
+
+ case "$network" in
+ *.*|*:*)
+ procd_append_param command '-s' "$network"
+ ;;
+ *)
+ if network_get_subnets ranges "$network"; then
+ for range in $ranges; do
+ procd_append_param command '-s' "$range"
+ done
+ fi
+
+ if network_get_subnets6 ranges "$network"; then
+ for range in $ranges; do
+ procd_append_param command '-s' "$range"
+ done
+ fi
+ ;;
+ esac
+}
+
+add_option() {
+ local cfg="$1"
+ local flag="$2"
+ local option="$3"
+ local default="$4"
+ local value
+
+ config_get value "$cfg" "$option" "$default"
+ [ -n "$value" ] && procd_append_param command "$flag" "$value"
+}
+
+add_bool() {
+ local cfg="$1"
+ local flag="$2"
+ local option="$3"
+ local default="$4"
+ local value
+
+ config_get_bool value "$cfg" "$option" "$default"
+ [ $value -eq 1 ] && procd_append_param command "$flag"
+}
+
+parse_config() {
+ . /lib/functions/network.sh
+
+ local cfg="$1"
+ local dir
+
+ config_get dir "$cfg" database_directory /var/lib/nlbwmon
+
+ mkdir -p "$dir"
+ procd_append_param command -o "$dir"
+
+ add_option "$cfg" -i commit_interval 24h
+ add_option "$cfg" -r refresh_interval 30s
+ add_option "$cfg" -p protocol_database /usr/share/nlbwmon/protocols
+ add_option "$cfg" -G database_generations 10
+ add_option "$cfg" -I database_interval 1
+ add_option "$cfg" -L database_limit 10000
+
+ add_bool "$cfg" -P database_prealloc 0
+ add_bool "$cfg" -Z database_compress 1
+
+ config_list_foreach "$cfg" local_network add_subnet
+}
+
+start_service() {
+ procd_open_instance
+ procd_set_param stderr 1
+ procd_set_param command "$PROG"
+
+ config_load nlbwmon
+ config_foreach parse_config nlbwmon
+
+ procd_close_instance
+}
+
include $(TOPDIR)/rules.mk
PKG_NAME:=nmap
-PKG_VERSION:=7.50
+PKG_VERSION:=7.60
PKG_RELEASE:=1
PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://nmap.org/dist/
-PKG_MD5SUM:=435c7e095bdd4565e0f69c41743a45be
+PKG_SOURCE_URL:=https://nmap.org/dist/
+PKG_HASH:=a8796ecc4fa6c38aad6139d9515dc8113023a82e9d787e5a5fb5fa1b05516f21
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
include $(INCLUDE_DIR)/package.mk
-NMAP_DEPENDS:=+libpcap +libstdcpp
+NMAP_DEPENDS:=+libpcap +libstdcpp +zlib +libpcre
NCAT_DEPENDS:=+libpcap
NPING_DEPENDS:=+libpcap +libpthread +libstdcpp
NDIFF_DEPENDS:=+python
CONFIGURE_ARGS += \
--with-libdnet=included \
- --with-libpcre=included \
+ --with-libpcre="$(STAGING_DIR)/usr" \
--with-libpcap="$(STAGING_DIR)/usr" \
--without-liblua \
--without-zenmap
CXXFLAGS="$$$$CXXFLAGS -fno-builtin"
ifeq ($(BUILD_VARIANT),ssl)
- CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr"
+ CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" --without-libssh2
else
CONFIGURE_ARGS += --without-openssl
endif
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.nlnetlabs.nl/downloads/nsd
-PKG_MD5SUM:=a3f2a9885bc8664ba4a25c938d26a587
+PKG_HASH:=c45cd4ba2101a027e133b2be44db9378e27602e05f09a5ef25019e1ae45291af
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://doolittle.icarus.com/ntpclient/
-PKG_MD5SUM:=a64689398f2df8933ee0d8da246e9eaa
+PKG_HASH:=9ad9b028385082fb804167f464e2db0a0b3d33780acd399327e64898b8fcfddd
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_NAME:=ntp
PKG_VERSION:=4.2.8p10
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/
define Package/ntpd
$(call Package/ntpd/Default)
+ DEPENDS+= +ntp-utils
TITLE+= server
USERID:=ntp=123:ntp=123
endef
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpd/ntpd $(1)/sbin/
$(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpq/ntpq $(1)/usr/sbin/
$(INSTALL_BIN) ./files/ntpd.hotplug-helper $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc
$(INSTALL_CONF) ./files/ntp.conf $(1)/etc/
define Package/ntp-utils/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpdc/ntpdc $(1)/usr/sbin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpq/ntpq $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/util/ntptime $(1)/usr/sbin/
endef
--- /dev/null
+# Configuring NTPD with UCI
+
+## Precedent
+Sysntpd is the lightweight implementation of the NTP protocol under
+Busybox. It supports many (but not all) of the same parameters.
+
+It is configured as a `config timeserver ntp` section in `/etc/config/system`,
+below.
+
+## Configuration
+
+A sample configuration looks like:
+
+**/etc/config/system**:
+
+```
+config timeserver ntp
+ option enabled 1
+ option enable_server 1
+ list server tick.udel.edu
+ list server tock.udel.edu
+ list interface eth0
+ list interface eth1
+ list interface eth2
+```
+
+If you want to temporarily disable the service without deleting all of the
+configuration state, this is done by clearing the `enabled` parameter. If
+this parameter is `1` (the default), the service is enabled.
+
+The service can run as a stand-alone client (`enable_server 0`, the default)
+or it can also operate as a server in turn to local clients, by setting this
+parameter to `1`.
+
+The parameter(s) `server` enumerate a list of servers to be used for
+reference NTP servers by the local daemon. At least one is required,
+and two or more are recommended (unless you have an extremely available
+local server). They should be picked to be geographically divergent,
+and preferrably reachable via different network carriers to protect
+against network partitions, etc. They should also be high-quality
+time providers (i.e. having stable, accurate clock sources).
+
+The `interface` parameter enumerates the list of interfaces on which
+the server is reachable (see `enable_server 1` above), and may be a
+subset of all of the interfaces present on the system. For security
+reasons, you may elect to only offer the service on internal networks.
+If omitted, it defaults to _all_ interfaces.
+
+## Differences with `sysntpd`
+
+Busybox `sysntpd` supports configuring servers based on DHCP
+provisioning (option 6, per the [DHCP and BOOTP
+Parameter](https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml)
+list from IANA). This functionality is enabled (in Busybox) with the
+`use_dhcp` boolean parameter (default `1`), and the `dhcp_interface`
+list parameter, which enumerates the interfaces whose provisioning
+is to be utilized.
+
+### Considerations for DHCP-provisioned NTP servers
+
+Most terrestrial and satellite ISPs have access to very high-quality
+clock sources (these are required to maintain synchronization on T3,
+OC3, etc trunks or earth terminals) but seldom offer access to those
+time sources via NTP in turn to their clients, mostly from a misplaced
+fear that their time source might come under attack (a slave closely
+tied to the master could also provide extremely high-quality time
+without the risk of network desynchronization should it come under
+sophisticated attack).
+
+As a result, the NTP servers that your ISP may point you at are
+often of unknown/unverified quality, and you use them at your own
+risk.
+
+Early millenial versions of Windows (2000, XP, etc) used NTP only
+to _initially set_ the clock to approximately 100ms accuracy (and
+not maintain sychronization), so the bar wasn't set very high.
+Since then, requirements for higher-qualty timekeeping have
+arisen (e.g. multi-master SQL database replication), but most ISPs
+have not kept up with the needs of their users.
+
+Current releases of Windows use Domain Controllers for time
+acquisition via the [NT5DS protocol](https://blogs.msdn.microsoft.com/w32time/2007/07/07/what-is-windows-time-service/)
+when domain joined.
+
+Because of the unreliable quality of NTP servers DHCP-provisioned by
+ISPs, support for this functionality was deemed unnecessary.
PROG=/sbin/ntpd
HOTPLUG_HELPER=/usr/sbin/ntpd.hotplug-helper
+config_file=/var/run/ntpd.conf
+
+trunc() {
+ echo -n "" > $config_file
+}
+
+emit() {
+ echo -e "$@" >> $config_file
+}
+
+validate_ntp_section() {
+ uci_validate_section system timeserver "${1}" \
+ 'server:list(host)' 'enabled:bool:1' 'enable_server:bool:0' \
+ 'interface:list(string)'
+}
+
start_service() {
+ local server enabled enable_server interface intf
+
+ validate_ntp_section ntp || {
+ echo "validation failed"
+ return 1
+ }
+
+ [ "$enabled" = 0 ] && return
+
+ [ -z "$server" -a "$enable_server" = 0 ] && return
+
+ # not sure that the interfaces enumerated should be validated,
+ # since some of them might be dynamic interfaces (like IPsec
+ # tunnels) which aren't known by ubus.
+
+ trunc
+ emit "driftfile /var/lib/ntp/ntp.drift\n"
+
+ if [ "$enable_server" != 0 ]; then
+ emit "restrict default limited kod nomodify notrap nopeer"
+ emit "restrict -6 default limited kod nomodify notrap nopeer"
+ else
+ emit "restrict -4 default noserve"
+ emit "restrict -6 default noserve"
+ fi
+ emit "restrict source noquery"
+
+ emit "\n# No limits for local monitoring"
+ emit "restrict 127.0.0.1"
+ emit "restrict -6 ::1\n"
+
+ if [ -n "$interface" ]; then
+ local loopback=$(ubus call network.interface dump | jsonfilter -e "@.interface[@.interface='loopback']['device']")
+
+ local saw_lo=
+ for intf in $interface; do
+ emit "interface listen $intf"
+ [ "$intf" = "$loopback" ] && saw_lo=1
+ done
+ [ -z "$saw_lo" ] && emit "interface listen $loopback"
+ emit ""
+ fi
+
+ emit "server $server iburst"
+
mkdir -p /var/lib/ntp
chown -R ntp:ntp /var/lib/ntp
procd_open_instance
- procd_set_param command $PROG -g -u ntp:ntp -p /var/run/ntpd.pid -n
+ procd_set_param command $PROG -g -u ntp:ntp -p /var/run/ntpd.pid -n \
+ -c $config_file
procd_close_instance
procd_open_instance
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=03878920195cf854b38a1ea424f1cae57353fa87
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=264656e5f9f9583c477208f005371124bfcbb7ba548f418eb5f1215059d1294b
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=dcfb2cb3e6f31b7291a94e7f86379c78ffc0d44e
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=8d16f2bd0295a2e77fe8651e5f973c3ca4cf0d62fc4d671ebb54cfa8dc7debd0
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=c3034ab575e8442222eb8c2ee9e224cac99cfa6d
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=71f168c4b41c9e1063280fc8aa21d8794c064708fbfa4929093ef5a139e2e736
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.networkupstools.org/source/2.7/
-PKG_MD5SUM:=3ba53656933d7471f95140b32a5b8d5c
+PKG_HASH:=980e82918c52d364605c0703a5dcf01f74ad2ef06e3d365949e43b7d406d25a7
PKG_MAINTAINER:=Daniel Dickinson <lede@cshore.thecshore.com>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE-GPL2
--$(if $(CONFIG_NUT_DRIVER_USB),with,without)-usb \
--without-avahi \
--$(if $(CONFIG_NUT_DRIVER_SNMP),with,without)-snmp \
- --$(if $(CONFIG_NUT_DRIVER_SERAL),with,without)-serial \
+ --$(if $(CONFIG_NUT_DRIVER_SERIAL),with,without)-serial \
--without-neon \
--without-powerman \
--without-wrap \
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/o/obfsproxy
-PKG_MD5SUM:=f596aeeda7bf03cdf0e78e68e6e7ac9f
+PKG_HASH:=1e26c2faef1cfcf856ddf60e9647058a7c78fb0d47f05b58a0f847ed7cc41a66
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=5b86f5802e2e5b23c6a010dc8d10788e6dc57614
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=626ebac2f68ea368c5886f12364d32d34fa59d1cd3b870bacedcca74f968e74c
PKG_LICENSE:=LGPL-2.1+
PKG_FIXUP:=libtool
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/opennhrp
-PKG_MD5SUM:=eb42ddb13e07ceb415b9ebb8eaca28ee
+PKG_HASH:=1517d53d688ffc165a1da20c344d96b4c53e60f34bd73c64e60cb67cfca4e9ab
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_NAME:=openssh
PKG_VERSION:=7.5p1
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
}; done
mkdir -m 0700 -p /var/empty
+ local lport=`grep ^Port /etc/ssh/sshd_config | cut -d " " -f 2`
+ [ -z $lport ] && lport=22
+
procd_open_instance
+ procd_add_mdns "ssh" "tcp" "$lport"
procd_set_param command $PROG -D
procd_close_instance
}
PKG_NAME:=openvswitch
PKG_RELEASE:=1
-PKG_VERSION:=2.7.1
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
+PKG_VERSION:=2.7.2
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=COPYING
PKG_USE_MIPS16:=0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://openvswitch.org/releases/
-PKG_HASH:=b0458cb2a7206f8e5802a524297c9f0569c01ae4bf91037a4dff37dcd0e2a84a
+PKG_HASH:=fe36c86ed52f6f7c17b01cdbb7ae37bf521cc5c2e50997b618f3f742485f655b
PKG_BUILD_DEPENDS:=python/host python-six/host
PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_openvswitch-python
PKG_SOURCE_URL:=@SF/p910nd
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=COPYING
-PKG_MD5SUM:=69461a6c54dca0b13ecad5b83864b43e
+PKG_HASH:=4ac980a3ae24babae6f70f0a692625ece03a4a92c357fbb10d2e368386c3c26f
PKG_MAINTAINER:=Philipp Kerling <pkerling@casix.org>
PKG_INSTALL:=1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=511a6bedd65169ffd1aadb38dd470d53d445cffcc3a322ec2dd0dee6009162a6
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/br101/pingcheck.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.pps.jussieu.fr/~jch/software/files/$(PKG_NAME)/
-PKG_MD5SUM:=86939e331e656f638271f578b6e3f893
+PKG_HASH:=a259750793ab79c491d05fcee5a917faf7d9030fb5d15e05b3704e9c9e4ee015
include $(INCLUDE_DIR)/package.mk
PKG_LICENSE:=BSD-2-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MIRROR_HASH:=0bffa393e740711db3eb930fc2674843c56b0dc9db15ac1887fec8776401af2a
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=git://github.com/mmaraya/port-mirroring.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=http://neil.brown.name/portmap/
-PKG_MD5SUM:=ac108ab68bf0f34477f8317791aaf1ff
+PKG_HASH:=02c820d39f3e6e729d1bea3287a2d8a6c684f1006fb9612f97dcad4a281d41de
PKG_LICENSE:=BSD-4c
PKG_LICENSE_FILES:=portmap.man
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/poptop
-PKG_MD5SUM:=36f9f45c6ffa92bc3b6e24ae2d053505
+PKG_HASH:=8fcd8b8a42de2af59e9fe8cbaa9f894045c977f4d038bbd6346a8522bb7f06c0
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
#
-# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=privoxy
PKG_VERSION:=3.0.26
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=privoxy-$(PKG_VERSION)-stable-src.tar.gz
PKG_SOURCE_URL:=@SF/ijbswa
-PKG_MD5SUM:=8a1c842112ccea68c19b7ceb4a0e999f
+PKG_HASH:=57e415b43ee5dfdca74685cc034053eaae962952fdabd086171551a86abf9cd8
PKG_BUILD_DIR:=$(BUILD_DIR)/privoxy-$(PKG_VERSION)-stable
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
+PKG_MAINTAINER:=
PKG_CONFIG_DEPENDS:= \
CONFIG_IPV6 \
Run as : $(USERID)
Version: $(PKG_VERSION)-$(PKG_RELEASE)
Home : $(URL)
- $(PKG_MAINTAINER)
source "$(SOURCE)/Config.in"
endef
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://prosody.im/downloads/source
-PKG_MD5SUM:=d743adea6cfbaacc3a24cc0c3928bb1b
+PKG_HASH:=1a59a322b71928a21985522aa00d0eab3552208d7bf9ecb318542a1b2fee3e8d
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
PKG_LICENSE:=MIT/X11
PKG_SOURCE_URL:=https://github.com/phhusson/quassel-irssi
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_MIRROR_HASH:=fd13b2497e3b0d0779e0ce3d8b27c37e207d2a73b5b6dc0cb2799bd4472fc5e1
PKG_MAINTAINER:=Ben Rosser <rosser.bjr@gmail.com>
#
-# Copyright (C) 2008-2016 OpenWrt.org
+# Copyright (C) 2008-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=radicale
-PKG_VERSION:=1.1.3
+PKG_VERSION:=1.1.6
PKG_RELEASE:=1
PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/Kozea/Radicale
-PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=d5171958ffe41e495ccaf2c02702d9acb0c6e6ad
+PKG_SOURCE_VERSION:=7568ec39f09a753217fb2d525c5f8db64f4d98f4
+PKG_MIRROR_HASH:=73de51e296479f860d4d8cd383a6aa34e8c702d9fca63b0499c7fcc2e794e6df
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://software.uninett.no/radsecproxy/
-PKG_MD5SUM:=b868f7faf4887a10376d1bd96ef75368
+PKG_HASH:=9923203c3aaf17e31d5bc7a61b99e5a6aa0ef19a8397616f6ef9c0c41948f7d2
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/reaver-wps
-PKG_MD5SUM:=05441dda7bacfcbe1e831c85d1ea3bc9
+PKG_HASH:=add3050a4a05fe0ab6bfb291ee2de8e9b8a85f1e64ced93ee27a75744954b22d
PKG_LICENSE:=GPL-2.0
PKG_USE_MIPS16:=0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=30ced050c58cbdd39732921a794b053127e9c45ebdcdd4a6023bdc5e434607da
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/darkk/redsocks.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://lpccomp.bc.ca/remserial/
-PKG_MD5SUM:=b19b57fd118329c5ea3aaf9887f946a6
+PKG_HASH:=4cbe9c754a2be4926789500bafb84bda54e11b01aab522a3ce71ec4db615fefb
PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://roaringpenguin.com/files/download
-PKG_MD5SUM:=00794e04031546b0e9b8cf286f2a6d1ccfc4a621b2a3abb2d7ef2a7ab7cc86c2
+PKG_HASH:=00794e04031546b0e9b8cf286f2a6d1ccfc4a621b2a3abb2d7ef2a7ab7cc86c2
PKG_BUILD_DEPENDS:=ppp
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://download.samba.org/pub/rsync/src
-PKG_MD5SUM:=0f758d7e000c0f7f7d3792610fad70cb
+PKG_HASH:=ecfa62a7fa3c4c18b9eccd8c16eaddee4bd308a76ea50b5c02a5840f09c0a1c2
PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.rsyslog.com/files/download/rsyslog/
-PKG_MD5SUM:=750d552bdcbf255c85f464ffbe21168a
+PKG_HASH:=94346237ecfa22c9f78cebc3f18d59056f5d9846eb906c75beaa7e486f02c695
PKG_MAINTAINER:=Dov Murik <dmurik@us.ibm.com>
PKG_LICENSE:=GPL-3.0
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=62cb5a4605c0664bc522e0e0da9c72f09cf643a9
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=3c6834b12ebfa8d62618f6e9dbc06dfa593861fa0b435d2fd1bddb0e886fc77b
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
PKG_SOURCE_URL:=https://bitbucket.org/secdev/scapy/downloads/
-PKG_MD5SUM:=a30d828e59801d1d092219b349f1da9e
+PKG_HASH:=8972c02e39a826a10c02c2bdd5025f7251dce9589c57befd9bb55c65f02e4934
PKG_BUILD_DEPENDS:=python python-setuptools
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=a0de32b9cfeca98ab93d84cacbe9d315d7ecca35
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=b7ac0e5775aff91746e7bfc297b6cf788c9e7372084e28762467f8bd75cee2f8
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=2cf75b17a372216a88842172f769d61f621416fd
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=69e90cff3bb63967bca1bd04c8e25ff6f89aa5dba595df29854115c3560d9804
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=715f072c1bbc78eedddcaf7748e28c83c3f4dbc6
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=eaba9296a1fbc4429bacc6234e3e643da7b8f7950ba42c9b9b5b1d58c38c4273
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/ser2net
-PKG_MD5SUM:=562274d783534276a9feac913b7d8c4e
PKG_HASH:=d846066e27c3072565990745d030357aa0c278f96b7d1d4f59023347c1db8824
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=b59d754f838213d60b908aed0b7d4d5a81f273e2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=55da440f514507359ccc86aa07ee97cecfa3ad2c65db92e031b1dc7a27eac494
PKG_MAINTAINER:=Gang Zhao <gang.zhao.42@gmail.com>
PKG_LICENSE:=MIT
# Checklist when bumping versions
#
# - update cipher list by checking src/crypto.c:crypto_init()
-# - check if default mode has changed from TCP_ONLY
-# - check if ss-rules has been upstreamed
-#
-# TODO
-#
-# - add validate type: user
+# - check if default mode has changed from being tcp_only
#
PKG_NAME:=shadowsocks-libev
-PKG_VERSION:=3.0.6
-PKG_RELEASE:=2
+PKG_VERSION:=3.1.0
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION)
-PKG_HASH:=7d9b43b0235a57c115bfe160efd54abef96bffcbfff61c5496e7c2800f0734ca
+PKG_HASH:=3b6493ebdcfff1eb31faf34d164d57049f7253ff5bffafa6ce2263c9ac123f31
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
SUBMENU:=Web Servers/Proxies
TITLE:=shadowsocks-libev $(1)
URL:=https://github.com/shadowsocks/shadowsocks-libev
- DEPENDS:=+libev +libmbedtls +libpcre +libpthread +libsodium +libudns +shadowsocks-libev-config +zlib
+ DEPENDS:=+libcares +libev +libmbedtls +libpcre +libpthread +libsodium +shadowsocks-libev-config +zlib
endef
define Package/shadowsocks-libev-$(1)/install
SUBMENU:=Web Servers/Proxies
TITLE:=shadowsocks-libev ss-rules
URL:=https://github.com/shadowsocks/shadowsocks-libev
- DEPENDS:=+ip +ipset +iptables-mod-tproxy +shadowsocks-libev-ss-redir +shadowsocks-libev-config
+ DEPENDS:=+ip +ipset +iptables-mod-tproxy +resolveip +shadowsocks-libev-ss-redir +shadowsocks-libev-config
endef
define Package/shadowsocks-libev-ss-rules/install
EOF
endef
-CONFIGURE_ARGS += --disable-documentation
+define Build/Prepare
+ $(call Build/Prepare/Default)
+ $(FIND) $(PKG_BUILD_DIR) \
+ -name '*.o' \
+ -o -name '*.lo' \
+ -o -name '.deps' \
+ -o -name '.libs' \
+ | $(XARGS) rm -rvf
+endef
+
+CONFIGURE_ARGS += \
+ --disable-documentation \
+ --disable-silent-rules \
+ --disable-assert \
+ --disable-ssp \
$(eval $(call BuildPackage,shadowsocks-libev-config))
$(eval $(call BuildPackage,shadowsocks-libev-ss-rules))
## components
-`ss-local` provides SOCKS5 proxy.
+`ss-local` provides SOCKS5 proxy with UDP associate support.
socks5 ss plain
- --------> tcp:udp:local_address:local_port ----> ss server -------> dest
+ --------> tcp:local_address:local_port ----> ss server -------> dest
`ss-redir`. The REDIRECT and TPROXY part are to be provided by `ss-rules` script. REDIRECT only works for tcp traffic (see also darkk/redsocks). TPROXY is used to proxy udp messages, but it's only available in the PREROUTING chain and as such cannot proxy local out traffic.
redir_tcp name of ss_redir section with mode tcp_only or tcp_and_udp
redir_udp name of ss_redir section with mode udp_only or tcp_and_udp
+ ifnames only apply rules on packets from these ifnames
- --- incoming packets having source address in
+ --- for incoming packets having source address in
src_ips_bypass will bypass the redir chain
src_ips_forward will always go through the redir chain
src_default bypass, forward, [checkdst]
- --- for local out tcp packets, the default action can be specified with
-
- local_default [bypass], forward, checkdst
-
--- if the previous check result is checkdst,
--- then packets having destination address in
dst_ips_forward_file
dst_ips_forward will go through the redir chain
+ --- otherwise, the default action can be specified with
+
+ dst_default [bypass], forward
+
+ --- for local out tcp packets, the default action can be specified with
+
+ local_default [bypass], forward, checkdst
+
+Bool option `dst_forward_recentrst` requires iptables/netfilter `recent` match module (`opkg install iptables-mod-conntrack-extra`). When enabled, `ss-rules` will setup iptables rules to forward through `ss-redir` those packets whose destination have recently sent to us multiple tcp-rst.
+
+ss-rules uses kernel ipset mechanism for storing addresses/networks. Those ipsets are also part of the API and can be populated by other programs, e.g. dnsmasq with builtin ipset support. For more details please read output of `ss-rules --help`
+
+Note also that `src_ips_xx` and `dst_ips_xx` actually also accepts cidr network representation. Option names are retained in its current form for backward compatibility coniderations
+
## notes and faq
Useful paths and commands for debugging
option disabled 1
option redir_tcp 'hi'
option redir_udp 'hi'
- option src_default 'bypass'
+ option src_default 'checkdst'
+ option dst_default 'bypass'
option local_default 'checkdst'
list src_ips_forward '192.168.1.4'
list dst_ips_forward '8.8.8.8'
local func
for func in "$@"; do
- if ! "$func"; then
- return 1
- fi
+ "$func" || return 1
done
}
ss_mkjson_server_conf_() {
[ -n "$server_port" ] || return 1
+ password="${password//\"/\\\"}"
cat <<-EOF
${server:+${q}server${q}: ${q}$server${q},}
"server_port": $server_port,
}
ss_mkjson_common_conf() {
+ [ "$ipv6_first" = 0 ] && ipv6_first=false || ipv6_first=true
[ "$fast_open" = 0 ] && fast_open=false || fast_open=true
[ "$reuse_port" = 0 ] && reuse_port=false || reuse_port=true
cat <<-EOF
"use_syslog": true,
+ "ipv6_first": $ipv6_first,
"fast_open": $fast_open,
"reuse_port": $reuse_port,
${local_address:+${q}local_address${q}: ${q}$local_address${q},}
}
ss_mkjson_ss_redir_conf() {
- ss_mkjson_server_conf
+ ss_mkjson_server_conf || return 1
+ [ "$disable_sni" = 0 ] && disable_sni=false || disable_sni=true
+ cat <<-EOF
+ "disable_sni": $disable_sni,
+ EOF
}
ss_mkjson_ss_server_conf() {
[ -x "$bin" ] || return
eval "$("validate_${cfgtype}_section" "$cfg" ss_validate_mklocal)"
- "validate_${cfgtype}_section" "$cfg"
+ "validate_${cfgtype}_section" "$cfg" || return 1
[ "$disabled" = 0 ] || return
if ss_mkjson \
procd_set_param file "$confjson"
procd_set_param respawn
procd_close_instance
- ss_rules_cb "$cfg"
+ ss_rules_cb
fi
}
ss_rules_cb() {
- local cfgserver
- local server
-
- [ "$cfgtype" != ss_server ] || return
- config_get cfgserver "$cfg" server
- config_get server "$cfgserver" server
+ local cfgserver server
- ss_rules_servers="$ss_rules_servers $server"
if [ "$cfgtype" = ss_redir ]; then
+ config_get cfgserver "$cfg" server
+ config_get server "$cfgserver" server
+ ss_redir_servers="$ss_redir_servers $server"
if [ "$mode" = tcp_only -o "$mode" = "tcp_and_udp" ]; then
eval "ss_rules_redir_tcp_$cfg=$local_port"
fi
if [ "$mode" = udp_only -o "$mode" = "tcp_and_udp" ]; then
eval "ss_rules_redir_udp_$cfg=$local_port"
- eval "ss_rules_redir_server_udp_$cfg=$server"
fi
fi
}
local cfg="ss_rules"
local bin="$ss_bindir/ss-rules"
local cfgtype
- local args local_port_tcp local_port_udp server_udp
- local i a_args d_args
+ local local_port_tcp local_port_udp
+ local args
[ -x "$bin" ] || return 1
config_get cfgtype "$cfg" TYPE
[ "$cfgtype" = ss_rules ] || return 1
eval "$(validate_ss_rules_section "$cfg" ss_validate_mklocal)"
- validate_ss_rules_section "$cfg"
+ validate_ss_rules_section "$cfg" || return 1
[ "$disabled" = 0 ] || return 1
eval local_port_tcp="\$ss_rules_redir_tcp_$redir_tcp"
eval local_port_udp="\$ss_rules_redir_udp_$redir_udp"
- eval server_udp="\$ss_rules_redir_server_udp_$redir_udp"
- [ -z "$local_port_udp" ] || args="$args -U"
- case "$local_default" in
- forward) args="$args -O" ;;
- checkdst) args="$args -o" ;;
- esac
- case "$src_default" in
- bypass) d_args=RETURN ;;
- forward) d_args=SS_SPEC_WAN_FW ;;
- checkdst) d_args=SS_SPEC_WAN_AC ;;
- esac
- ss_rules_servers="$(echo "$ss_rules_servers" | tr ' ' '\n' | sort -u)"
- for i in $src_ips_bypass; do a_args="b,$i $a_args"; done
- for i in $src_ips_forward; do a_args="g,$i $a_args"; done
- for i in $src_ips_checkdst; do a_args="n,$i $a_args"; done
+ [ -n "$local_port_tcp" -o -n "$local_port_udp" ] || return 1
+ ss_redir_servers="$(echo "$ss_redir_servers" | tr ' ' '\n' | sort -u)"
+ [ "$dst_forward_recentrst" = 0 ] || args="$args --dst-forward-recentrst"
"$bin" \
- -s "$ss_rules_servers" \
+ -s "$ss_redir_servers" \
-l "$local_port_tcp" \
- -S "$server_udp" \
-L "$local_port_udp" \
- -B "$dst_ips_bypass_file" \
- -W "$dst_ips_forward_file" \
- -b "$dst_ips_bypass" \
- -w "$dst_ips_forward" \
- -e "$ipt_args" \
- -a "$a_args" \
- -d "$d_args" \
+ --src-default "$src_default" \
+ --dst-default "$dst_default" \
+ --local-default "$local_default" \
+ --dst-bypass-file "$dst_ips_bypass_file" \
+ --dst-forward-file "$dst_ips_forward_file" \
+ --dst-bypass "$dst_ips_bypass" \
+ --dst-forward "$dst_ips_forward" \
+ --src-bypass "$src_ips_bypass" \
+ --src-forward "$src_ips_forward" \
+ --src-checkdst "$src_ips_checkdst" \
+ --ifnames "$ifnames" \
+ --ipt-extra "$ipt_args" \
$args \
|| "$bin" -f
}
start_service() {
- local cfgtype="$1"
+ local cfgtype
mkdir -p "$ss_confdir"
config_load shadowsocks-libev
local cfg="$1"; shift
local func="$1"; shift
local stream_methods='"table", "rc4", "rc4-md5", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "bf-cfb", "camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "salsa20", "chacha20", "chacha20-ietf"'
- local aead_methods='"aes-128-gcm", "aes-192-gcm", "aes-256-gcm"'
+ local aead_methods='"aes-128-gcm", "aes-192-gcm", "aes-256-gcm", "chacha20-ietf-poly1305", "xchacha20-ietf-poly1305"'
"${func:-ss_validate}" "$cfgtype" "$cfg" "$@" \
- 'disabled:bool:false' \
+ 'disabled:bool:0' \
'server:host' \
'server_port:port' \
'password:string' \
local func="$1"; shift
"${func:-ss_validate}" "$cfgtype" "$cfg" "$@" \
- 'disabled:bool:false' \
- 'verbose:bool:false' \
- 'fast_open:bool:false' \
- 'reuse_port:bool:false' \
- 'mode:or("tcp_only", "udp_only", "tcp_and_udp")' \
+ 'disabled:bool:0' \
+ 'fast_open:bool:0' \
+ 'ipv6_first:bool:0' \
+ 'reuse_port:bool:0' \
+ 'verbose:bool:0' \
+ 'mode:or("tcp_only", "udp_only", "tcp_and_udp"):tcp_only' \
'mtu:uinteger' \
'timeout:uinteger' \
'user:string'
}
validate_ss_redir_section() {
- validate_common_client_options_ ss_redir "$1" "${2}"
+ validate_common_client_options_ ss_redir "$1" \
+ "${2}" \
+ 'disable_sni:bool:0'
}
validate_ss_rules_section() {
"${2:-ss_validate}" ss_rules "$1" \
- 'disabled:bool:false' \
+ 'disabled:bool:0' \
'redir_tcp:uci("shadowsocks-libev", "@ss_redir")' \
'redir_udp:uci("shadowsocks-libev", "@ss_redir")' \
- 'src_ips_bypass:list(ipaddr)' \
- 'src_ips_forward:list(ipaddr)' \
- 'src_ips_checkdst:list(ipaddr)' \
+ 'src_ips_bypass:or(ip4addr,cidr4)' \
+ 'src_ips_forward:or(ip4addr,cidr4)' \
+ 'src_ips_checkdst:or(ip4addr,cidr4)' \
'dst_ips_bypass_file:file' \
- 'dst_ips_bypass:list(ipaddr)' \
+ 'dst_ips_bypass:or(ip4addr,cidr4)' \
'dst_ips_forward_file:file' \
- 'dst_ips_forward:list(ipaddr)' \
- 'src_default:or("bypass", "forward", "checkdst")' \
- 'local_default:or("bypass", "forward", "checkdst")' \
+ 'dst_ips_forward:or(ip4addr,cidr4)' \
+ 'src_default:or("bypass", "forward", "checkdst"):checkdst' \
+ 'dst_default:or("bypass", "forward"):bypass' \
+ 'local_default:or("bypass", "forward", "checkdst"):bypass' \
+ 'dst_forward_recentrst:bool:0' \
+ 'ifnames:maxlength(15)' \
'ipt_args:string'
}
-#!/bin/sh
+#!/bin/sh -e
#
-# Copyright (C) 2014-2017 Jian Chang <aa65535@live.com>
+# Copyright (C) 2017 Yousong Zhou <yszhou4tech@gmail.com>
+#
+# The design idea was derived from ss-rules by Jian Chang <aa65535@live.com>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
-usage() {
- cat <<-EOF
- Usage: ss-rules [options]
+ss_rules_usage() {
+ cat >&2 <<EOF
+Usage: ss-rules [options]
+
+ -h, --help Show this help message then exit
+ -f, --flush Flush rules, ipset then exit
+ -l <port> Local port number of ss-redir with TCP mode
+ -L <port> Local port number of ss-redir with UDP mode
+ -s <ips> List of ip addresses of remote shadowsocks server
+ --ifnames Only apply rules on packets from these ifnames
+ --src-bypass <ips|cidr>
+ --src-forward <ips|cidr>
+ --src-checkdst <ips|cidr>
+ --src-default <bypass|forward|checkdst>
+ Packets will have their src ip checked in order against
+ bypass, forward, checkdst list and will bypass, forward
+ through, or continue to have their dst ip checked
+ respectively on the first match. Otherwise, --src-default
+ decide the default action
+ --dst-bypass <ips|cidr>
+ --dst-forward <ips|cidr>
+ --dst-bypass-file <file>
+ --dst-forward-file <file>
+ --dst-default <bypass|forward>
+ Same as with their --src-xx equivalent
+ --dst-forward-recentrst
+ Forward those packets whose destinations have recently
+ sent to us multiple tcp-rst packets
+ --local-default <bypass|forward|checkdst>
+ Default action for local out TCP traffic
- Valid options are:
+The following ipsets will be created by ss-rules. They are also intended to be
+populated by other programs like dnsmasq with ipset support
- -s <server_ips> ip address of shadowsocks remote server
- -l <local_port> port number of shadowsocks local server
- -S <server_ips> ip address of shadowsocks remote UDP server
- -L <local_port> port number of shadowsocks local UDP server
- -B <ip_list_file> a file whose content is bypassed ip list
- -b <wan_ips> wan ip of will be bypassed
- -W <ip_list_file> a file whose content is forwarded ip list
- -w <wan_ips> wan ip of will be forwarded
- -I <interface> proxy only for the given interface
- -d <target> the default target of lan access control
- -a <lan_hosts> lan ip of access control, need a prefix to
- define proxy type
- -e <extra_args> extra arguments for iptables
- -o apply the rules to the OUTPUT chain
- -O apply the global rules to the OUTPUT chain
- -u enable udprelay mode, TPROXY is required
- -U enable udprelay mode, using different IP
- and ports for TCP and UDP
- -f flush the rules
- -h show this help message and exit
+ ss_rules_src_bypass
+ ss_rules_src_forward
+ ss_rules_src_checkdst
+ ss_rules_dst_bypass
+ ss_rules_dst_forward
EOF
- exit $1
}
-loger() {
- # 1.alert 2.crit 3.err 4.warn 5.notice 6.info 7.debug
- logger -st ss-rules[$$] -p$1 $2
-}
+o_dst_bypass_="
+ 0.0.0.0/8
+ 10.0.0.0/8
+ 100.64.0.0/10
+ 127.0.0.0/8
+ 169.254.0.0/16
+ 172.16.0.0/12
+ 192.0.0.0/24
+ 192.0.2.0/24
+ 192.31.196.0/24
+ 192.52.193.0/24
+ 192.88.99.0/24
+ 192.168.0.0/16
+ 192.175.48.0/24
+ 198.18.0.0/15
+ 198.51.100.0/24
+ 203.0.113.0/24
+ 224.0.0.0/4
+ 240.0.0.0/4
+ 255.255.255.255
+"
+o_src_default=bypass
+o_dst_default=bypass
+o_local_default=bypass
-flush_rules() {
- iptables-save -c | grep -v "SS_SPEC" | iptables-restore -c
- if command -v ip >/dev/null 2>&1; then
- ip rule del fwmark 1 lookup 100 2>/dev/null
- ip route del local default dev lo table 100 2>/dev/null
- fi
- for setname in $(ipset -n list | grep "ss_spec"); do
- ipset destroy $setname 2>/dev/null
- done
- FWI=$(uci get firewall.shadowsocks.path 2>/dev/null)
- [ -n "$FWI" ] && echo '# firewall include file' >$FWI
- return 0
+__errmsg() {
+ echo "ss-rules: $*" >&2
}
-ipset_init() {
- ipset -! restore <<-EOF || return 1
- create ss_spec_src_ac hash:ip hashsize 64
- create ss_spec_src_bp hash:ip hashsize 64
- create ss_spec_src_fw hash:ip hashsize 64
- create ss_spec_dst_sp hash:net hashsize 64
- create ss_spec_dst_bp hash:net hashsize 64
- create ss_spec_dst_fw hash:net hashsize 64
- $(gen_lan_host_ipset_entry)
- $(gen_special_purpose_ip | sed -e "s/^/add ss_spec_dst_sp /")
- $(sed -e "s/^/add ss_spec_dst_bp /" ${WAN_BP_LIST:=/dev/null} 2>/dev/null)
- $(for ip in $WAN_BP_IP; do echo "add ss_spec_dst_bp $ip"; done)
- $(sed -e "s/^/add ss_spec_dst_fw /" ${WAN_FW_LIST:=/dev/null} 2>/dev/null)
- $(for ip in $WAN_FW_IP; do echo "add ss_spec_dst_fw $ip"; done)
-EOF
- return 0
-}
+ss_rules_parse_args() {
+ while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -h|--help) ss_rules_usage; exit 0;;
+ -f|--flush) ss_rules_flush; exit 0;;
+ -l) o_redir_tcp_port="$2"; shift 2;;
+ -L) o_redir_udp_port="$2"; shift 2;;
+ -s) o_remote_servers="$2"; shift 2;;
+ --ifnames) o_ifnames="$2"; shift 2;;
+ --ipt-extra) o_ipt_extra="$2"; shift 2;;
+ --src-default) o_src_default="$2"; shift 2;;
+ --dst-default) o_dst_default="$2"; shift 2;;
+ --local-default) o_local_default="$2"; shift 2;;
+ --src-bypass) o_src_bypass="$2"; shift 2;;
+ --src-forward) o_src_forward="$2"; shift 2;;
+ --src-checkdst) o_src_checkdst="$2"; shift 2;;
+ --dst-bypass) o_dst_bypass="$2"; shift 2;;
+ --dst-forward) o_dst_forward="$2"; shift 2;;
+ --dst-forward-recentrst) o_dst_forward_recentrst=1; shift 1;;
+ --dst-bypass-file) o_dst_bypass_file="$2"; shift 2;;
+ --dst-forward-file) o_dst_forward_file="$2"; shift 2;;
+ *) __errmsg "unknown option $1"; return 1;;
+ esac
+ done
-ipt_nat() {
- include_ac_rules nat
- ipt="iptables -t nat"
- $ipt -A SS_SPEC_WAN_FW -p tcp \
- -j REDIRECT --to-ports $local_port || return 1
- if [ -n "$OUTPUT" ]; then
- $ipt -N SS_SPEC_WAN_DG
- $ipt -A SS_SPEC_WAN_DG -m set --match-set ss_spec_dst_sp dst -j RETURN
- $ipt -A SS_SPEC_WAN_DG -p tcp $EXT_ARGS -j $OUTPUT
- $ipt -I OUTPUT 1 -p tcp -j SS_SPEC_WAN_DG
+ if [ -z "$o_redir_tcp_port" -a -z "$o_redir_udp_port" ]; then
+ __errmsg "Requires at least -l or -L option"
+ return 1
fi
- return $?
+ if [ -n "$o_dst_forward_recentrst" ] && ! iptables -m recent -h >/dev/null; then
+ __errmsg "Please install iptables-mod-conntrack-extra with opkg"
+ return 1
+ fi
+ o_remote_servers="$(for s in $o_remote_servers; do resolveip -4 "$s"; done)"
}
-ipt_mangle() {
- [ -n "$TPROXY" ] || return 0
- if !(lsmod | grep -q TPROXY && command -v ip >/dev/null); then
- loger 4 "TPROXY or ip not found."
- return 0
- fi
- ip rule add fwmark 1 lookup 100
- ip route add local default dev lo table 100
- include_ac_rules mangle
- iptables -t mangle -A SS_SPEC_WAN_FW -p udp \
- -j TPROXY --on-port $LOCAL_PORT --tproxy-mark 0x01/0x01
- return $?
+ss_rules_flush() {
+ local setname
+
+ iptables-save --counters | grep -v ss_rules_ | iptables-restore --counters
+ while ip rule del fwmark 1 lookup 100 2>/dev/null; do true; done
+ ip route flush table 100
+ for setname in $(ipset -n list | grep "ss_rules_"); do
+ ipset destroy "$setname" 2>/dev/null || true
+ done
}
-export_ipt_rules() {
- [ -n "$FWI" ] || return 0
- cat <<-CAT >>$FWI
- iptables-save -c | grep -v "SS_SPEC" | iptables-restore -c
- iptables-restore -n <<-EOF
- $(iptables-save | grep -E "SS_SPEC|^\*|^COMMIT" |\
- sed -e "s/^-A \(OUTPUT\|PREROUTING\)/-I \1 1/")
+ss_rules_ipset_init() {
+ ipset --exist restore <<-EOF
+ create ss_rules_src_bypass hash:net hashsize 64
+ create ss_rules_src_forward hash:net hashsize 64
+ create ss_rules_src_checkdst hash:net hashsize 64
+ create ss_rules_dst_bypass hash:net hashsize 64
+ create ss_rules_dst_bypass_ hash:net hashsize 64
+ create ss_rules_dst_forward hash:net hashsize 64
+ create ss_rules_dst_forward_recentrst_ hash:ip hashsize 64 timeout 3600
+ $(ss_rules_ipset_mkadd ss_rules_dst_bypass_ "$o_dst_bypass_ $o_remote_servers")
+ $(ss_rules_ipset_mkadd ss_rules_src_bypass "$o_src_bypass")
+ $(ss_rules_ipset_mkadd ss_rules_src_forward "$o_src_forward")
+ $(ss_rules_ipset_mkadd ss_rules_src_checkdst "$o_src_checkdst")
+ $(ss_rules_ipset_mkadd ss_rules_dst_bypass "$o_dst_bypass $(cat "$o_dst_bypass_file" 2>/dev/null)")
+ $(ss_rules_ipset_mkadd ss_rules_dst_forward "$o_dst_forward $(cat "$o_dst_forward_file" 2>/dev/null)")
EOF
-CAT
- return $?
}
-gen_lan_host_ipset_entry() {
- for host in $LAN_HOSTS; do
- case "${host:0:1}" in
- n|N)
- echo add ss_spec_src_ac ${host:2}
- ;;
- b|B)
- echo add ss_spec_src_bp ${host:2}
- ;;
- g|G)
- echo add ss_spec_src_fw ${host:2}
- ;;
- esac
+ss_rules_ipset_mkadd() {
+ local setname="$1"; shift
+ local i
+
+ for i in $*; do
+ echo "add $setname $i"
done
}
-gen_special_purpose_ip() {
- cat <<-EOF | grep -E "^([0-9]{1,3}\.){3}[0-9]{1,3}"
- 0.0.0.0/8
- 10.0.0.0/8
- 100.64.0.0/10
- 127.0.0.0/8
- 169.254.0.0/16
- 172.16.0.0/12
- 192.0.0.0/24
- 192.0.2.0/24
- 192.31.196.0/24
- 192.52.193.0/24
- 192.88.99.0/24
- 192.168.0.0/16
- 192.175.48.0/24
- 198.18.0.0/15
- 198.51.100.0/24
- 203.0.113.0/24
- 224.0.0.0/4
- 240.0.0.0/4
- 255.255.255.255
- $server
- $SERVER
-EOF
+ss_rules_iptchains_init() {
+ ss_rules_iptchains_init_tcp
+ ss_rules_iptchains_init_udp
}
-include_ac_rules() {
- local protocol=$([ "$1" = "mangle" ] && echo udp || echo tcp)
- iptables-restore -n <<-EOF
- *$1
- :SS_SPEC_LAN_DG - [0:0]
- :SS_SPEC_LAN_AC - [0:0]
- :SS_SPEC_WAN_AC - [0:0]
- :SS_SPEC_WAN_FW - [0:0]
- -A SS_SPEC_LAN_DG -m set --match-set ss_spec_dst_sp dst -j RETURN
- -A SS_SPEC_LAN_DG -p $protocol $EXT_ARGS -j SS_SPEC_LAN_AC
- -A SS_SPEC_LAN_AC -m set --match-set ss_spec_src_bp src -j RETURN
- -A SS_SPEC_LAN_AC -m set --match-set ss_spec_src_fw src -j SS_SPEC_WAN_FW
- -A SS_SPEC_LAN_AC -m set --match-set ss_spec_src_ac src -j SS_SPEC_WAN_AC
- -A SS_SPEC_LAN_AC -j ${LAN_TARGET:=SS_SPEC_WAN_AC}
- -A SS_SPEC_WAN_AC -m set --match-set ss_spec_dst_fw dst -j SS_SPEC_WAN_FW
- -A SS_SPEC_WAN_AC -m set --match-set ss_spec_dst_bp dst -j RETURN
- -A SS_SPEC_WAN_AC -j SS_SPEC_WAN_FW
- $(gen_prerouting_rules $protocol)
- COMMIT
-EOF
+ss_rules_iptchains_init_tcp() {
+ local local_target
+
+ [ -n "$o_redir_tcp_port" ] || return 0
+
+ ss_rules_iptchains_init_ nat tcp
+
+ case "$o_local_default" in
+ checkdst) local_target=ss_rules_dst ;;
+ forward) local_target=ss_rules_forward ;;
+ bypass|*) return 0;;
+ esac
+
+ iptables-restore --noflush <<-EOF
+ *nat
+ :ss_rules_local_out -
+ -I OUTPUT 1 -p tcp -j ss_rules_local_out
+ -A ss_rules_local_out -m set --match-set ss_rules_dst_bypass_ dst -j RETURN
+ -A ss_rules_local_out -p tcp $o_ipt_extra -j $local_target -m comment --comment "local_default: $o_local_default"
+ COMMIT
+ EOF
}
-gen_prerouting_rules() {
- [ -z "$IFNAMES" ] && echo -I PREROUTING 1 -p $1 -j SS_SPEC_LAN_DG
- for ifname in $IFNAMES; do
- echo -I PREROUTING 1 -i $ifname -p $1 -j SS_SPEC_LAN_DG
- done
+ss_rules_iptchains_init_udp() {
+ [ -n "$o_redir_udp_port" ] || return 0
+ ss_rules_iptchains_init_ mangle udp
}
-while getopts ":s:l:S:L:B:b:W:w:I:d:a:e:oOuUfh" arg; do
- case "$arg" in
- s)
- server=$(for ip in $OPTARG; do echo $ip; done)
- ;;
- l)
- local_port=$OPTARG
- ;;
- S)
- SERVER=$(for ip in $OPTARG; do echo $ip; done)
- ;;
- L)
- LOCAL_PORT=$OPTARG
- ;;
- B)
- WAN_BP_LIST=$OPTARG
- ;;
- b)
- WAN_BP_IP=$OPTARG
- ;;
- W)
- WAN_FW_LIST=$OPTARG
- ;;
- w)
- WAN_FW_IP=$OPTARG
- ;;
- I)
- IFNAMES=$OPTARG
- ;;
- d)
- LAN_TARGET=$OPTARG
- ;;
- a)
- LAN_HOSTS=$OPTARG
- ;;
- e)
- EXT_ARGS=$OPTARG
- ;;
- o)
- OUTPUT=SS_SPEC_WAN_AC
- ;;
- O)
- OUTPUT=SS_SPEC_WAN_FW
- ;;
- u)
- TPROXY=1
- ;;
- U)
- TPROXY=2
- ;;
- f)
- flush_rules
- exit 0
+ss_rules_iptchains_init_() {
+ local table="$1"
+ local proto="$2"
+ local forward_rules
+ local src_default_target dst_default_target
+ local recentrst_mangle_rules recentrst_addset_rules
+
+ case "$proto" in
+ tcp)
+ forward_rules="-A ss_rules_forward -p tcp -j REDIRECT --to-ports $o_redir_tcp_port"
+ if [ -n "$o_dst_forward_recentrst" ]; then
+ recentrst_mangle_rules="
+ *mangle
+ -I PREROUTING 1 -p tcp -m tcp --tcp-flags RST RST -m recent --name ss_rules_recentrst --set --rsource
+ COMMIT
+ "
+ recentrst_addset_rules="
+ -A ss_rules_dst -m recent --name ss_rules_recentrst --rcheck --rdest --seconds 3 --hitcount 3 -j SET --add-set ss_rules_dst_forward_recentrst_ dst --exist
+ -A ss_rules_dst -m set --match-set ss_rules_dst_forward_recentrst_ dst -j ss_rules_forward
+ "
+ fi
;;
- h)
- usage 0
+ udp)
+ ip rule add fwmark 1 lookup 100
+ ip route add local default dev lo table 100
+ forward_rules="-A ss_rules_forward -p udp -j TPROXY --on-port "$o_redir_udp_port" --tproxy-mark 0x01/0x01"
;;
esac
-done
+ case "$o_src_default" in
+ forward) src_default_target=ss_rules_forward ;;
+ checkdst) src_default_target=ss_rules_dst ;;
+ bypass|*) src_default_target=RETURN ;;
+ esac
+ case "$o_dst_default" in
+ forward) dst_default_target=ss_rules_forward ;;
+ bypass|*) dst_default_target=RETURN ;;
+ esac
+ sed -e '/^\s*$/d' -e 's/^\s\+//' <<-EOF | iptables-restore --noflush
+ *$table
+ :ss_rules_pre_src -
+ :ss_rules_src -
+ :ss_rules_dst -
+ :ss_rules_forward -
+ $(ss_rules_iptchains_mkprerules "$proto")
+ -A ss_rules_pre_src -m set --match-set ss_rules_dst_bypass_ dst -j RETURN
+ -A ss_rules_pre_src -p $proto $o_ipt_extra -j ss_rules_src
+ -A ss_rules_src -m set --match-set ss_rules_src_bypass src -j RETURN
+ -A ss_rules_src -m set --match-set ss_rules_src_forward src -j ss_rules_forward
+ -A ss_rules_src -m set --match-set ss_rules_src_checkdst src -j ss_rules_dst
+ -A ss_rules_src -j $src_default_target -m comment --comment "src_default: $o_src_default"
+ -A ss_rules_dst -m set --match-set ss_rules_dst_bypass dst -j RETURN
+ -A ss_rules_dst -m set --match-set ss_rules_dst_forward dst -j ss_rules_forward
+ $recentrst_addset_rules
+ -A ss_rules_dst -j $dst_default_target -m comment --comment "dst_default: $o_dst_default"
+ $forward_rules
+ COMMIT
+ $recentrst_mangle_rules
+ EOF
+}
-[ -z "$server" -o -z "$local_port" ] && usage 2
+ss_rules_iptchains_mkprerules() {
+ local proto="$1"
-if [ "$TPROXY" = 1 ]; then
- unset SERVER
- LOCAL_PORT=$local_port
-elif [ "$TPROXY" = 2 ]; then
- : ${SERVER:?"You must assign an ip for the udp relay server."}
- : ${LOCAL_PORT:?"You must assign a port for the udp relay server."}
-fi
+ if [ -z "$o_ifnames" ]; then
+ echo "-I PREROUTING 1 -p $proto -j ss_rules_pre_src"
+ else
+ echo $o_ifnames \
+ | tr ' ' '\n' \
+ | sed "s/.*/-I PREROUTING 1 -i \\0 -p $proto -j ss_rules_pre_src/"
+ fi
+}
-flush_rules && ipset_init && ipt_nat && ipt_mangle && export_ipt_rules
-RET=$?
-[ "$RET" = 0 ] || loger 3 "Start failed!"
-exit $RET
+ss_rules_parse_args "$@"
+ss_rules_flush
+ss_rules_ipset_init
+ss_rules_iptchains_init
+++ /dev/null
-From ea18a4ffcd9a8de4c5b888d9dc58a2b173c5ff8e Mon Sep 17 00:00:00 2001
-From: Yousong Zhou <yszhou4tech@gmail.com>
-Date: Mon, 26 Jun 2017 14:49:36 +0800
-Subject: [PATCH] decouple use_syslog from pid_flags
-
-Sometimes we need processes to run in the foreground to be supervised
-and at the same time use syslog facility instead of logging its stdout,
-stderr output
----
- src/jconf.c | 6 ++++++
- src/local.c | 2 +-
- src/manager.c | 2 +-
- src/redir.c | 2 +-
- src/server.c | 2 +-
- src/tunnel.c | 2 +-
- src/utils.h | 18 +++++++++++-------
- 7 files changed, 22 insertions(+), 12 deletions(-)
-
-diff --git a/src/jconf.c b/src/jconf.c
-index 3c58148..05445c3 100644
---- a/src/jconf.c
-+++ b/src/jconf.c
-@@ -313,6 +313,12 @@ read_jconf(const char *file)
- check_json_value_type(value, json_boolean,
- "invalid config file: option 'ipv6_first' must be a boolean");
- conf.ipv6_first = value->u.boolean;
-+#ifdef HAS_SYSLOG
-+ } else if (strcmp(name, "use_syslog") == 0) {
-+ check_json_value_type(value, json_boolean,
-+ "invalid config file: option 'use_syslog' must be a boolean");
-+ use_syslog = value->u.boolean;
-+#endif
- }
- }
- } else {
-diff --git a/src/local.c b/src/local.c
-index aa69205..d123516 100644
---- a/src/local.c
-+++ b/src/local.c
-@@ -1519,8 +1519,8 @@ main(int argc, char **argv)
- local_addr = "127.0.0.1";
- }
-
-+ USE_SYSLOG(argv[0], pid_flags);
- if (pid_flags) {
-- USE_SYSLOG(argv[0]);
- daemonize(pid_path);
- }
-
-diff --git a/src/manager.c b/src/manager.c
-index 6e7197c..338ab85 100644
---- a/src/manager.c
-+++ b/src/manager.c
-@@ -1149,8 +1149,8 @@ main(int argc, char **argv)
- timeout = "60";
- }
-
-+ USE_SYSLOG(argv[0], pid_flags);
- if (pid_flags) {
-- USE_SYSLOG(argv[0]);
- daemonize(pid_path);
- }
-
-diff --git a/src/redir.c b/src/redir.c
-index 4856007..88660f8 100644
---- a/src/redir.c
-+++ b/src/redir.c
-@@ -1137,8 +1137,8 @@ main(int argc, char **argv)
- #endif
- }
-
-+ USE_SYSLOG(argv[0], pid_flags);
- if (pid_flags) {
-- USE_SYSLOG(argv[0]);
- daemonize(pid_path);
- }
-
-diff --git a/src/server.c b/src/server.c
-index 747f0e5..7e3df9e 100644
---- a/src/server.c
-+++ b/src/server.c
-@@ -1726,8 +1726,8 @@ main(int argc, char **argv)
- }
- #endif
-
-+ USE_SYSLOG(argv[0], pid_flags);
- if (pid_flags) {
-- USE_SYSLOG(argv[0]);
- daemonize(pid_path);
- }
-
-diff --git a/src/tunnel.c b/src/tunnel.c
-index 77c7380..2419fa0 100644
---- a/src/tunnel.c
-+++ b/src/tunnel.c
-@@ -1022,8 +1022,8 @@ main(int argc, char **argv)
- local_addr = "127.0.0.1";
- }
-
-+ USE_SYSLOG(argv[0], pid_flags);
- if (pid_flags) {
-- USE_SYSLOG(argv[0]);
- daemonize(pid_path);
- }
-
-diff --git a/src/utils.h b/src/utils.h
-index 2603e85..53f3983 100644
---- a/src/utils.h
-+++ b/src/utils.h
-@@ -35,7 +35,7 @@
-
- #include <android/log.h>
- #define USE_TTY()
--#define USE_SYSLOG(ident)
-+#define USE_SYSLOG(ident, _cond)
- #define LOGI(...) \
- ((void)__android_log_print(ANDROID_LOG_DEBUG, "shadowsocks", \
- __VA_ARGS__))
-@@ -53,7 +53,7 @@
- extern FILE *logfile;
- #define TIME_FORMAT "%Y-%m-%d %H:%M:%S"
- #define USE_TTY()
--#define USE_SYSLOG(ident)
-+#define USE_SYSLOG(ident, _cond)
- #define USE_LOGFILE(ident) \
- do { \
- if (ident != NULL) { logfile = fopen(ident, "w+"); } } \
-@@ -99,11 +99,15 @@ extern int use_syslog;
- use_tty = isatty(STDERR_FILENO); \
- } while (0)
-
--#define USE_SYSLOG(ident) \
-- do { \
-- use_syslog = 1; \
-- openlog((ident), LOG_CONS | LOG_PID, 0); } \
-- while (0)
-+#define USE_SYSLOG(_ident, _cond) \
-+ do { \
-+ if (!use_syslog && (_cond)) { \
-+ use_syslog = 1; \
-+ } \
-+ if (use_syslog) { \
-+ openlog((_ident), LOG_CONS | LOG_PID, 0); \
-+ } \
-+ } while (0)
-
- #define LOGI(format, ...) \
- do { \
---
-2.12.2
-
PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_DIRECTORY)/shorewall-$(PKG_MAINVERSION)/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_HASH:=118378698e0fa1216b52ace92fe9eae0f7d32c39becbc50837a895d7367674b2c973b1633c8919045d9d16dd2a5fdbedb9d62ff1513547ee4770a2e9116d8b1e
+PKG_HASH:=3d1446f7e437104c8f8c7257ccdbddfc0dc7df3ea68b80274c11dd94cc1c8629
PKG_MAINTAINER:=Willem van den Akker <wvdakker@wilsoft.nl>
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_DIRECTORY)/shorewall-$(PKG_MAINVERSION)/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_HASH:=c06e365d06c484e7ef673e5a8597d70996f1008a00163aae2d7a53d0d720739a8b0317a093b3e75487ef1c8a02ac4c4c542480757226a974671f82ab08353896
+PKG_HASH:=e90d419ed8a6da615c3a0d6fdcb9481f8e71f89c2bdcff09ab027198ca2ce293
PKG_MAINTAINER:=Willem van den Akker <wvdakker@wilsoft.nl>
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_DIRECTORY)/shorewall-$(PKG_MAINVERSION)/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_HASH:=b616c5886b5bc274e88052359ca4c8aa6df60a9706958698eac7fc362f1c893de00ed2272535d61a88cb6a786bae9b7cba64a835833a9f81c991fb2ffed8244b
+PKG_HASH:=29a2f2be295b4f995b38e663b771660ccdc6321134bcfbd0f9378f9bb1237e3c
PKG_MAINTAINER:=Willem van den Akker <wvdakker@wilsoft.nl>
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=df8a95b066569be92aa38cad01086ea595b36863
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=a9131ae443bdce760e3dadd83dcf115d51a894381fc18461cbe62522618418fa
PKG_FIXUP:=autoreconf
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=fb93473d895f058b2d8975d3cfa280ae2a8ae98d
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_MIRROR_MD5SUM:=
+PKG_MIRROR_HASH:=fc7f3eef8341163e21aecf6abf2492fa90362877093baef9987af3c703baa6ea
PKG_MAINTAINER:=Xiongfei Guo <xfguo@credosemi.com>
include $(TOPDIR)/rules.mk
PKG_NAME:=sngrep
-PKG_VERSION=1.4.2
+PKG_VERSION=1.4.4-rc2
PKG_RELEASE:=1
PKG_MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
PKG_LICENSE:=GPL-3.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/irontec/sngrep
PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=da791185cabeea5a6fcc7372157340b2d1369df7
+PKG_SOURCE_VERSION:=cf5e1da49d00bc7ab1afe9d63daa240db2b9b19c
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MIRROR_MD5SUM:=2cc640e065f33cae4a3a8e14bdc740e49269cd850eee2ffa9eb821427caaa371
+PKG_MIRROR_HASH:=a6cee2caa108a618134fe87d7c04862e93aa2fdf9647d81dfe4abe91a6c9c19f
PKG_FIXUP:=autoreconf
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.snort.org/downloads/snort/ \
@SF/$(PKG_NAME)
-PKG_MD5SUM:=b01e9964827394c39194a0147bc15705
+PKG_HASH:=db57c532919d9ababac127f29dbdc05ed832394880e46cad81a5dde713ccb4be
PKG_BUILD_DEPENDS:=librpc
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
PKG_VERSION:=4.22-9634
PKG_VERREL:=beta
PKG_VERDATE:=2016.11.27
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=softether-src-v$(PKG_VERSION)-$(PKG_VERREL).tar.gz
PKG_SOURCE_URL:=http://www.softether-download.com/files/softether/v$(PKG_VERSION)-$(PKG_VERREL)-$(PKG_VERDATE)-tree/Source_Code/
-PKG_MD5SUM:=703d41b34ff49d008ddd329340a5a75e
+PKG_HASH:=a37c6edeb7076189382fe2cbeb7c02806b76c13bb64e40bd6a5334fdf47f76c8
PKG_BUILD_DIR:=$(BUILD_DIR)/v$(PKG_VERSION)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/v$(PKG_VERSION)
-f src/makefiles/linux_$(if $(CONFIG_ARCH_64BIT),64,32)bit.mak
# Map nonstandard CCFLAGS variable to standard TARGET_CFLAGS
-MAKE_VARS += \
- CCFLAGS="$(TARGET_CFLAGS)"
+MAKE_FLAGS += \
+ CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)"
define Build/Configure
# Fetch prebuilt hamcore.se2 from staging dir
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://softflowd.googlecode.com/files/
-PKG_MD5SUM:=ba83e2715e6250e6645ebcaa9ae1009d
+PKG_HASH:=2313f2c50ea9b3f2db3524e38ec7cd71f9a6e885ac2e3b55ab037bccf8173612
PKG_MAINTAINER:=Ross Vandegrift <ross@kallisti.us>
PKG_LICENSE:=BSD-3-Clause
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://download.lighttpd.net/spawn-fcgi/releases-1.6.x/
-PKG_MD5SUM:=a67c098a50cd625fd12adf61b5dd4c32
+PKG_HASH:=423b0c317e0084773b483985cc21930c4b8dfcb411f7353d6ee6fc41d9cb9d45
PKG_LICENSE:=BSD-3c
PKG_LICENSE_FILES:=COPYING
PKG_LICENSE:=GPLv2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE).tar.xz
+PKG_MIRROR_HASH:=a287ce3bf68ed76f4fd7ae3df5e0066d99105b5c139c88bce99555dcb1d230a3
PKG_SOURCE_URL:=https://github.com/tohojo/sqm-scripts.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.squid-cache.org/Versions/v3/3.5/
-PKG_MD5SUM:=50016bf6e2d3a3a186a6c7236d251f63
+PKG_HASH:=8bc83f3869f7404aefb10883109e28443255cf6dde50a13904c7954619707a42
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/libfuse/sshfs/releases/download/$(PKG_NAME)_$(PKG_VERSION)
-PKG_MD5SUM:=0ba25e848ee59e2595d6576c8f6284b6
+PKG_HASH:=7f689174d02e6b7e2631306fda4fb8e6b4483102d1bce82b3cdafba33369ad22
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://rutschle.net/tech/sslh/
-PKG_MD5SUM:=0e3568d5d234516c634d4df156473298
+PKG_HASH:=1601a5b377dcafc6b47d2fbb8d4d25cceb83053a4adcc5874d501a2d5a7745ad
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/sstp-client/$(PKG_VERSION)
-PKG_MD5SUM:=4ddbc2fe33eb27d5a4f38d2241005970
+PKG_HASH:=1b851b504030ed5522ced431217a5c700b35e8bb72d6f5b40b006c7becb8fb20
PKG_LICENSE=GPLv2
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/rules.mk
PKG_NAME:=strongswan
-PKG_VERSION:=5.5.3
+PKG_VERSION:=5.6.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_HASH:=c5ea54b199174708de11af9b8f4ecf28b5b0743d4bc0e380e741f25b28c0f8d4
+PKG_HASH:=a14dc0d92634ed52730bfc76a76db30943a28ed3c65a560066e1e9f785827b13
PKG_SOURCE_URL:=http://download.strongswan.org/ http://download2.strongswan.org/
PKG_LICENSE:=GPL-2.0+
PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
unity \
uci \
updown \
+ vici \
whitelist \
x509 \
xauth-eap \
TITLE+= (full)
DEPENDS:= +strongswan \
+strongswan-charon \
+ +strongswan-charon-cmd \
+ +strongswan-ipsec \
+strongswan-mod-addrblock \
+strongswan-mod-aes \
+strongswan-mod-af-alg \
+strongswan-mod-uci \
+strongswan-mod-unity \
+strongswan-mod-updown \
+ +strongswan-mod-vici \
+strongswan-mod-whitelist \
+strongswan-mod-x509 \
+strongswan-mod-xauth-eap \
+strongswan-mod-xauth-generic \
+strongswan-mod-xcbc \
- +strongswan-utils \
+ +strongswan-pki \
+ +strongswan-scepclient \
+ +strongswan-swanctl \
@DEVEL
endef
TITLE+= (default)
DEPENDS:= +strongswan \
+strongswan-charon \
+ +strongswan-ipsec \
+strongswan-mod-aes \
+strongswan-mod-attr \
+strongswan-mod-connmark \
+strongswan-mod-updown \
+strongswan-mod-x509 \
+strongswan-mod-xauth-generic \
- +strongswan-mod-xcbc \
- +strongswan-utils
+ +strongswan-mod-xcbc
endef
define Package/strongswan-default/description
TITLE+= (isakmp)
DEPENDS:= +strongswan \
+strongswan-charon \
+ +strongswan-ipsec \
+strongswan-mod-aes \
+strongswan-mod-des \
+strongswan-mod-gmpdh \
+strongswan-mod-socket-default \
+strongswan-mod-stroke \
+strongswan-mod-uci \
- +strongswan-mod-updown \
- +strongswan-utils
+ +strongswan-mod-updown
endef
define Package/strongswan-isakmp/description
This package contains charon, an IKEv2 keying daemon.
endef
-define Package/strongswan-utils
+define Package/strongswan-charon-cmd
+$(call Package/strongswan/Default)
+ TITLE+= charon-cmd utility
+ DEPENDS:= +strongswan +strongswan-charon
+endef
+
+define Package/strongswan-charon-cmd/description
+$(call Package/strongswan/description/Default)
+ This package contains the charon-cmd utility.
+endef
+
+define Package/strongswan-ipsec
$(call Package/strongswan/Default)
TITLE+= utilities
DEPENDS:= +strongswan
endef
-define Package/strongswan-utils/description
+define Package/strongswan-ipsec/description
+$(call Package/strongswan/description/Default)
+ This package contains the ipsec utility.
+endef
+
+define Package/strongswan-pki
+$(call Package/strongswan/Default)
+ TITLE+= PKI tool
+ DEPENDS:= +strongswan
+endef
+
+define Package/strongswan-pki/description
+$(call Package/strongswan/description/Default)
+ This package contains the pki tool.
+endef
+
+define Package/strongswan-scepclient
+$(call Package/strongswan/Default)
+ TITLE+= SCEP client
+ DEPENDS:= +strongswan
+endef
+
+define Package/strongswan-scepclient/description
$(call Package/strongswan/description/Default)
- This package contains the pki & scepclient utilities.
+ This package contains the SCEP client.
+endef
+
+define Package/strongswan-swanctl
+$(call Package/strongswan/Default)
+ TITLE+= swanctl utility
+ DEPENDS:= +strongswan +strongswan-mod-vici
+endef
+
+define Package/strongswan-swanctl/description
+$(call Package/strongswan/description/Default)
+ This package contains the swanctl utility.
endef
define Package/strongswan-libtls
--disable-fast \
--enable-mediation \
--with-systemdsystemunitdir=no \
- $(if $(CONFIG_PACKAGE_strongswan-utils),--enable-pki --enable-scepclient,--disable-pki --disable-scepclient) \
+ $(if $(CONFIG_PACKAGE_strongswan-charon-cmd),--enable-cmd,--disable-cmd) \
+ $(if $(CONFIG_PACKAGE_strongswan-pki),--enable-pki,--disable-pki) \
+ $(if $(CONFIG_PACKAGE_strongswan-scepclient),--enable-scepclient,--disable-scepclient) \
--with-random-device=/dev/random \
--with-urandom-device=/dev/urandom \
--with-routing-table="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE))" \
endef
define Package/strongswan-charon/install
+ $(INSTALL_DIR) $(1)/etc/strongswan.d
+ $(CP) $(PKG_INSTALL_DIR)/etc/strongswan.d/charon.conf $(1)/etc/strongswan.d
+ $(CP) $(PKG_INSTALL_DIR)/etc/strongswan.d/charon-logging.conf $(1)/etc/strongswan.d
$(INSTALL_DIR) $(1)/usr/lib/ipsec
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/charon $(1)/usr/lib/ipsec/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libcharon.so.* $(1)/usr/lib/ipsec/
endef
-define Package/strongswan-utils/install
+define Package/strongswan-charon-cmd/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/charon-cmd $(1)/usr/sbin/
+endef
+
+define Package/strongswan-ipsec/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipsec $(1)/usr/sbin/
+endef
+
+define Package/strongswan-pki/install
+ $(INSTALL_DIR) $(1)/etc/strongswan.d
+ $(CP) $(PKG_INSTALL_DIR)/etc/strongswan.d/pki.conf $(1)/etc/strongswan.d/
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pki $(1)/usr/bin/
+endef
+
+define Package/strongswan-scepclient/install
+ $(INSTALL_DIR) $(1)/etc/strongswan.d
+ $(CP) $(PKG_INSTALL_DIR)/etc/strongswan.d/scepclient.conf $(1)/etc/strongswan.d/
$(INSTALL_DIR) $(1)/usr/lib/ipsec
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/scepclient $(1)/usr/lib/ipsec/
endef
+define Package/strongswan-swanctl/install
+ $(INSTALL_DIR) $(1)/etc/swanctl/{bliss,ecdsa,pkcs{12,8},private,pubkey,rsa}
+ $(INSTALL_DIR) $(1)/etc/swanctl/x509{,aa,ac,ca,crl,ocsp}
+ $(CP) $(PKG_INSTALL_DIR)/etc/swanctl/swanctl.conf $(1)/etc/swanctl/
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/swanctl $(1)/usr/sbin/
+endef
+
define Package/strongswan-libtls/install
$(INSTALL_DIR) $(1)/usr/lib/ipsec
$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libtls.so.* $(1)/usr/lib/ipsec/
$(INSTALL_DIR) $(1)/etc
endef
+define Plugin/vici/install
+ $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libvici.so.* $(1)/usr/lib/ipsec/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-vici.so $(1)/usr/lib/ipsec/plugins/
+endef
+
define Plugin/whitelist/install
$(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/whitelist $(1)/usr/lib/ipsec/
$(eval $(call BuildPackage,strongswan-minimal))
$(eval $(call BuildPackage,strongswan-isakmp))
$(eval $(call BuildPackage,strongswan-charon))
-$(eval $(call BuildPackage,strongswan-utils))
+$(eval $(call BuildPackage,strongswan-charon-cmd))
+$(eval $(call BuildPackage,strongswan-ipsec))
+$(eval $(call BuildPackage,strongswan-pki))
+$(eval $(call BuildPackage,strongswan-scepclient))
+$(eval $(call BuildPackage,strongswan-swanctl))
$(eval $(call BuildPackage,strongswan-libtls))
$(eval $(call BuildPlugin,addrblock,RFC 3779 address block constraint support,))
$(eval $(call BuildPlugin,aes,AES crypto,))
$(eval $(call BuildPlugin,sql,SQL database interface,))
$(eval $(call BuildPlugin,sqlite,SQLite database interface,+strongswan-mod-sql +PACKAGE_strongswan-mod-sqlite:libsqlite3))
$(eval $(call BuildPlugin,sshkey,SSH key decoding,))
-$(eval $(call BuildPlugin,stroke,Stroke,+strongswan-charon +strongswan-utils))
+$(eval $(call BuildPlugin,stroke,Stroke,+strongswan-charon +strongswan-ipsec))
$(eval $(call BuildPlugin,test-vectors,crypto test vectors,))
$(eval $(call BuildPlugin,uci,UCI config interface,+PACKAGE_strongswan-mod-uci:libuci))
$(eval $(call BuildPlugin,unity,Cisco Unity extension,))
$(eval $(call BuildPlugin,updown,updown firewall,))
+$(eval $(call BuildPlugin,vici,Versatile IKE Configuration Interface,))
$(eval $(call BuildPlugin,whitelist,peer identity whitelisting,))
$(eval $(call BuildPlugin,x509,x509 certificate,))
$(eval $(call BuildPlugin,xauth-eap,EAP XAuth backend,))
START=90
STOP=10
-. $IPKG_INSTROOT/lib/functions.sh
+USE_PROCD=1
+PROG=/usr/lib/ipsec/starter
-UCI_IPSEC_CONFIG=/etc/config/ipsec
+. $IPKG_INSTROOT/lib/functions.sh
IPSEC_SECRETS_FILE=/etc/ipsec.secrets
IPSEC_CONN_FILE=/etc/ipsec.conf
IPSEC_VAR_CONN_FILE=/var/ipsec/ipsec.conf
STRONGSWAN_VAR_CONF_FILE=/var/ipsec/strongswan.conf
-ENABLED_REMOTE_PEERS=0
-
file_reset() {
: > "$1"
}
config_name=$1
config_get_bool enabled "$1" enabled 0
- [ "$enabled" = "0" ] && return
-
- ENABLED_REMOTE_PEERS=$((ENABLED_REMOTE_PEERS + 1))
+ [ $enabled -eq 0 ] && return
config_get gateway "$1" gateway
config_get pre_shared_key "$1" pre_shared_key
config_get debug "$1" debug 0
config_get_bool rtinstall_enabled "$1" rtinstall_enabled 1
- [ $rtinstall_enabled = "1" ] && install_routes=yes || install_routes=no
+ [ $rtinstall_enabled -eq 1 ] && install_routes=yes || install_routes=no
# prepare extra charon config option ignore_routing_tables
for routing_table in $(config_get "$1" "ignore_routing_tables"); do
config_foreach config_remote remote
}
-start() {
+reload_service() {
prepare_env
- [ $ENABLED_REMOTE_PEERS != 0 -o ! -f $UCI_IPSEC_CONFIG ] && ipsec start
+ if ipsec status > /dev/null 2>&1; then
+ ipsec rereadall
+ ipsec reload
+ else
+ ipsec start
+ fi
}
-stop() {
- ipsec stop
+service_triggers() {
+ procd_add_reload_trigger "ipsec"
}
-restart() {
+start_service() {
prepare_env
- [ $ENABLED_REMOTE_PEERS != 0 -o ! -f $UCI_IPSEC_CONFIG ] && ipsec restart || ipsec stop
-}
-reload() {
- prepare_env
- [ $ENABLED_REMOTE_PEERS != 0 -o ! -f $UCI_IPSEC_CONFIG ] && {
- ipsec secrets
- if [[ ! -z "$(ipsec status)" ]]; then
- ipsec reload
- else
- ipsec start
- fi
- } || ipsec stop
+ procd_open_instance
+
+ procd_set_param command $PROG --daemon charon --nofork
+
+ procd_set_param file $IPSEC_CONN_FILE
+ procd_append_param file $IPSEC_SECRETS_FILE
+ procd_append_param file $STRONGSWAN_CONF_FILE
+ procd_append_param file /etc/strongswan.d/*.conf
+ procd_append_param file /etc/strongswan.d/charon/*.conf
+
+ procd_set_param respawn
+
+ procd_close_instance
}
#
-# Copyright (C) 2007-2016 OpenWrt.org
+# Copyright (C) 2007-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=subversion
PKG_RELEASE:=1
-PKG_VERSION:=1.9.6
+PKG_VERSION:=1.9.7
PKG_SOURCE_URL:=@APACHE/subversion
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_HASH:=dbcbc51fb634082f009121f2cb64350ce32146612787ffb0f7ced351aacaae19
-PKG_MD5SUM:=f27e00338d4a9f7f9aec9d4a3f8b418b
+PKG_HASH:=c3b118333ce12e501d509e66bb0a47bcc34d053990acab45559431ac3e491623
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Val Kulkov <val.kulkov@gmail.com>
PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
PKG_NAME:=sysrepo
-PKG_VERSION:=0.6.0
+PKG_VERSION:=0.7.0
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=e4a5705a4c5293ba121048c71899b98243d99edf
-PKG_MIRROR_HASH:=aa0fb5d7c947dd428d9f573c84edf6237c8c1a4db92dcd4d7552a68d25277a39
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2
+PKG_SOURCE_VERSION:=7aa2f18d234267403147df92c0005c871f0aa840
+PKG_MIRROR_HASH:=31125596ae1c4dbf8dd48c639bf78043060ab1b89678c860eb2b10606fe4b686
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/sysrepo/sysrepo.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_ROOT:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_DIR:=$(PKG_BUILD_ROOT)
CMAKE_INSTALL:=1
CATEGORY:=Utilities
URL:=$(PKG_SOURCE_URL)
TITLE:=YANG-based data store library
- DEPENDS:=+libyang +libprotobuf-c +libev +libavl
+ DEPENDS:=+libyang +libprotobuf-c +libev +libredblack +librt
endef
define Package/sysrepo
CMAKE_OPTIONS += \
-DCMAKE_BUILD_TYPE:STRING=Release \
+ -DUSE_AVL_LIB:BOOL=FALSE \
-DENABLE_TESTS:BOOL=FALSE \
-DBUILD_EXAMPLES:BOOL=FALSE \
-DCMAKE_DISABLE_FIND_PACKAGE_SWIG=TRUE \
-Index: sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/src/CMakeLists.txt
+Index: sysrepo-7aa2f18d234267403147df92c0005c871f0aa840/src/CMakeLists.txt
===================================================================
---- sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf.orig/src/CMakeLists.txt
-+++ sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/src/CMakeLists.txt
+--- sysrepo-7aa2f18d234267403147df92c0005c871f0aa840.orig/src/CMakeLists.txt
++++ sysrepo-7aa2f18d234267403147df92c0005c871f0aa840/src/CMakeLists.txt
@@ -21,14 +21,6 @@ set(GENERATED_PROTO_H "${COMMON_BIN_DIR}
set(GENERATED_PROTO_C "${COMMON_BIN_DIR}/${PROTO_NAME}.pb-c.c")
configure_file("${COMMON_DIR}/sr_constants.h.in" "${COMMON_BIN_DIR}/sr_constants.h" ESCAPE_QUOTES @ONLY)
-Index: sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/src/common/sysrepo.pb-c.c
+Index: sysrepo-7aa2f18d234267403147df92c0005c871f0aa840/src/common/sysrepo.pb-c.c
===================================================================
--- /dev/null
-+++ sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/src/common/sysrepo.pb-c.c
-@@ -0,0 +1,10517 @@
++++ sysrepo-7aa2f18d234267403147df92c0005c871f0aa840/src/common/sysrepo.pb-c.c
+@@ -0,0 +1,10537 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: sysrepo.proto */
+
+ (ProtobufCMessageInit) sr__copy_config_req__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
-+#define sr__copy_config_resp__field_descriptors NULL
-+#define sr__copy_config_resp__field_indices_by_name NULL
-+#define sr__copy_config_resp__number_ranges NULL
++static const ProtobufCFieldDescriptor sr__copy_config_resp__field_descriptors[1] =
++{
++ {
++ "errors",
++ 1,
++ PROTOBUF_C_LABEL_REPEATED,
++ PROTOBUF_C_TYPE_MESSAGE,
++ offsetof(Sr__CopyConfigResp, n_errors),
++ offsetof(Sr__CopyConfigResp, errors),
++ &sr__error__descriptor,
++ NULL,
++ 0, /* flags */
++ 0,NULL,NULL /* reserved1,reserved2, etc */
++ },
++};
++static const unsigned sr__copy_config_resp__field_indices_by_name[] = {
++ 0, /* field[0] = errors */
++};
++static const ProtobufCIntRange sr__copy_config_resp__number_ranges[1 + 1] =
++{
++ { 1, 0 },
++ { 0, 1 }
++};
+const ProtobufCMessageDescriptor sr__copy_config_resp__descriptor =
+{
+ PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
+ "Sr__CopyConfigResp",
+ "sr",
+ sizeof(Sr__CopyConfigResp),
-+ 0,
++ 1,
+ sr__copy_config_resp__field_descriptors,
+ sr__copy_config_resp__field_indices_by_name,
-+ 0, sr__copy_config_resp__number_ranges,
++ 1, sr__copy_config_resp__number_ranges,
+ (ProtobufCMessageInit) sr__copy_config_resp__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+ sr__operation__value_ranges,
+ NULL,NULL,NULL,NULL /* reserved[1234] */
+};
-Index: sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/src/common/sysrepo.pb-c.h
+Index: sysrepo-7aa2f18d234267403147df92c0005c871f0aa840/src/common/sysrepo.pb-c.h
===================================================================
--- /dev/null
-+++ sysrepo-e4a5705a4c5293ba121048c71899b98243d99edf/src/common/sysrepo.pb-c.h
-@@ -0,0 +1,4236 @@
++++ sysrepo-7aa2f18d234267403147df92c0005c871f0aa840/src/common/sysrepo.pb-c.h
+@@ -0,0 +1,4238 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: sysrepo.proto */
+
+
+#if PROTOBUF_C_VERSION_NUMBER < 1000000
+# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
-+#elif 1001001 < PROTOBUF_C_MIN_COMPILER_VERSION
++#elif 1002001 < PROTOBUF_C_MIN_COMPILER_VERSION
+# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
+#endif
+
+struct _Sr__CopyConfigResp
+{
+ ProtobufCMessage base;
++ size_t n_errors;
++ Sr__Error **errors;
+};
+#define SR__COPY_CONFIG_RESP__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&sr__copy_config_resp__descriptor) \
-+ }
++ , 0,NULL }
+
+
+/*
--- /dev/null
+Index: sysrepo-0.7.0-7aa2f18d234267403147df92c0005c871f0aa840/src/common/sr_utils.c
+===================================================================
+--- sysrepo-0.7.0-7aa2f18d234267403147df92c0005c871f0aa840.orig/src/common/sr_utils.c
++++ sysrepo-0.7.0-7aa2f18d234267403147df92c0005c871f0aa840/src/common/sr_utils.c
+@@ -460,14 +460,24 @@ sr_fd_set_nonblock(int fd)
+
+ #if defined(SO_PEERCRED)
+
++#if defined(__GLIBC__)
+ #if !defined(SCM_CREDENTIALS)
+-/* struct ucred is ifdefined behind __USE_GNU, but __USE_GNU is not defined */
+ struct ucred {
+ pid_t pid; /* process ID of the sending process */
+ uid_t uid; /* user ID of the sending process */
+ gid_t gid; /* group ID of the sending process */
+ };
+ #endif /* !defined(SCM_CREDENTIALS) */
++#else
++#if !defined(__USE_GNU)
++struct ucred {
++ pid_t pid; /* process ID of the sending process */
++ uid_t uid; /* user ID of the sending process */
++ gid_t gid; /* group ID of the sending process */
++};
++/* struct ucred is ifdefined behind __USE_GNU, but __USE_GNU is not defined */
++#endif /* !defined(__USE_GNU) */
++#endif /* defined(__GLIBC__) */
+
+ int
+ sr_get_peer_eid(int fd, uid_t *uid, gid_t *gid)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.spreadspace.org/tcpproxy/releases/
-PKG_MD5SUM:=14f734a61350c52556909e2ed5bff361
+PKG_HASH:=446104b3abefda73b1255e5197702acbeb36b3aada251ad39e1e5ab55292683b
PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/appneta/tcpreplay/releases/download/v$(PKG_VERSION)
-PKG_MD5SUM:=0571a6e20081429931d408b612ecc8a8
PKG_HASH:=68d8d49dab5bf58b2e8d244eee1ee7f2379d967da19fe97dd9d59bcf40a22abc
PKG_LICENSE:=GPL-3.0
include $(TOPDIR)/rules.mk
PKG_NAME:=tinc
-PKG_VERSION:=1.0.31
+PKG_VERSION:=1.0.32
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.tinc-vpn.org/packages
-PKG_MD5SUM:=7a96f7eb12dfd43b21852b4207d860f2
+PKG_HASH:=4db24feaff8db4bbb7edb7a4b8f5f8edc39b26eb5feccc99e8e67a6960c05587
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.banu.com/pub/tinyproxy/1.8/
-PKG_MD5SUM:=292ac51da8ad6ae883d4ebf56908400d
+PKG_HASH:=be559b54eb4772a703ad35239d1cb59d32f7cf8a739966742622d57df88b896e
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://dist.torproject.org/ \
https://archive.torproject.org/tor-package-archive
-PKG_MD5SUM:=763ae964e916c2a7a4c5015d351fcf8b
PKG_HASH:=c1959bebff9a546a54cbedb58c8289a42441991af417d2d16f7b336be8903221
PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=35fea28d1a37875ef7480ac061754df617805b19
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
-PKG_MIRROR_MD5SUM:=aeeb8dfd918bd2cf4fb6fbdf58bd822e9b509df1ba5ec408888edd161123ef8e
+PKG_MIRROR_HASH:=aeeb8dfd918bd2cf4fb6fbdf58bd822e9b509df1ba5ec408888edd161123ef8e
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=travelmate
-PKG_VERSION:=0.8.2
+PKG_VERSION:=0.9.3
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
## Main Features
* STA interfaces operating in an "always off" mode, to make sure that the AP is always accessible
* easy setup within normal OpenWrt/LEDE environment
-* strong LuCI-Support to simplify the interface setup
+* strong LuCI-Support with builtin interface wizard and a wireless station manager
* fast uplink connections
* manual / automatic mode support, the latter one checks the existing uplink connection regardless of ifdown event trigger actions every n seconds
* support of devices with multiple radios
* download the package [here](https://downloads.lede-project.org/snapshots/packages/x86_64/packages)
* install 'travelmate' (_opkg install travelmate_)
* configure your network:
- * automatic: use the LuCI frontend with automatic STA interface setup, that's the recommended way
+ * recommended: use the LuCI frontend with builtin interface wizard and a wireless station manager
* manual: see detailed configure steps below
* at least you need one configured AP and one STA interface
* the application is located in LuCI under 'Services' menu
## Travelmate config options
-* travelmate config options:
+* usually the pre-configured travelmate setup works quite well and no manual config overrides are needed, all listed options apply to the 'global' config section:
* trm\_enabled => main switch to enable/disable the travelmate service (default: '0', disabled)
* trm\_debug => enable/disable debug logging (default: '0', disabled)
* trm\_automatic => keep travelmate in an active state (default: '1', enabled)
* trm\_maxwait => how long (in seconds) should travelmate wait for a successful wlan interface reload action (default: '30')
- * trm\_maxretry => how many times should travelmate try to find an uplink after a trigger event (default: '3')
+ * trm\_maxretry => how many times should travelmate try to connect to an uplink, '0' means unlimited retries. (default: '3')
* trm\_timeout => timeout in seconds for "automatic mode" (default: '60')
* trm\_radio => limit travelmate to a dedicated radio, e.g. 'radio0' (default: not set, use all radios)
- * trm\_iface => restrict the procd interface trigger to a (list of) certain wan interface(s) or disable it at all (default: trm_wwan)
- * trm\_triggerdelay => additional trigger delay in seconds before travelmate processing starts (default: '1')
+ * trm\_iface => main uplink / procd trigger network interface (default: trm_wwan)
+ * trm\_triggerdelay => additional trigger delay in seconds before travelmate processing starts (default: '2')
## Runtime information
<pre><code>
root@adb2go:~# /etc/init.d/travelmate status
::: travelmate runtime information
- travelmate_version : 0.7.2
+ travelmate_version : 0.9.1
station_connection : true
- station_ssid : blackhole
+ station_ssid : blackhole.nl
station_interface : trm_wwan
station_radio : radio1
- last_rundate : 06.05.2017 06:58:22
- system : LEDE Reboot SNAPSHOT r4051-3ddc1914ba
+ last_rundate : 29.07.2017 18:02:01
+ system : LEDE Reboot SNAPSHOT r4639-eb43a817f7
</code></pre>
## Manual Setup
option encryption 'psk2+ccmp'
option key 'abc'
option disabled '1'
+[...]
config wifi-iface
option device 'radio0'
option network 'trm_wwan'
option encryption 'psk2+ccmp'
option key 'xyz'
option disabled '1'
-config wifi-iface
- option device 'radio0'
- option network 'trm_wwan'
- option mode 'sta'
- option ssid 'example_03'
- option encryption 'none'
- option disabled '1'
[...]
</code></pre>
-**4. reload network configuration & start travelmate:**
+**4. start travelmate:**
<pre><code>
-/etc/init.d/network reload
-/etc/init.d/travelmate start
+edit /etc/config/travelmate and set 'trm_enabled' to '1'
+/etc/init.d/travelmate restart
</code></pre>
+## FAQ
+**Q:** What's about 'manual' and 'automatic' mode?
+**A:** In "manual" mode travelmate will be triggered solely by procd interface down events, whenever an uplink disappears travelmate tries n times (default 3) to find a new uplink or reconnect to the old one. The 'automatic' mode keeps travelmate in an active state and checks every n seconds the connection status / the uplink availability regardless of procd event trigger.
+
+**Q:** What happen with misconfigured uplinks, e.g. due to outdated wlan passwords?
+**A:** Travelmate tries n times (default 3) to connect, then the respective uplink SSID will be marked / renamed to '_SSID_\_err'. In this case use the builtin wireless station manager to update your wireless credentials. To disable this functionality at all set the Connection Limit ('trm\_maxretry') to '0', which means unlimited retries.
+
+**Q:** Is travelmate compatible with CC/Openwrt?
+**A:** Travelmate was never tested with an ancient CC/OpenWrt release ... it should still work, but no promises.
+
+[...] to be continued [...]
## Support
-Please join the travelmate discussion in this [forum thread](https://forum.openwrt.org/viewtopic.php?id=67697) or contact me by [mail](mailto:dev@brenken.org)
+Please join the travelmate discussion in this [forum thread](https://forum.lede-project.org/t/travelmate-support-thread/5155) or contact me by [mail](mailto:dev@brenken.org)
## Removal
* stop the travelmate daemon with _/etc/init.d/travelmate stop_
service_triggers()
{
- local iface="$(uci -q get travelmate.global.trm_iface)"
- local delay="$(uci -q get travelmate.global.trm_triggerdelay)"
-
- PROCD_RELOAD_DELAY=$((${delay:=2} * 1000))
- for name in ${iface}
- do
- procd_add_interface_trigger "interface.*.down" "${name}" "${trm_init}" start
- done
+ local auto="$(uci -q get travelmate.global.trm_automatic)"
+
+ if [ "${auto}" = "0" ]
+ then
+ local iface="$(uci -q get travelmate.global.trm_iface)"
+ local delay="$(uci -q get travelmate.global.trm_triggerdelay)"
+
+ PROCD_RELOAD_DELAY=$((${delay:=2} * 1000))
+ procd_add_interface_trigger "interface.*.down" "${iface}" "${trm_init}" start
+ fi
PROCD_RELOAD_DELAY=1000
procd_add_config_trigger "config.change" "travelmate" "${trm_init}" start
}
#
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-trm_ver="0.8.2"
+trm_ver="0.9.3"
trm_sysver="$(ubus -S call system board | jsonfilter -e '@.release.description')"
trm_enabled=0
trm_debug=0
then
continue
fi
- while [ ${cnt} -le ${trm_maxretry} ]
+ while [ ${trm_maxretry} -eq 0 ] || [ ${cnt} -le ${trm_maxretry} ]
do
ssid_list="$(${trm_iwinfo} "${dev}" scan | awk '/ESSID: "/{ORS=" ";if (!seen[$0]++) for(i=2; i<=NF; i++) print $i}')"
f_log "debug" "main: ${trm_iwinfo}, dev: ${dev}, ssids: ${ssid_list}"
f_log "info " "interface '${sta_iface}' on '${sta_radio}' connected to uplink '${sta_ssid}' (${trm_sysver})"
f_jsnupdate "${sta_iface}" "${sta_radio}" "${sta_ssid}"
return 0
+ elif [ ${trm_maxretry} -ne 0 ] && [ ${cnt} -eq ${trm_maxretry} ]
+ then
+ uci -q set wireless."${config}".disabled=1
+ uci -q set wireless."${config}".ssid="${sta_ssid}_err"
+ uci -q commit wireless
+ f_check "dev"
+ f_log "info " "can't connect to uplink '${sta_ssid}' (${cnt}/${trm_maxretry}), uplink disabled (${trm_sysver})"
else
+ if [ ${trm_maxretry} -eq 0 ]
+ then
+ cnt=0
+ fi
uci -q revert wireless
- f_log "info " "interface '${sta_iface}' on '${sta_radio}' can't connect to uplink '${sta_ssid}' (${trm_sysver})"
- f_jsnupdate "${sta_iface}" "${sta_radio}" "${sta_ssid}"
+ f_check "dev"
+ f_log "info " "can't connect to uplink '${sta_ssid}' (${cnt}/${trm_maxretry}) (${trm_sysver})"
fi
+ f_jsnupdate "${sta_iface}" "${sta_radio}" "${sta_ssid}"
fi
done
fi
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/mhei/u2pnpd/releases/download/v$(PKG_VERSION)
-PKG_MD5SUM:=ac6f378590d3e4e38b40e4b13f03b369
+PKG_HASH:=73010be7ec523e3c3a9849a9783026627ecb3bc18d8195a9bed450e98a055ac2
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.anytun.org/download/
-PKG_MD5SUM:=ce47ad45003ff1d84eaf5276941b9ddf
+PKG_HASH:=8edeed2ce185cc1add8a53de9f9192dfa65a48b559cccae6393faf2a1cd6f093
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
PKG_LICENSE:=GPL-3.0+
PKG_SOURCE_URL:=https://github.com/pcherenkov/udpxy.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=bb6ca16706b011cc473d296ebc6d6e57fe5cfc2a0fc46e81399fba01d6484b3e
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-3.0
ftp://ftp.be.netfilter.org/pub/netfilter/ulogd/ \
ftp://ftp.de.netfilter.org/pub/netfilter/ulogd/ \
ftp://ftp.no.netfilter.org/pub/netfilter/ulogd/
-PKG_MD5SUM:=f0f8fe1371fa28b5e06cb16aaa0111dd
+PKG_HASH:=a221cb9f77347c0ca00d0937e27c1b90e3291a553cc62a4139b788e2e420e8c0
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_URL:=https://github.com/umurmur/umurmur.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=fac630135664fda26338d403041b6b6e558a2d6b
-PKG_MIRROR_MD5SUM:=0e031baa5cebcdb4eb39a0cde572014f
PKG_MIRROR_HASH:=6773aebea9aea355a41425e946291bb47bc399f85483bd6532cf26dfc7c801e5
PKG_INSTALL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=unbound
-PKG_VERSION:=1.6.4
-PKG_RELEASE:=1
+PKG_VERSION:=1.6.6
+PKG_RELEASE:=2
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.unbound.net/downloads
-PKG_HASH:=df0a88816ec31ccb8284c9eb132e1166fbf6d9cde71fbc4b8cd08a91ee777fed
+PKG_HASH:=972b14dc33093e672652a7b2b5f159bab2198b0fe9c9e1c5707e1895d4d4b390
PKG_BUILD_DEPENDS:=libexpat
PKG_BUILD_PARALLEL:=1
Bytes. Extended DNS is necessary for DNSSEC. However, it can run
into MTU issues. Use this size in bytes to manage drop outs.
+ option extended_luci '0'
+ Boolean. Extends a tab hierarchy in LuCI for advanced congfiguration.
+
+ option extended_stats '0'
+ Boolean. extended statistics are printed from unbound-control.
+ Keeping track of more statistics takes time.
+
option hide_binddata '1'
Boolean. If enabled version.server, version.bind, id.server, and
hostname.bind queries are refused.
Typical to configure maybe 0~300, but 1800 is the maximum accepted.
option unbound_control '0'
- Boolean. Enables unbound-control application access ports. Enabling
- this without the unbound-control package installed is robust.
+ Level. Enables unbound-control application access ports.
+ 0 - No unbound-control Access, or add your own in 'unbound_ext.conf'
+ 1 - Unencrypted Local Host Access
+ 2 - SSL Local Host Access; auto unbound-control-setup if available
+ 3 - SSL Network Access; auto unbound-control-setup if available
+ 4 - SSL Network Access; static key/pem files must already exist
option validator '0'
Boolean. Enable DNSSEC. Unbound names this the "validator" module.
if ( bconf == 1 ) {
x = ( "local-data: \"" fqdn ". 120 IN A " adr "\"" ) ;
y = ( "local-data-ptr: \"" adr " 120 " fqdn "\"" ) ;
- print ( x "\n" y ) > hostfile ;
+ print ( x "\n" y "\n" ) > hostfile ;
}
else {
# GA or ULA routed addresses only (not LL or MC)
sub( /\/.*/, "", adr ) ;
adr = ( adr slaac ) ;
-
-
- if ( split( adr, tmp0, ":" ) >= 8 ) {
- sub( "::", ":", adr ) ;
+
+
+ if ( split( adr, tmp0, ":" ) >= 8 ) {
+ sub( "::", ":", adr ) ;
}
if ( bconf == 1 ) {
x = ( "local-data: \"" fqdn ". 120 IN AAAA " adr "\"" ) ;
y = ( "local-data-ptr: \"" adr " 120 " fqdn "\"" ) ;
- print ( x "\n" y ) > hostfile ;
+ print ( x "\n" y "\n" ) > hostfile ;
}
else {
if ( bconf == 1 ) {
x = ( "local-data: \"" fqdn ". 120 IN AAAA " adr "\"" ) ;
y = ( "local-data-ptr: \"" adr " 120 " fqdn "\"" ) ;
- print ( x "\n" y ) > hostfile ;
+ print ( x "\n" y "\n" ) > hostfile ;
}
else {
print ( x "\n" y ) > hostfile ;
}
}
-
+
if (( cdr2 == 128 ) && ( hst != "-" )) {
if ( bconf == 1 ) {
x = ( "local-data: \"" fqdn ". 120 IN AAAA " adr2 "\"" ) ;
y = ( "local-data-ptr: \"" adr2 " 120 " fqdn "\"" ) ;
- print ( x "\n" y ) > hostfile ;
+ print ( x "\n" y "\n" ) > hostfile ;
}
else {
#
##############################################################################
-UNBOUND_B_CONTROL=0
UNBOUND_B_SLAAC6_MAC=0
UNBOUND_B_DNSSEC=0
UNBOUND_B_DNS64=0
+UNBOUND_B_EXT_STATS=0
UNBOUND_B_GATE_NAME=0
UNBOUND_B_HIDE_BIND=1
UNBOUND_B_LOCL_BLCK=0
UNBOUND_B_QUERY_MIN=0
UNBOUND_B_QRY_MINST=0
+UNBOUND_D_CONTROL=0
UNBOUND_D_DOMAIN_TYPE=static
UNBOUND_D_DHCP_LINK=none
UNBOUND_D_EXTRA_DNS=0
UNBOUND_HINTFILE=$UNBOUND_VARDIR/root.hints
UNBOUND_TIMEFILE=$UNBOUND_VARDIR/hotplug.time
+UNBOUND_CTLKEY_FILE=$UNBOUND_VARDIR/unbound_control.key
+UNBOUND_CTLPEM_FILE=$UNBOUND_VARDIR/unbound_control.pem
+UNBOUND_SRVKEY_FILE=$UNBOUND_VARDIR/unbound_server.key
+UNBOUND_SRVPEM_FILE=$UNBOUND_VARDIR/unbound_server.pem
+
##############################################################################
UNBOUND_ANCHOR=/usr/sbin/unbound-anchor
# Ensure access and prepare to jail
chown -R unbound:unbound $UNBOUND_VARDIR
- chmod 775 $UNBOUND_VARDIR
- chmod 664 $UNBOUND_VARDIR/*
+ chmod 755 $UNBOUND_VARDIR
+ chmod 644 $UNBOUND_VARDIR/*
+
+
+ if [ -f $UNBOUND_CTLKEY_FILE -o -f $UNBOUND_CTLPEM_FILE \
+ -o -f $UNBOUND_SRVKEY_FILE -o -f $UNBOUND_SRVPEM_FILE ] ; then
+ # Keys (some) exist already; do not create new ones
+ chmod 640 $UNBOUND_CTLKEY_FILE $UNBOUND_CTLPEM_FILE \
+ $UNBOUND_SRVKEY_FILE $UNBOUND_SRVPEM_FILE
+
+ elif [ -x /usr/sbin/unbound-control-setup ] ; then
+ case "$UNBOUND_D_CONTROL" in
+ [2-3])
+ # unbound-control-setup for encrypt opt. 2 and 3, but not 4 "static"
+ /usr/sbin/unbound-control-setup -d $UNBOUND_VARDIR
+
+ chown -R unbound:unbound $UNBOUND_CTLKEY_FILE $UNBOUND_CTLPEM_FILE \
+ $UNBOUND_SRVKEY_FILE $UNBOUND_SRVPEM_FILE
+
+ chmod 640 $UNBOUND_CTLKEY_FILE $UNBOUND_CTLPEM_FILE \
+ $UNBOUND_SRVKEY_FILE $UNBOUND_SRVPEM_FILE
+
+ cp -p $UNBOUND_CTLKEY_FILE /etc/unbound/unbound_control.key
+ cp -p $UNBOUND_CTLPEM_FILE /etc/unbound/unbound_control.pem
+ cp -p $UNBOUND_SRVKEY_FILE /etc/unbound/unbound_server.key
+ cp -p $UNBOUND_SRVPEM_FILE /etc/unbound/unbound_server.pem
+ ;;
+ esac
+ fi
}
##############################################################################
unbound_control() {
- if [ "$UNBOUND_B_CONTROL" -gt 0 ] ; then
+ if [ "$UNBOUND_D_CONTROL" -gt 1 ] ; then
+ if [ ! -f $UNBOUND_CTLKEY_FILE -o ! -f $UNBOUND_CTLPEM_FILE \
+ -o ! -f $UNBOUND_SRVKEY_FILE -o ! -f $UNBOUND_SRVPEM_FILE ] ; then
+ # Key files need to be present; if unbound-control-setup was found, then
+ # they might have been made during unbound_makedir() above.
+ UNBOUND_D_CONTROL=0
+ fi
+ fi
+
+
+ case "$UNBOUND_D_CONTROL" in
+ 1)
{
- # Enable remote control tool, but only at local host for security
- # You can hand write fancier encrypted access with /etc/..._ext.conf
+ # Local Host Only Unencrypted Remote Control
echo "remote-control:"
echo " control-enable: yes"
echo " control-use-cert: no"
echo " control-interface: ::1"
echo
} >> $UNBOUND_CONFFILE
- fi
+ ;;
+
+ 2)
+ {
+ # Local Host Only Encrypted Remote Control
+ echo "remote-control:"
+ echo " control-enable: yes"
+ echo " control-use-cert: yes"
+ echo " control-interface: 127.0.0.1"
+ echo " control-interface: ::1"
+ echo " server-key-file: \"$UNBOUND_SRVKEY_FILE\""
+ echo " server-cert-file: \"$UNBOUND_SRVPEM_FILE\""
+ echo " control-key-file: \"$UNBOUND_CTLKEY_FILE\""
+ echo " control-cert-file: \"$UNBOUND_CTLPEM_FILE\""
+ echo
+ } >> $UNBOUND_CONFFILE
+ ;;
+
+ [3-4])
+ {
+ # Network Encrypted Remote Control
+ # (3) may auto setup and (4) must have static key/pem files
+ # TODO: add UCI list for interfaces to bind
+ echo "remote-control:"
+ echo " control-enable: yes"
+ echo " control-use-cert: yes"
+ echo " control-interface: 0.0.0.0"
+ echo " control-interface: ::0"
+ echo " server-key-file: \"$UNBOUND_SRVKEY_FILE\""
+ echo " server-cert-file: \"$UNBOUND_SRVPEM_FILE\""
+ echo " control-key-file: \"$UNBOUND_CTLKEY_FILE\""
+ echo " control-cert-file: \"$UNBOUND_CTLPEM_FILE\""
+ echo
+ } >> $UNBOUND_CONFFILE
+ ;;
+ esac
{
local cfg="$1"
local rt_mem rt_conn modulestring
+ # Make fresh conf file
+ echo > $UNBOUND_CONFFILE
+
{
# Make fresh conf file
echo "# $UNBOUND_CONFFILE generated by UCI $( date )"
echo
- } > $UNBOUND_CONFFILE
-
-
- {
# No threading
echo "server:"
echo " username: unbound"
echo " infra-cache-slabs: 1"
echo " key-cache-slabs: 1"
echo
- } >> $UNBOUND_CONFFILE
-
-
- {
+ # Interface Wildcard (access contol handled by "option local_service")
+ echo " interface: 0.0.0.0"
+ echo " interface: ::0"
+ echo " outgoing-interface: 0.0.0.0"
+ echo " outgoing-interface: ::0"
+ echo
# Logging
echo " verbosity: 1"
echo " statistics-interval: 0"
echo " statistics-cumulative: no"
- echo " extended-statistics: no"
- echo
} >> $UNBOUND_CONFFILE
- {
- # Interfaces (access contol "option local_service")
- echo " interface: 0.0.0.0"
- echo " interface: ::0"
- echo " outgoing-interface: 0.0.0.0"
- echo " outgoing-interface: ::0"
- echo
- } >> $UNBOUND_CONFFILE
+ if [ "$UNBOUND_B_EXT_STATS" -gt 0 ] ; then
+ {
+ # Log More
+ echo " extended-statistics: yes"
+ echo
+ } >> $UNBOUND_CONFFILE
+
+ else
+ {
+ # Log Less
+ echo " extended-statistics: no"
+ echo
+ } >> $UNBOUND_CONFFILE
+ fi
case "$UNBOUND_D_PROTOCOL" in
config_get_bool UNBOUND_B_SLAAC6_MAC "$cfg" dhcp4_slaac6 0
config_get_bool UNBOUND_B_DNS64 "$cfg" dns64 0
+ config_get_bool UNBOUND_B_EXT_STATS "$cfg" extended_stats 0
config_get_bool UNBOUND_B_HIDE_BIND "$cfg" hide_binddata 1
config_get_bool UNBOUND_B_LOCL_SERV "$cfg" localservice 1
config_get_bool UNBOUND_B_MAN_CONF "$cfg" manual_conf 0
config_get_bool UNBOUND_B_QRY_MINST "$cfg" query_min_strict 0
config_get_bool UNBOUND_B_PRIV_BLCK "$cfg" rebind_protection 1
config_get_bool UNBOUND_B_LOCL_BLCK "$cfg" rebind_localhost 0
- config_get_bool UNBOUND_B_CONTROL "$cfg" unbound_control 0
config_get_bool UNBOUND_B_DNSSEC "$cfg" validator 0
config_get_bool UNBOUND_B_NTP_BOOT "$cfg" validator_ntp 1
config_get UNBOUND_N_RX_PORT "$cfg" listen_port 53
config_get UNBOUND_N_ROOT_AGE "$cfg" root_age 9
+ config_get UNBOUND_D_CONTROL "$cfg" unbound_control 0
config_get UNBOUND_D_DOMAIN_TYPE "$cfg" domain_type static
config_get UNBOUND_D_DHCP_LINK "$cfg" dhcp_link none
config_get UNBOUND_D_EXTRA_DNS "$cfg" add_extra_dns 0
option domain 'lan'
option domain_type 'static'
option edns_size '1280'
+ option extended_luci '0'
+ option extended_stats '0'
option hide_binddata '1'
option listen_port '53'
option localservice '1'
##############################################################################
-# UNBOUND UCI USER ADDED CLAUSES
+# Extended user clauses added to the end of the UCI generated 'unbound.conf'
#
-# Put your own forward:, view:, stub:, and control: clauses here. This file is
-# appended to the end of UCI auto generated 'unbound.conf'. This is done with
-# include: statement. Notice, it is outside of the server: clause.
+# Put your own forward:, view:, stub:, or remote-control: clauses here. This
+# file is appended to the end of 'unbound.conf' with an include: statement.
+# Notice that it is not part of the server: clause. Use 'unbound_srv.conf' to
+# place custom option statements in the server: clause.
##############################################################################
##############################################################################
-# UNBOUND UCI USER ADDED SERVER OPTIONS
+# User custom options added in the server: clause part of UCI 'unbound.conf'
#
-# Put your own choice options here when not covered by UCI. These are all part
-# of the server: clause only. Most likely are hardening options or local-zone:
-# This is in an include: statement towards the end of the server: cluase.
+# Add your own option statements here when they are not covered by UCI. This
+# file is placed _inside_ the server: clause with an include: statement. Do
+# not start other clauses here, because that would brake the server: clause.
+# Use 'unbound_ext.conf' to start new clauses at the end of 'unbound.conf'.
##############################################################################
-#
-# Example configuration file.
-#
--# See unbound.conf(5) man page, version 1.6.4.
+-# See unbound.conf(5) man page, version 1.6.6.
-#
-# this is a comment.
+##############################################################################
define Download/usb.ids
URL:=http://www.linux-usb.org/
+ HASH:=47dc941dca801b89f1529e09f0d338755d8fbb0ce75f526e1dcccc4fbf8fc66c
FILE:=usb.ids
MD5SUM:=
endef
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/stintel/vallumd/archive/$(PKG_VERSION)/
-PKG_MD5SUM:=b40bede34ea321daf799276111e0e804007dc7c10eb031a0a654982957dcfb25
+PKG_HASH:=b40bede34ea321daf799276111e0e804007dc7c10eb031a0a654982957dcfb25
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=repeater014.zip
PKG_SOURCE_URL:=http://jtko.mbnet.fi/uvncrepeater
-PKG_MD5SUM:=3005ebbb2f9442cbea4cbcaa71925dbf
+PKG_HASH:=79178e9baa9cac05f26e43f742933958707cb5c0632c51a5706b13922f3bb5b0
PKG_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=http://http.debian.net/debian/pool/main/w/wakeonlan/
-PKG_MD5SUM:=581b1b27a7e810ab72668cce4bd9aa9b3e0cea34b2db24dd1a44c09d63ddda98
+PKG_HASH:=581b1b27a7e810ab72668cce4bd9aa9b3e0cea34b2db24dd1a44c09d63ddda98
PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
PKG_LICENSE:=Artistic-1.0-Perl
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=e00710049c34bf45735085ad59eedf54190e78d1c5f6b43d28ae9bc93d07681e
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/uoaerg/wavemon.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=af9ca95a4bb8ac4a9bf10aeae66fa5ec
+PKG_HASH:=b5b55b75726c04c06fe253daec9329a6f1a3c0c1878e3ea76ebfebc139ea9cc1
PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=1.3.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=cdab08c11ba04ffa58c2df69c2c62f63196e290a216708fa5b7d43087c18d1b0
PKG_FIXUP:=autoreconf
# do not run make install
PKG_NAME:=wireguard
-PKG_VERSION:=0.0.20170706
+PKG_VERSION:=0.0.20170918
PKG_RELEASE:=1
PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/
-PKG_HASH:=5763b9436265421a67f92cb82142042867fc87c573ecc18033d40c1476146c33
+PKG_HASH:=e083f18596574fb7050167090bfb4db4df09a1a99f3c1adc77f820c166368881
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
SECTION:=net
CATEGORY:=Network
SUBMENU:=VPN
- URL:=https://www.wireguard.io
+ URL:=https://www.wireguard.com
MAINTAINER:=Baptiste Jonglez <openwrt@bitsofnetworks.org>, \
+ Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>, \
Dan Luedtke <mail@danrl.com>, \
Jason A. Donenfeld <Jason@zx2c4.com>
endef
more useful than IPSec, while avoiding the massive headache. It intends to
be considerably more performant than OpenVPN. WireGuard is designed as a
general purpose VPN for running on embedded interfaces and super computers
- alike, fit for many different circumstances.
- It runs over UDP.
+ alike, fit for many different circumstances. It uses UDP.
endef
define Package/wireguard
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.xinetd.org
-PKG_MD5SUM:=77358478fd58efa6366accae99b8b04c
+PKG_HASH:=bf4e060411c75605e4dcbdf2ac57c6bd9e1904470a2f91e01ba31b50a80a5be3
PKG_LICENSE:=xinetd
PKG_LICENSE_FILES:=COPYRIGHT
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=e2065bf0fc22ba33001ad503c01bba01648024a8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=8b15c0069cdab7080796f92f86c84b79e430679ce77fb6ea95749fe932bb87c4
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://znc.in/releases \
http://znc.in/releases/archive
-PKG_MD5SUM:=2f0225d49c53a01f8d94feea4619a6fe92857792bb3401a4eb1edd65f0342aca
+PKG_HASH:=2f0225d49c53a01f8d94feea4619a6fe92857792bb3401a4eb1edd65f0342aca
PKG_MAINTAINER:=Jonas Gorski <jogo@openwrt.org>
PKG_LICENSE:=Apache-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/utils/ \
http://alsa.cybermirror.org/utils/
-PKG_MD5SUM:=b9d6102fbbd0b68040bb77023ed30c0c
+PKG_HASH:=3b1c3135b76e14532d3dd23fb15759ddd7daf9ffbc183f7a9a0a3a86374748f1
PKG_INSTALL:=1
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-source.zip
PKG_SOURCE_URL:=@SF/espeak
-PKG_MD5SUM:=cadd7482eaafe9239546bdc09fa244c3
+PKG_HASH:=bf9a17673adffcc28ff7ea18764f06136547e97bbd9edf2ec612f09b207f0659
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=License.txt
PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=74c1a2a4f831285cbd93ec1427f1670d3c5c5e52
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MIRROR_MD5SUM:=d2ff3ca03842e96f3f18619f8a27ea03fb5d1e2266e4010cbb4803bf6e1fe62b
+PKG_MIRROR_HASH:=d2ff3ca03842e96f3f18619f8a27ea03fb5d1e2266e4010cbb4803bf6e1fe62b
PKG_FIXUP:=autoreconf
include $(TOPDIR)/rules.mk
PKG_NAME:=forked-daapd
-PKG_VERSION:=24.2
+PKG_VERSION:=25.0
PKG_RELEASE:=1
-PKG_REV:=1b6283752ed0b790a6658bed1f05946e1af193da
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://github.com/ejurgensen/forked-daapd.git
-PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/ejurgensen/$(PKG_NAME)/releases/download/$(PKG_VERSION)/
+PKG_HASH:=5741a64d8f54e11e89dfa2fbfae693b2837e1e19a0c4980a20f8ff56bce4456e
PKG_BUILD_DEPENDS:=gperf/host
PKG_FIXUP:=autoreconf
DEPENDS:=+libgpg-error +libgcrypt +libgdbm +zlib +libexpat +libunistring \
+libevent2 +libdaemon +libantlr3c +confuse +alsa-lib +libffmpeg-full \
+mxml +libavahi-client +sqlite3-cli +libplist +libcurl +libjson-c \
- +libprotobuf-c +libgnutls $(ICONV_DEPENDS)
+ +libprotobuf-c +libgnutls +libsodium $(ICONV_DEPENDS)
endef
define Package/forked-daapd/description
--enable-itunes \
--enable-lastfm \
--enable-mpd \
- --enable-chromecast
+ --enable-chromecast \
+ --enable-verification \
+ --disable-spotify \
+ --without-pulseaudio \
+ --without-libevent_pthreads
TARGET_CFLAGS += $(FPIC)
TARGET_LDFLAGS += -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
+++ /dev/null
-diff --git a/src/pregen/DAAP.u b/src/pregen/DAAP.u
-new file mode 100644
-index 0000000..3de527b
---- /dev/null
-+++ b/src/pregen/DAAP.u
-@@ -0,0 +1,6 @@
-+DAAPParser.c : DAAP.g
-+./DAAP.tokens : DAAP.g
-+DAAPParser.h : DAAP.g
-+DAAPLexer.c : DAAP.g
-+DAAPLexer.h : DAAP.g
-+ANTLR_PRODUCTS += DAAPParser.c ./DAAP.tokens DAAPParser.h DAAPLexer.c DAAPLexer.h
-\ No newline at end of file
-diff --git a/src/pregen/DAAP2SQL.c b/src/pregen/DAAP2SQL.c
-new file mode 100644
-index 0000000..04d6153
---- /dev/null
-+++ b/src/pregen/DAAP2SQL.c
-@@ -0,0 +1,975 @@
-+/** \file
-+ * This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : DAAP2SQL.g
-+ * - On : 2016-01-01 12:23:43
-+ * - for the tree parser : DAAP2SQLTreeParser *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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.
-+
-+
-+/* =============================================================================
-+ * This is what the grammar programmer asked us to put at the top of every file.
-+ */
-+
-+ #include <stdio.h>
-+ #include <stdlib.h>
-+ #include <string.h>
-+ #include <limits.h>
-+ #include <errno.h>
-+
-+ #include "logger.h"
-+ #include "db.h"
-+ #include "daap_query.h"
-+
-+/* End of Header action.
-+ * =============================================================================
-+ */
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include "DAAP2SQL.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+
-+#define CTX ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef SCOPE_TYPE
-+#undef SCOPE_STACK
-+#undef SCOPE_TOP
-+#define SCOPE_TYPE(scope) pDAAP2SQL_##scope##_SCOPE
-+#define SCOPE_STACK(scope) pDAAP2SQL_##scope##Stack
-+#define SCOPE_TOP(scope) ctx->pDAAP2SQL_##scope##Top
-+#define SCOPE_SIZE(scope) ctx->pDAAP2SQL_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i) (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+/* Macros for accessing things in the parser
-+ */
-+
-+#undef PARSER
-+#undef RECOGNIZER
-+#undef HAVEPARSEDRULE
-+#undef INPUT
-+#undef STRSTREAM
-+#undef HASEXCEPTION
-+#undef EXCEPTION
-+#undef MATCHT
-+#undef MATCHANYT
-+#undef FOLLOWSTACK
-+#undef FOLLOWPUSH
-+#undef FOLLOWPOP
-+#undef PRECOVER
-+#undef PREPORTERROR
-+#undef LA
-+#undef LT
-+#undef CONSTRUCTEX
-+#undef CONSUME
-+#undef MARK
-+#undef REWIND
-+#undef REWINDLAST
-+#undef PERRORRECOVERY
-+#undef HASFAILED
-+#undef FAILEDFLAG
-+#undef RECOVERFROMMISMATCHEDSET
-+#undef RECOVERFROMMISMATCHEDELEMENT
-+#undef BACKTRACKING
-+#undef ADAPTOR
-+#undef RULEMEMO
-+#undef SEEK
-+#undef INDEX
-+#undef DBG
-+
-+#define PARSER ctx->pTreeParser
-+#define RECOGNIZER PARSER->rec
-+#define PSRSTATE RECOGNIZER->state
-+#define HAVEPARSEDRULE(r) RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define INPUT PARSER->ctnstream
-+#define ISTREAM INPUT->tnstream->istream
-+#define STRSTREAM INPUT->tnstream
-+#define HASEXCEPTION() (PSRSTATE->error == ANTLR3_TRUE)
-+#define EXCEPTION PSRSTATE->exception
-+#define MATCHT(t, fs) RECOGNIZER->match(RECOGNIZER, t, fs)
-+#define MATCHANYT() RECOGNIZER->matchAny(RECOGNIZER)
-+#define FOLLOWSTACK PSRSTATE->following
-+#define FOLLOWPUSH(x) FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
-+#define FOLLOWPOP() FOLLOWSTACK->pop(FOLLOWSTACK)
-+#define PRECOVER() RECOGNIZER->recover(RECOGNIZER)
-+#define PREPORTERROR() RECOGNIZER->reportError(RECOGNIZER)
-+#define LA(n) ISTREAM->_LA(ISTREAM, n)
-+#define LT(n) INPUT->tnstream->_LT(INPUT->tnstream, n)
-+#define CONSTRUCTEX() RECOGNIZER->exConstruct(RECOGNIZER)
-+#define CONSUME() ISTREAM->consume(ISTREAM)
-+#define MARK() ISTREAM->mark(ISTREAM)
-+#define REWIND(m) ISTREAM->rewind(ISTREAM, m)
-+#define REWINDLAST() ISTREAM->rewindLast(ISTREAM)
-+#define PERRORRECOVERY PSRSTATE->errorRecovery
-+#define FAILEDFLAG PSRSTATE->failed
-+#define HASFAILED() (FAILEDFLAG == ANTLR3_TRUE)
-+#define BACKTRACKING PSRSTATE->backtracking
-+#define RECOVERFROMMISMATCHEDSET(s) RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
-+#define RECOVERFROMMISMATCHEDELEMENT(e) RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
-+#define ADAPTOR INPUT->adaptor
-+#define RULEMEMO PSRSTATE->ruleMemo
-+#define SEEK(n) ISTREAM->seek(ISTREAM, n)
-+#define INDEX() ISTREAM->index(ISTREAM)
-+#define DBG RECOGNIZER->debugger
-+
-+
-+#define TOKTEXT(tok, txt) tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define UP ANTLR3_TOKEN_UP
-+#define DOWN ANTLR3_TOKEN_DOWN
-+#define EOR ANTLR3_TOKEN_EOR
-+#define INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+
-+/** \brief Table of all token names in symbolic order, mainly used for
-+ * error reporting.
-+ */
-+pANTLR3_UINT8 DAAP2SQLTokenNames[8+4]
-+ = {
-+ (pANTLR3_UINT8) "<invalid>", /* String to print to indicate an invalid token */
-+ (pANTLR3_UINT8) "<EOR>",
-+ (pANTLR3_UINT8) "<DOWN>",
-+ (pANTLR3_UINT8) "<UP>",
-+ (pANTLR3_UINT8) "NEWLINE",
-+ (pANTLR3_UINT8) "OPOR",
-+ (pANTLR3_UINT8) "OPAND",
-+ (pANTLR3_UINT8) "LPAR",
-+ (pANTLR3_UINT8) "RPAR",
-+ (pANTLR3_UINT8) "STR",
-+ (pANTLR3_UINT8) "QUOTE",
-+ (pANTLR3_UINT8) "ESCAPED"
-+ };
-+
-+
-+
-+// Forward declare the locally static matching functions we have generated.
-+//
-+static pANTLR3_STRING query (pDAAP2SQL ctx);
-+static DAAP2SQL_expr_return expr (pDAAP2SQL ctx);
-+static void DAAP2SQLFree(pDAAP2SQL ctx);
-+/* For use in tree output where we are accumulating rule labels via label += ruleRef
-+ * we need a function that knows how to free a return scope when the list is destroyed.
-+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
-+ */
-+static void ANTLR3_CDECL freeScope(void * scope)
-+{
-+ ANTLR3_FREE(scope);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "DAAP2SQL.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+ return fileName;
-+}
-+/** \brief Create a new DAAP2SQL parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pDAAP2SQL
-+DAAP2SQLNew (pANTLR3_COMMON_TREE_NODE_STREAM instream)
-+{
-+ // See if we can create a new parser with the standard constructor
-+ //
-+ return DAAP2SQLNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new DAAP2SQL parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pDAAP2SQL
-+DAAP2SQLNewSSD (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+ pDAAP2SQL ctx; /* Context structure we will build and return */
-+
-+ ctx = (pDAAP2SQL) ANTLR3_CALLOC(1, sizeof(DAAP2SQL));
-+
-+ if (ctx == NULL)
-+ {
-+ // Failed to allocate memory for parser context
-+ //
-+ return NULL;
-+ }
-+
-+ /* -------------------------------------------------------------------
-+ * Memory for basic structure is allocated, now to fill in
-+ * the base ANTLR3 structures. We initialize the function pointers
-+ * for the standard ANTLR3 parser function set, but upon return
-+ * from here, the programmer may set the pointers to provide custom
-+ * implementations of each function.
-+ *
-+ * We don't use the macros defined in DAAP2SQL.h here, in order that you can get a sense
-+ * of what goes where.
-+ */
-+
-+ /* Create a base Tree parser/recognizer, using the supplied tree node stream
-+ */
-+ ctx->pTreeParser = antlr3TreeParserNewStream(ANTLR3_SIZE_HINT, instream, state);
-+ /* Install the implementation of our DAAP2SQL interface
-+ */
-+ ctx->query = query;
-+ ctx->expr = expr;
-+ ctx->free = DAAP2SQLFree;
-+ ctx->getGrammarFileName = getGrammarFileName;
-+
-+ /* Install the scope pushing methods.
-+ */
-+
-+
-+
-+
-+
-+ /* Install the token table
-+ */
-+ PSRSTATE->tokenNames = DAAP2SQLTokenNames;
-+
-+
-+ /* Return the newly built parser to the caller
-+ */
-+ return ctx;
-+}
-+
-+/** Free the parser resources
-+ */
-+ static void
-+ DAAP2SQLFree(pDAAP2SQL ctx)
-+ {
-+ /* Free any scope memory
-+ */
-+
-+
-+ // Free this parser
-+ //
-+ ctx->pTreeParser->free(ctx->pTreeParser);
-+ ANTLR3_FREE(ctx);
-+
-+ /* Everything is released, so we can return
-+ */
-+ return;
-+ }
-+
-+/** Return token names used by this tree parser
-+ *
-+ * The returned pointer is used as an index into the token names table (using the token
-+ * number as the index).
-+ *
-+ * \return Pointer to first char * in the table.
-+ */
-+static pANTLR3_UINT8 *getTokenNames()
-+{
-+ return DAAP2SQLTokenNames;
-+}
-+
-+
-+ struct dmap_query_field_map {
-+ char *dmap_field;
-+ char *db_col;
-+ int as_int;
-+ };
-+
-+ /* gperf static hash, daap_query.gperf */
-+ #include "daap_query_hash.c"
-+
-+
-+/* Declare the bitsets
-+ */
-+
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_query70 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_query70_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_query70 = { FOLLOW_expr_in_query70_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OPAND_in_expr95 */
-+static ANTLR3_BITWORD FOLLOW_OPAND_in_expr95_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static ANTLR3_BITSET_LIST FOLLOW_OPAND_in_expr95 = { FOLLOW_OPAND_in_expr95_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr101 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_expr101_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000260) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_expr101 = { FOLLOW_expr_in_expr101_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr107 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_expr107_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_expr107 = { FOLLOW_expr_in_expr107_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OPOR_in_expr118 */
-+static ANTLR3_BITWORD FOLLOW_OPOR_in_expr118_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static ANTLR3_BITSET_LIST FOLLOW_OPOR_in_expr118 = { FOLLOW_OPOR_in_expr118_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr124 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_expr124_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000260) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_expr124 = { FOLLOW_expr_in_expr124_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr130 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_expr130_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_expr130 = { FOLLOW_expr_in_expr130_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_expr140 */
-+static ANTLR3_BITWORD FOLLOW_STR_in_expr140_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_STR_in_expr140 = { FOLLOW_STR_in_expr140_bits, 1 };
-+
-+
-+
-+
-+/* ==============================================
-+ * Parsing rules
-+ */
-+/**
-+ * $ANTLR start query
-+ * DAAP2SQL.g:50:1: query returns [ pANTLR3_STRING result ] : e= expr ;
-+ */
-+static pANTLR3_STRING
-+query(pDAAP2SQL ctx)
-+{
-+ pANTLR3_STRING result = NULL;
-+
-+ DAAP2SQL_expr_return e;
-+ #undef RETURN_TYPE_e
-+ #define RETURN_TYPE_e DAAP2SQL_expr_return
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ result= NULL;
-+ {
-+ // DAAP2SQL.g:52:2: (e= expr )
-+ // DAAP2SQL.g:52:4: e= expr
-+ {
-+ FOLLOWPUSH(FOLLOW_expr_in_query70);
-+ e=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulequeryEx;
-+ }
-+
-+ {
-+
-+ if (!e.valid)
-+ {
-+ result= NULL;
-+ }
-+ else
-+ {
-+ result= e.result->factory->newRaw(e.result->factory);
-+ result->append8(result, "(");
-+ result->appendS(result, e.result);
-+ result->append8(result, ")");
-+ }
-+
-+ }
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto rulequeryEx; /* Prevent compiler warnings */
-+ rulequeryEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return result;
-+}
-+/* $ANTLR end query */
-+
-+/**
-+ * $ANTLR start expr
-+ * DAAP2SQL.g:68:1: expr returns [ pANTLR3_STRING result, int valid ] : ( ^( OPAND a= expr b= expr ) | ^( OPOR a= expr b= expr ) | STR );
-+ */
-+static DAAP2SQL_expr_return
-+expr(pDAAP2SQL ctx)
-+{
-+ DAAP2SQL_expr_return retval;
-+
-+ pANTLR3_BASE_TREE STR1;
-+ DAAP2SQL_expr_return a;
-+ #undef RETURN_TYPE_a
-+ #define RETURN_TYPE_a DAAP2SQL_expr_return
-+
-+ DAAP2SQL_expr_return b;
-+ #undef RETURN_TYPE_b
-+ #define RETURN_TYPE_b DAAP2SQL_expr_return
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ retval.result= NULL; retval.valid= 1;
-+ STR1 = NULL;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ {
-+ {
-+ // DAAP2SQL.g:70:2: ( ^( OPAND a= expr b= expr ) | ^( OPOR a= expr b= expr ) | STR )
-+
-+ ANTLR3_UINT32 alt1;
-+
-+ alt1=3;
-+
-+ switch ( LA(1) )
-+ {
-+ case OPAND:
-+ {
-+ alt1=1;
-+ }
-+ break;
-+ case OPOR:
-+ {
-+ alt1=2;
-+ }
-+ break;
-+ case STR:
-+ {
-+ alt1=3;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleexprEx;
-+ }
-+
-+ switch (alt1)
-+ {
-+ case 1:
-+ // DAAP2SQL.g:70:4: ^( OPAND a= expr b= expr )
-+ {
-+ MATCHT(OPAND, &FOLLOW_OPAND_in_expr95);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_DOWN, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expr_in_expr101);
-+ a=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expr_in_expr107);
-+ b=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_UP, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ {
-+
-+ if (a.valid && b.valid)
-+ {
-+ retval.result= a.result->factory->newRaw(a.result->factory);
-+ retval.result->append8(retval.result, "(");
-+ retval.result->appendS(retval.result, a.result);
-+ retval.result->append8(retval.result, " AND ");
-+ retval.result->appendS(retval.result, b.result);
-+ retval.result->append8(retval.result, ")");
-+ }
-+ else if (a.valid)
-+ {
-+ retval.result= a.result->factory->newRaw(a.result->factory);
-+ retval.result->appendS(retval.result, a.result);
-+ }
-+ else if (b.valid)
-+ {
-+ retval.result= b.result->factory->newRaw(b.result->factory);
-+ retval.result->appendS(retval.result, b.result);
-+ }
-+ else
-+ {
-+ retval.valid= 0;
-+ }
-+
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // DAAP2SQL.g:96:4: ^( OPOR a= expr b= expr )
-+ {
-+ MATCHT(OPOR, &FOLLOW_OPOR_in_expr118);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_DOWN, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expr_in_expr124);
-+ a=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expr_in_expr130);
-+ b=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_UP, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ {
-+
-+ if (a.valid && b.valid)
-+ {
-+ retval.result= a.result->factory->newRaw(a.result->factory);
-+ retval.result->append8(retval.result, "(");
-+ retval.result->appendS(retval.result, a.result);
-+ retval.result->append8(retval.result, " OR ");
-+ retval.result->appendS(retval.result, b.result);
-+ retval.result->append8(retval.result, ")");
-+ }
-+ else if (a.valid)
-+ {
-+ retval.result= a.result->factory->newRaw(a.result->factory);
-+ retval.result->appendS(retval.result, a.result);
-+ }
-+ else if (b.valid)
-+ {
-+ retval.result= b.result->factory->newRaw(b.result->factory);
-+ retval.result->appendS(retval.result, b.result);
-+ }
-+ else
-+ {
-+ retval.valid= 0;
-+ }
-+
-+ }
-+
-+ }
-+ break;
-+ case 3:
-+ // DAAP2SQL.g:122:4: STR
-+ {
-+ STR1 = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_expr140);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ {
-+
-+ pANTLR3_STRING str;
-+ pANTLR3_UINT8 field;
-+ pANTLR3_UINT8 val;
-+ pANTLR3_UINT8 escaped;
-+ ANTLR3_UINT8 op;
-+ int neg_op;
-+ const struct dmap_query_field_map *dqfm;
-+ char *end;
-+ long long llval;
-+
-+ escaped = NULL;
-+
-+ retval.result= (STR1->getText(STR1))->factory->newRaw((STR1->getText(STR1))->factory);
-+
-+ str = (STR1->getText(STR1))->toUTF8((STR1->getText(STR1)));
-+
-+ /* NOTE: the lexer delivers the string without quotes
-+ which may not be obvious from the grammar due to embedded code
-+ */
-+
-+ /* Make daap.songalbumid:0 a no-op */
-+ if (strcmp((char *)str->chars, "daap.songalbumid:0") == 0)
-+ {
-+ retval.result->append8(retval.result, "1 = 1");
-+
-+ goto STR_out;
-+ }
-+
-+ field = str->chars;
-+
-+ val = field;
-+ while ((*val != '\0') && ((*val == '.')
-+ || (*val == '-')
-+ || ((*val >= 'a') && (*val <= 'z'))
-+ || ((*val >= 'A') && (*val <= 'Z'))
-+ || ((*val >= '0') && (*val <= '9'))))
-+ {
-+ val++;
-+ }
-+
-+ if (*field == '\0')
-+ {
-+ DPRINTF(E_LOG, L_DAAP, "No field name found in clause '%s'\n", field);
-+ retval.valid= 0;
-+ goto STR_result_valid_0; /* ABORT */
-+ }
-+
-+ if (*val == '\0')
-+ {
-+ DPRINTF(E_LOG, L_DAAP, "No operator found in clause '%s'\n", field);
-+ retval.valid= 0;
-+ goto STR_result_valid_0; /* ABORT */
-+ }
-+
-+ op = *val;
-+ *val = '\0';
-+ val++;
-+
-+ if (op == '!')
-+ {
-+ if (*val == '\0')
-+ {
-+ DPRINTF(E_LOG, L_DAAP, "Negation found but operator missing in clause '%s%c'\n", field, op);
-+ retval.valid= 0;
-+ goto STR_result_valid_0; /* ABORT */
-+ }
-+
-+ neg_op = 1;
-+ op = *val;
-+ val++;
-+ }
-+ else
-+ neg_op = 0;
-+
-+ /* Lookup DMAP field in the query field map */
-+ dqfm = daap_query_field_lookup((char *)field, strlen((char *)field));
-+ if (!dqfm)
-+ {
-+ DPRINTF(E_LOG, L_DAAP, "DMAP field '%s' is not a valid field in queries\n", field);
-+ retval.valid= 0;
-+ goto STR_result_valid_0; /* ABORT */
-+ }
-+
-+ /* Empty values OK for string fields, NOK for integer */
-+ if (*val == '\0')
-+ {
-+ if (dqfm->as_int)
-+ {
-+ DPRINTF(E_LOG, L_DAAP, "No value given in clause '%s%s%c'\n", field, (neg_op) ? "!" : "", op);
-+ retval.valid= 0;
-+ goto STR_result_valid_0; /* ABORT */
-+ }
-+
-+ /* No need to exclude empty artist and album, as forked-daapd makes sure there always exists an artist/album. */
-+ if (neg_op && op == ':'
-+ && (strcmp((char *)field, "daap.songalbumartist") == 0
-+ || strcmp((char *)field, "daap.songartist") == 0
-+ || strcmp((char *)field, "daap.songalbum") == 0))
-+ {
-+ DPRINTF(E_DBG, L_DAAP, "Ignoring clause '%s%s%c'\n", field, (neg_op) ? "!" : "", op);
-+ retval.valid= 0;
-+ goto STR_result_valid_0;
-+ }
-+
-+ /* Need to check against NULL too */
-+ if (op == ':')
-+ retval.result->append8(retval.result, "(");
-+ }
-+
-+ /* Int field: check integer conversion */
-+ if (dqfm->as_int)
-+ {
-+ errno = 0;
-+ llval = strtoll((const char *)val, &end, 10);
-+
-+ if (((errno == ERANGE) && ((llval == LLONG_MAX) || (llval == LLONG_MIN)))
-+ || ((errno != 0) && (llval == 0)))
-+ {
-+ DPRINTF(E_LOG, L_DAAP, "Value '%s' in clause '%s%s%c%s' does not convert to an integer type\n",
-+ val, field, (neg_op) ? "!" : "", op, val);
-+ retval.valid= 0;
-+ goto STR_result_valid_0; /* ABORT */
-+ }
-+
-+ if (end == (char *)val)
-+ {
-+ DPRINTF(E_LOG, L_DAAP, "Value '%s' in clause '%s%s%c%s' does not represent an integer value\n",
-+ val, field, (neg_op) ? "!" : "", op, val);
-+ retval.valid= 0;
-+ goto STR_result_valid_0; /* ABORT */
-+ }
-+
-+ *end = '\0'; /* Cut out potential garbage - we're being kind */
-+
-+ /* forked-daapd only has media_kind = 1 for music - so remove media_kind = 32 to imporve select query performance. */
-+ if (llval == 32
-+ && (strcmp((char *)field, "com.apple.itunes.mediakind") == 0
-+ || strcmp((char *)field, "com.apple.itunes.extended-media-kind") == 0))
-+ {
-+ DPRINTF(E_DBG, L_DAAP, "Ignoring clause '%s%s%c%s'\n", field, (neg_op) ? "!" : "", op, val);
-+
-+ if (neg_op)
-+ retval.result->append8(retval.result, "1 = 1");
-+ else
-+ retval.result->append8(retval.result, "1 = 0");
-+
-+ goto STR_out;
-+ }
-+ }
-+ /* String field: escape string, check for '*' */
-+ else
-+ {
-+ if (op != ':')
-+ {
-+ DPRINTF(E_LOG, L_DAAP, "Operation '%c' not valid for string values\n", op);
-+ retval.valid= 0;
-+ goto STR_result_valid_0; /* ABORT */
-+ }
-+
-+ escaped = (pANTLR3_UINT8)db_escape_string((char *)val);
-+ if (!escaped)
-+ {
-+ DPRINTF(E_LOG, L_DAAP, "Could not escape value\n");
-+ retval.valid= 0;
-+ goto STR_result_valid_0; /* ABORT */
-+ }
-+
-+ val = escaped;
-+
-+ if (val[0] == '*')
-+ {
-+ op = '%';
-+ val[0] = '%';
-+ }
-+
-+ if (val[0] && val[1] && val[strlen((char *)val) - 1] == '*')
-+ {
-+ op = '%';
-+ val[strlen((char *)val) - 1] = '%';
-+ }
-+ }
-+
-+ retval.result->append8(retval.result, dqfm->db_col);
-+
-+ switch(op)
-+ {
-+ case ':':
-+ if (neg_op)
-+ retval.result->append8(retval.result, " <> ");
-+ else
-+ retval.result->append8(retval.result, " = ");
-+ break;
-+
-+ case '+':
-+ if (neg_op)
-+ retval.result->append8(retval.result, " <= ");
-+ else
-+ retval.result->append8(retval.result, " > ");
-+ break;
-+
-+ case '-':
-+ if (neg_op)
-+ retval.result->append8(retval.result, " >= ");
-+ else
-+ retval.result->append8(retval.result, " < ");
-+ break;
-+
-+ case '%':
-+ retval.result->append8(retval.result, " LIKE ");
-+ break;
-+
-+ default:
-+ if (neg_op)
-+ DPRINTF(E_LOG, L_DAAP, "Missing or unknown operator '%c' in clause '%s!%c%s'\n", op, field, op, val);
-+ else
-+ DPRINTF(E_LOG, L_DAAP, "Unknown operator '%c' in clause '%s%c%s'\n", op, field, op, val);
-+ retval.valid= 0;
-+ goto STR_result_valid_0; /* ABORT */
-+ break;
-+ }
-+
-+ if (!dqfm->as_int)
-+ retval.result->append8(retval.result, "'");
-+
-+ retval.result->append8(retval.result, (const char *)val);
-+
-+ if (!dqfm->as_int)
-+ retval.result->append8(retval.result, "'");
-+
-+ /* For empty string value, we need to check against NULL too */
-+ if ((*val == '\0') && (op == ':'))
-+ {
-+ if (neg_op)
-+ retval.result->append8(retval.result, " AND ");
-+ else
-+ retval.result->append8(retval.result, " OR ");
-+
-+ retval.result->append8(retval.result, dqfm->db_col);
-+
-+ if (neg_op)
-+ retval.result->append8(retval.result, " IS NOT NULL");
-+ else
-+ retval.result->append8(retval.result, " IS NULL");
-+
-+ retval.result->append8(retval.result, ")");
-+ }
-+
-+ STR_result_valid_0: /* bail out label */
-+ ;
-+
-+ if (escaped)
-+ free(escaped);
-+
-+ STR_out: /* get out of here */
-+ ;
-+
-+ }
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleexprEx; /* Prevent compiler warnings */
-+ ruleexprEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end expr */
-+/* End of parsing rules
-+ * ==============================================
-+ */
-+
-+/* ==============================================
-+ * Syntactic predicates
-+ */
-+/* End of syntactic predicates
-+ * ==============================================
-+ */
-+
-+
-+
-+
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/DAAP2SQL.h b/src/pregen/DAAP2SQL.h
-new file mode 100644
-index 0000000..e829049
---- /dev/null
-+++ b/src/pregen/DAAP2SQL.h
-@@ -0,0 +1,195 @@
-+/** \file
-+ * This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : DAAP2SQL.g
-+ * - On : 2016-01-01 12:23:43
-+ * - for the tree parser : DAAP2SQLTreeParser *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The tree parser DAAP2SQL has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ *
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pDAAP2SQL, which is returned from a call to DAAP2SQLNew().
-+ *
-+ * The methods in pDAAP2SQL are as follows:
-+ *
-+ * - pANTLR3_STRING pDAAP2SQL->query(pDAAP2SQL)
-+ * - DAAP2SQL_expr_return pDAAP2SQL->expr(pDAAP2SQL)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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 _DAAP2SQL_H
-+#define _DAAP2SQL_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct DAAP2SQL_Ctx_struct DAAP2SQL, * pDAAP2SQL;
-+
-+
-+
-+ #include <stdio.h>
-+ #include <stdlib.h>
-+ #include <string.h>
-+ #include <limits.h>
-+ #include <errno.h>
-+
-+ #include "logger.h"
-+ #include "db.h"
-+ #include "daap_query.h"
-+
-+
-+#ifdef ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter, - Rules with parameters that are not used
-+// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
-+// initialized but unused variable - tree rewrite variables declared but not needed
-+// Unreferenced local variable - lexer rule declares but does not always use _type
-+// potentially unitialized variable used - retval always returned from a rule
-+// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+typedef struct DAAP2SQL_expr_return_struct
-+{
-+ pANTLR3_BASE_TREE start;
-+ pANTLR3_BASE_TREE stop;
-+ pANTLR3_STRING result;
-+ int valid;
-+}
-+ DAAP2SQL_expr_return;
-+
-+
-+
-+/** Context tracking structure for DAAP2SQL
-+ */
-+struct DAAP2SQL_Ctx_struct
-+{
-+ /** Built in ANTLR3 context tracker contains all the generic elements
-+ * required for context tracking.
-+ */
-+ pANTLR3_TREE_PARSER pTreeParser;
-+
-+
-+ pANTLR3_STRING (*query) (struct DAAP2SQL_Ctx_struct * ctx);
-+ DAAP2SQL_expr_return (*expr) (struct DAAP2SQL_Ctx_struct * ctx);
-+ // Delegated rules
-+ const char * (*getGrammarFileName)();
-+ void (*free) (struct DAAP2SQL_Ctx_struct * ctx);
-+
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pDAAP2SQL DAAP2SQLNew (pANTLR3_COMMON_TREE_NODE_STREAM instream);
-+ANTLR3_API pDAAP2SQL DAAP2SQLNewSSD (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the tree parser will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef EOF
-+#undef EOF
-+#endif
-+#ifdef Tokens
-+#undef Tokens
-+#endif
-+#define STR 9
-+#define QUOTE 10
-+#define NEWLINE 4
-+#define LPAR 7
-+#define OPOR 5
-+#define RPAR 8
-+#define ESCAPED 11
-+#define OPAND 6
-+#define EOF -1
-+#ifdef EOF
-+#undef EOF
-+#define EOF ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for DAAP2SQL
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/DAAP2SQL.u b/src/pregen/DAAP2SQL.u
-new file mode 100644
-index 0000000..385d80b
---- /dev/null
-+++ b/src/pregen/DAAP2SQL.u
-@@ -0,0 +1,5 @@
-+DAAP2SQL.g: DAAP.tokens
-+DAAP2SQL.c : DAAP2SQL.g
-+./DAAP2SQL.tokens : DAAP2SQL.g
-+DAAP2SQL.h : DAAP2SQL.g
-+ANTLR_PRODUCTS += DAAP2SQL.c ./DAAP2SQL.tokens DAAP2SQL.h
-\ No newline at end of file
-diff --git a/src/pregen/DAAPLexer.c b/src/pregen/DAAPLexer.c
-new file mode 100644
-index 0000000..eab3ff4
---- /dev/null
-+++ b/src/pregen/DAAPLexer.c
-@@ -0,0 +1,1101 @@
-+/** \file
-+ * This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : DAAP.g
-+ * - On : 2016-01-01 12:23:41
-+ * - for the lexer : DAAPLexerLexer *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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.
-+
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include "DAAPLexer.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+
-+#define CTX ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef SCOPE_TYPE
-+#undef SCOPE_STACK
-+#undef SCOPE_TOP
-+#define SCOPE_TYPE(scope) pDAAPLexer_##scope##_SCOPE
-+#define SCOPE_STACK(scope) pDAAPLexer_##scope##Stack
-+#define SCOPE_TOP(scope) ctx->pDAAPLexer_##scope##Top
-+#define SCOPE_SIZE(scope) ctx->pDAAPLexer_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i) (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+
-+/* Macros for accessing things in a lexer
-+ */
-+#undef LEXER
-+#undef RECOGNIZER
-+#undef RULEMEMO
-+#undef GETCHARINDEX
-+#undef GETLINE
-+#undef GETCHARPOSITIONINLINE
-+#undef EMIT
-+#undef EMITNEW
-+#undef MATCHC
-+#undef MATCHS
-+#undef MATCHRANGE
-+#undef LTOKEN
-+#undef HASFAILED
-+#undef FAILEDFLAG
-+#undef INPUT
-+#undef STRSTREAM
-+#undef LA
-+#undef HASEXCEPTION
-+#undef EXCEPTION
-+#undef CONSTRUCTEX
-+#undef CONSUME
-+#undef LRECOVER
-+#undef MARK
-+#undef REWIND
-+#undef REWINDLAST
-+#undef BACKTRACKING
-+#undef MATCHANY
-+#undef MEMOIZE
-+#undef HAVEPARSEDRULE
-+#undef GETTEXT
-+#undef INDEX
-+#undef SEEK
-+#undef PUSHSTREAM
-+#undef POPSTREAM
-+#undef SETTEXT
-+#undef SETTEXT8
-+
-+#define LEXER ctx->pLexer
-+#define RECOGNIZER LEXER->rec
-+#define LEXSTATE RECOGNIZER->state
-+#define TOKSOURCE LEXSTATE->tokSource
-+#define GETCHARINDEX() LEXER->getCharIndex(LEXER)
-+#define GETLINE() LEXER->getLine(LEXER)
-+#define GETTEXT() LEXER->getText(LEXER)
-+#define GETCHARPOSITIONINLINE() LEXER->getCharPositionInLine(LEXER)
-+#define EMIT() LEXSTATE->type = _type; LEXER->emit(LEXER)
-+#define EMITNEW(t) LEXER->emitNew(LEXER, t)
-+#define MATCHC(c) LEXER->matchc(LEXER, c)
-+#define MATCHS(s) LEXER->matchs(LEXER, s)
-+#define MATCHRANGE(c1,c2) LEXER->matchRange(LEXER, c1, c2)
-+#define MATCHANY() LEXER->matchAny(LEXER)
-+#define LTOKEN LEXSTATE->token
-+#define HASFAILED() (LEXSTATE->failed == ANTLR3_TRUE)
-+#define BACKTRACKING LEXSTATE->backtracking
-+#define FAILEDFLAG LEXSTATE->failed
-+#define INPUT LEXER->input
-+#define STRSTREAM INPUT
-+#define ISTREAM INPUT->istream
-+#define INDEX() ISTREAM->index(ISTREAM)
-+#define SEEK(n) ISTREAM->seek(ISTREAM, n)
-+#define EOF_TOKEN &(LEXSTATE->tokSource->eofToken)
-+#define HASEXCEPTION() (LEXSTATE->error == ANTLR3_TRUE)
-+#define EXCEPTION LEXSTATE->exception
-+#define CONSTRUCTEX() RECOGNIZER->exConstruct(RECOGNIZER)
-+#define LRECOVER() LEXER->recover(LEXER)
-+#define MARK() ISTREAM->mark(ISTREAM)
-+#define REWIND(m) ISTREAM->rewind(ISTREAM, m)
-+#define REWINDLAST() ISTREAM->rewindLast(ISTREAM)
-+#define MEMOIZE(ri,si) RECOGNIZER->memoize(RECOGNIZER, ri, si)
-+#define HAVEPARSEDRULE(r) RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define PUSHSTREAM(str) LEXER->pushCharStream(LEXER, str)
-+#define POPSTREAM() LEXER->popCharStream(LEXER)
-+#define SETTEXT(str) LEXSTATE->text = str
-+#define SKIP() LEXSTATE->token = &(TOKSOURCE->skipToken)
-+#define USER1 LEXSTATE->user1
-+#define USER2 LEXSTATE->user2
-+#define USER3 LEXSTATE->user3
-+#define CUSTOM LEXSTATE->custom
-+#define RULEMEMO LEXSTATE->ruleMemo
-+#define DBG RECOGNIZER->debugger
-+
-+/* If we have been told we can rely on the standard 8 bit or 16 bit input
-+ * stream, then we can define our macros to use the direct pointers
-+ * in the input object, which is much faster than indirect calls. This
-+ * is really only significant to lexers with a lot of fragment rules (which
-+ * do not place LA(1) in a temporary at the moment) and even then
-+ * only if there is a lot of input (order of say 1M or so).
-+ */
-+#if defined(ANTLR3_INLINE_INPUT_ASCII) || defined(ANTLR3_INLINE_INPUT_UTF16)
-+
-+# ifdef ANTLR3_INLINE_INPUT_ASCII
-+
-+/* 8 bit "ASCII" (actually any 8 bit character set) */
-+
-+# define NEXTCHAR ((pANTLR3_UINT8)(INPUT->nextChar))
-+# define DATAP ((pANTLR3_UINT8)(INPUT->data))
-+
-+# else
-+
-+# define NEXTCHAR ((pANTLR3_UINT16)(INPUT->nextChar))
-+# define DATAP ((pANTLR3_UINT16)(INPUT->data))
-+
-+# endif
-+
-+# define LA(n) ((NEXTCHAR + n) > (DATAP + INPUT->sizeBuf) ? ANTLR3_CHARSTREAM_EOF : (ANTLR3_UCHAR)(*(NEXTCHAR + n - 1)))
-+# define CONSUME() \
-+{ \
-+ if (NEXTCHAR < (DATAP + INPUT->sizeBuf)) \
-+ { \
-+ INPUT->charPositionInLine++; \
-+ if ((ANTLR3_UCHAR)(*NEXTCHAR) == INPUT->newlineChar) \
-+ { \
-+ INPUT->line++; \
-+ INPUT->charPositionInLine = 0; \
-+ INPUT->currentLine = (void *)(NEXTCHAR + 1); \
-+ } \
-+ INPUT->nextChar = (void *)(NEXTCHAR + 1); \
-+ } \
-+}
-+
-+#else
-+
-+// Pick up the input character by calling the input stream implementation.
-+//
-+#define CONSUME() INPUT->istream->consume(INPUT->istream)
-+#define LA(n) INPUT->istream->_LA(INPUT->istream, n)
-+
-+#endif
-+#define TOKTEXT(tok, txt) tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define UP ANTLR3_TOKEN_UP
-+#define DOWN ANTLR3_TOKEN_DOWN
-+#define EOR ANTLR3_TOKEN_EOR
-+#define INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+/* Forward declare the locally static matching functions we have generated and any predicate functions.
-+ */
-+static ANTLR3_INLINE void mQUOTE (pDAAPLexer ctx);
-+static ANTLR3_INLINE void mLPAR (pDAAPLexer ctx);
-+static ANTLR3_INLINE void mRPAR (pDAAPLexer ctx);
-+static ANTLR3_INLINE void mOPAND (pDAAPLexer ctx);
-+static ANTLR3_INLINE void mOPOR (pDAAPLexer ctx);
-+static ANTLR3_INLINE void mNEWLINE (pDAAPLexer ctx);
-+static ANTLR3_INLINE void mSTR (pDAAPLexer ctx);
-+static ANTLR3_INLINE void mESCAPED (pDAAPLexer ctx);
-+static ANTLR3_INLINE void mTokens (pDAAPLexer ctx);
-+static void DAAPLexerFree(pDAAPLexer ctx);
-+
-+/* =========================================================================
-+ * Lexer matching rules end.
-+ * =========================================================================
-+ */
-+
-+
-+
-+static void
-+DAAPLexerFree (pDAAPLexer ctx)
-+{
-+ LEXER->free(LEXER);
-+
-+ ANTLR3_FREE(ctx);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "DAAP.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+ return fileName;
-+}
-+
-+/** \brief Create a new lexer called DAAPLexer
-+ *
-+ * \param[in] instream Pointer to an initialized input stream
-+ * \return
-+ * - Success pDAAPLexer initialized for the lex start
-+ * - Fail NULL
-+ */
-+ANTLR3_API pDAAPLexer DAAPLexerNew
-+(pANTLR3_INPUT_STREAM instream)
-+{
-+ // See if we can create a new lexer with the standard constructor
-+ //
-+ return DAAPLexerNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new lexer called DAAPLexer
-+ *
-+ * \param[in] instream Pointer to an initialized input stream
-+ * \param[state] state Previously created shared recognizer stat
-+ * \return
-+ * - Success pDAAPLexer initialized for the lex start
-+ * - Fail NULL
-+ */
-+ANTLR3_API pDAAPLexer DAAPLexerNewSSD
-+(pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+ pDAAPLexer ctx; // Context structure we will build and return
-+
-+ ctx = (pDAAPLexer) ANTLR3_CALLOC(1, sizeof(DAAPLexer));
-+
-+ if (ctx == NULL)
-+ {
-+ // Failed to allocate memory for lexer context
-+ return NULL;
-+ }
-+
-+ /* -------------------------------------------------------------------
-+ * Memory for basic structure is allocated, now to fill in
-+ * in base ANTLR3 structures. We initialize the function pointers
-+ * for the standard ANTLR3 lexer function set, but upon return
-+ * from here, the programmer may set the pointers to provide custom
-+ * implementations of each function.
-+ *
-+ * We don't use the macros defined in DAAPLexer.h here so you can get a sense
-+ * of what goes where.
-+ */
-+
-+ /* Create a base lexer, using the supplied input stream
-+ */
-+ ctx->pLexer = antlr3LexerNewStream(ANTLR3_SIZE_HINT, instream, state);
-+
-+ /* Check that we allocated the memory correctly
-+ */
-+ if (ctx->pLexer == NULL)
-+ {
-+ ANTLR3_FREE(ctx);
-+ return NULL;
-+ }
-+ /* Install the implementation of our DAAPLexer interface
-+ */
-+ ctx->mQUOTE = mQUOTE;
-+ ctx->mLPAR = mLPAR;
-+ ctx->mRPAR = mRPAR;
-+ ctx->mOPAND = mOPAND;
-+ ctx->mOPOR = mOPOR;
-+ ctx->mNEWLINE = mNEWLINE;
-+ ctx->mSTR = mSTR;
-+ ctx->mESCAPED = mESCAPED;
-+ ctx->mTokens = mTokens;
-+
-+ /** When the nextToken() call is made to this lexer's pANTLR3_TOKEN_SOURCE
-+ * it will call mTokens() in this generated code, and will pass it the ctx
-+ * pointer of this lexer, not the context of the base lexer, so store that now.
-+ */
-+ ctx->pLexer->ctx = ctx;
-+
-+ /**Install the token matching function
-+ */
-+ ctx->pLexer->mTokens = (void (*) (void *))(mTokens);
-+
-+ ctx->getGrammarFileName = getGrammarFileName;
-+ ctx->free = DAAPLexerFree;
-+
-+
-+
-+
-+
-+ /* Return the newly built lexer to the caller
-+ */
-+ return ctx;
-+}
-+
-+
-+/* =========================================================================
-+ * Functions to match the lexer grammar defined tokens from the input stream
-+ */
-+
-+// Comes from: 40:7: ( '\\'' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start QUOTE
-+ *
-+ * Looks to match the characters the constitute the token QUOTE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mQUOTE(pDAAPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = QUOTE;
-+
-+
-+ // DAAP.g:40:7: ( '\\'' )
-+ // DAAP.g:40:9: '\\''
-+ {
-+ MATCHC('\'');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleQUOTEEx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleQUOTEEx; /* Prevent compiler warnings */
-+ ruleQUOTEEx: ;
-+
-+}
-+// $ANTLR end QUOTE
-+
-+// Comes from: 41:6: ( '(' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LPAR
-+ *
-+ * Looks to match the characters the constitute the token LPAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLPAR(pDAAPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = LPAR;
-+
-+
-+ // DAAP.g:41:6: ( '(' )
-+ // DAAP.g:41:8: '('
-+ {
-+ MATCHC('(');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleLPAREx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleLPAREx; /* Prevent compiler warnings */
-+ ruleLPAREx: ;
-+
-+}
-+// $ANTLR end LPAR
-+
-+// Comes from: 42:6: ( ')' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start RPAR
-+ *
-+ * Looks to match the characters the constitute the token RPAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mRPAR(pDAAPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = RPAR;
-+
-+
-+ // DAAP.g:42:6: ( ')' )
-+ // DAAP.g:42:8: ')'
-+ {
-+ MATCHC(')');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleRPAREx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleRPAREx; /* Prevent compiler warnings */
-+ ruleRPAREx: ;
-+
-+}
-+// $ANTLR end RPAR
-+
-+// Comes from: 44:7: ( '+' | ' ' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start OPAND
-+ *
-+ * Looks to match the characters the constitute the token OPAND
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mOPAND(pDAAPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = OPAND;
-+
-+
-+ // DAAP.g:44:7: ( '+' | ' ' )
-+ // DAAP.g:
-+ {
-+ if ( LA(1) == ' ' || LA(1) == '+' )
-+ {
-+ CONSUME();
-+
-+ }
-+ else
-+ {
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+ LRECOVER(); goto ruleOPANDEx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleOPANDEx; /* Prevent compiler warnings */
-+ ruleOPANDEx: ;
-+
-+}
-+// $ANTLR end OPAND
-+
-+// Comes from: 45:6: ( ',' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start OPOR
-+ *
-+ * Looks to match the characters the constitute the token OPOR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mOPOR(pDAAPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = OPOR;
-+
-+
-+ // DAAP.g:45:6: ( ',' )
-+ // DAAP.g:45:8: ','
-+ {
-+ MATCHC(',');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleOPOREx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleOPOREx; /* Prevent compiler warnings */
-+ ruleOPOREx: ;
-+
-+}
-+// $ANTLR end OPOR
-+
-+// Comes from: 47:9: ( ( '\\r' )? '\\n' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start NEWLINE
-+ *
-+ * Looks to match the characters the constitute the token NEWLINE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mNEWLINE(pDAAPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = NEWLINE;
-+
-+
-+ // DAAP.g:47:9: ( ( '\\r' )? '\\n' )
-+ // DAAP.g:47:11: ( '\\r' )? '\\n'
-+ {
-+
-+ // DAAP.g:47:11: ( '\\r' )?
-+ {
-+ int alt1=2;
-+ switch ( LA(1) )
-+ {
-+ case '\r':
-+ {
-+ alt1=1;
-+ }
-+ break;
-+ }
-+
-+ switch (alt1)
-+ {
-+ case 1:
-+ // DAAP.g:47:11: '\\r'
-+ {
-+ MATCHC('\r');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleNEWLINEEx;
-+ }
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ MATCHC('\n');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleNEWLINEEx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleNEWLINEEx; /* Prevent compiler warnings */
-+ ruleNEWLINEEx: ;
-+
-+}
-+// $ANTLR end NEWLINE
-+
-+// Comes from: 55:2: ( QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start STR
-+ *
-+ * Looks to match the characters the constitute the token STR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mSTR(pDAAPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+ pANTLR3_COMMON_TOKEN esc;
-+ ANTLR3_UINT32 reg;
-+
-+
-+ esc = NULL;
-+
-+ _type = STR;
-+
-+ pANTLR3_STRING unesc = GETTEXT()->factory->newRaw(GETTEXT()->factory);
-+
-+ // DAAP.g:55:2: ( QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE )
-+ // DAAP.g:55:4: QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE
-+ {
-+ /* 55:4: QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE */
-+ mQUOTE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTREx;
-+ }
-+
-+ // DAAP.g:55:10: (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+
-+ {
-+ int cnt2=0;
-+
-+ for (;;)
-+ {
-+ int alt2=3;
-+ {
-+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
-+ */
-+ int LA2_0 = LA(1);
-+ if ( (((LA2_0 >= 0x0000) && (LA2_0 <= '&')) || ((LA2_0 >= '(') && (LA2_0 <= '[')) || ((LA2_0 >= ']') && (LA2_0 <= 0xFFFF))) )
-+ {
-+ alt2=1;
-+ }
-+ else if ( (LA2_0 == '\\') )
-+ {
-+ alt2=2;
-+ }
-+
-+ }
-+ switch (alt2)
-+ {
-+ case 1:
-+ // DAAP.g:55:12: reg=~ ( '\\\\' | '\\'' )
-+ {
-+ reg= LA(1);
-+ if ( ((LA(1) >= 0x0000) && (LA(1) <= '&')) || ((LA(1) >= '(') && (LA(1) <= '[')) || ((LA(1) >= ']') && (LA(1) <= 0xFFFF)) )
-+ {
-+ CONSUME();
-+
-+ }
-+ else
-+ {
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+ LRECOVER(); goto ruleSTREx;
-+ }
-+
-+ {
-+ unesc->addc(unesc, reg);
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // DAAP.g:56:6: esc= ESCAPED
-+ {
-+ /* 56:6: esc= ESCAPED */
-+ {
-+ ANTLR3_MARKER escStart118 = GETCHARINDEX();
-+ mESCAPED(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTREx;
-+ }
-+
-+ esc = LEXSTATE->tokFactory->newToken(LEXSTATE->tokFactory);
-+ esc->setType(esc, ANTLR3_TOKEN_INVALID);
-+ esc->setStartIndex(esc, escStart118);
-+ esc->setStopIndex(esc, GETCHARINDEX()-1);
-+ esc->input = INPUT;
-+ }
-+ {
-+ unesc->appendS(unesc, GETTEXT());
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+
-+ if ( cnt2 >= 1 )
-+ {
-+ goto loop2;
-+ }
-+ /* mismatchedSetEx()
-+ */
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
-+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
-+
-+
-+ goto ruleSTREx;
-+ }
-+ cnt2++;
-+ }
-+ loop2: ; /* Jump to here if this rule does not match */
-+ }
-+ /* 55:4: QUOTE (reg=~ ( '\\\\' | '\\'' ) | esc= ESCAPED )+ QUOTE */
-+ mQUOTE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTREx;
-+ }
-+
-+ {
-+ SETTEXT(unesc);
-+ }
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleSTREx; /* Prevent compiler warnings */
-+ ruleSTREx: ;
-+
-+ esc = NULL;
-+
-+}
-+// $ANTLR end STR
-+
-+// Comes from: 59:9: ( '\\\\' ( '\\\\' | '\\'' ) )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start ESCAPED
-+ *
-+ * Looks to match the characters the constitute the token ESCAPED
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mESCAPED(pDAAPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+
-+ // DAAP.g:59:9: ( '\\\\' ( '\\\\' | '\\'' ) )
-+ // DAAP.g:59:11: '\\\\' ( '\\\\' | '\\'' )
-+ {
-+ MATCHC('\\');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleESCAPEDEx;
-+ }
-+
-+
-+ // DAAP.g:60:3: ( '\\\\' | '\\'' )
-+ {
-+ int alt3=2;
-+ switch ( LA(1) )
-+ {
-+ case '\\':
-+ {
-+ alt3=1;
-+ }
-+ break;
-+ case '\'':
-+ {
-+ alt3=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleESCAPEDEx;
-+ }
-+
-+ switch (alt3)
-+ {
-+ case 1:
-+ // DAAP.g:60:5: '\\\\'
-+ {
-+ MATCHC('\\');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleESCAPEDEx;
-+ }
-+
-+ {
-+ SETTEXT(GETTEXT()->factory->newStr8(GETTEXT()->factory, (pANTLR3_UINT8)"\\"));
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // DAAP.g:61:5: '\\''
-+ {
-+ MATCHC('\'');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleESCAPEDEx;
-+ }
-+
-+ {
-+ SETTEXT(GETTEXT()->factory->newStr8(GETTEXT()->factory, (pANTLR3_UINT8)"\'"));
-+ }
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+
-+ }
-+
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleESCAPEDEx; /* Prevent compiler warnings */
-+ ruleESCAPEDEx: ;
-+
-+}
-+// $ANTLR end ESCAPED
-+
-+/** This is the entry point in to the lexer from an object that
-+ * wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
-+ */
-+static void
-+mTokens(pDAAPLexer ctx)
-+{
-+ {
-+ // DAAP.g:1:8: ( QUOTE | LPAR | RPAR | OPAND | OPOR | NEWLINE | STR )
-+
-+ ANTLR3_UINT32 alt4;
-+
-+ alt4=7;
-+
-+ switch ( LA(1) )
-+ {
-+ case '\'':
-+ {
-+
-+ {
-+ int LA4_1 = LA(2);
-+ if ( (((LA4_1 >= 0x0000) && (LA4_1 <= '&')) || ((LA4_1 >= '(') && (LA4_1 <= 0xFFFF))) )
-+ {
-+ alt4=7;
-+ }
-+ else
-+ {
-+ alt4=1; }
-+ }
-+ }
-+ break;
-+ case '(':
-+ {
-+ alt4=2;
-+ }
-+ break;
-+ case ')':
-+ {
-+ alt4=3;
-+ }
-+ break;
-+ case ' ':
-+ case '+':
-+ {
-+ alt4=4;
-+ }
-+ break;
-+ case ',':
-+ {
-+ alt4=5;
-+ }
-+ break;
-+ case '\n':
-+ case '\r':
-+ {
-+ alt4=6;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ switch (alt4)
-+ {
-+ case 1:
-+ // DAAP.g:1:10: QUOTE
-+ {
-+ /* 1:10: QUOTE */
-+ mQUOTE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // DAAP.g:1:16: LPAR
-+ {
-+ /* 1:16: LPAR */
-+ mLPAR(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // DAAP.g:1:21: RPAR
-+ {
-+ /* 1:21: RPAR */
-+ mRPAR(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // DAAP.g:1:26: OPAND
-+ {
-+ /* 1:26: OPAND */
-+ mOPAND(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 5:
-+ // DAAP.g:1:32: OPOR
-+ {
-+ /* 1:32: OPOR */
-+ mOPOR(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 6:
-+ // DAAP.g:1:37: NEWLINE
-+ {
-+ /* 1:37: NEWLINE */
-+ mNEWLINE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 7:
-+ // DAAP.g:1:45: STR
-+ {
-+ /* 1:45: STR */
-+ mSTR(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+
-+
-+ goto ruleTokensEx; /* Prevent compiler warnings */
-+ruleTokensEx: ;
-+}
-+
-+/* =========================================================================
-+ * Lexer matching rules end.
-+ * =========================================================================
-+ */
-+/* End of Lexer code
-+ * ================================================
-+ * ================================================
-+ */
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/DAAPLexer.h b/src/pregen/DAAPLexer.h
-new file mode 100644
-index 0000000..685a0bc
---- /dev/null
-+++ b/src/pregen/DAAPLexer.h
-@@ -0,0 +1,188 @@
-+/** \file
-+ * This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : DAAP.g
-+ * - On : 2016-01-01 12:23:41
-+ * - for the lexer : DAAPLexerLexer *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The lexer DAAPLexer has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ *
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pDAAPLexer, which is returned from a call to DAAPLexerNew().
-+ *
-+ * As this is a generated lexer, it is unlikely you will call it 'manually'. However
-+ * the methods are provided anyway.
-+ * * The methods in pDAAPLexer are as follows:
-+ *
-+ * - void pDAAPLexer->QUOTE(pDAAPLexer)
-+ * - void pDAAPLexer->LPAR(pDAAPLexer)
-+ * - void pDAAPLexer->RPAR(pDAAPLexer)
-+ * - void pDAAPLexer->OPAND(pDAAPLexer)
-+ * - void pDAAPLexer->OPOR(pDAAPLexer)
-+ * - void pDAAPLexer->NEWLINE(pDAAPLexer)
-+ * - void pDAAPLexer->STR(pDAAPLexer)
-+ * - void pDAAPLexer->ESCAPED(pDAAPLexer)
-+ * - void pDAAPLexer->Tokens(pDAAPLexer)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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 _DAAPLexer_H
-+#define _DAAPLexer_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct DAAPLexer_Ctx_struct DAAPLexer, * pDAAPLexer;
-+
-+
-+
-+#ifdef ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter, - Rules with parameters that are not used
-+// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
-+// initialized but unused variable - tree rewrite variables declared but not needed
-+// Unreferenced local variable - lexer rule declares but does not always use _type
-+// potentially unitialized variable used - retval always returned from a rule
-+// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+
-+/** Context tracking structure for DAAPLexer
-+ */
-+struct DAAPLexer_Ctx_struct
-+{
-+ /** Built in ANTLR3 context tracker contains all the generic elements
-+ * required for context tracking.
-+ */
-+ pANTLR3_LEXER pLexer;
-+
-+
-+ void (*mQUOTE) (struct DAAPLexer_Ctx_struct * ctx);
-+ void (*mLPAR) (struct DAAPLexer_Ctx_struct * ctx);
-+ void (*mRPAR) (struct DAAPLexer_Ctx_struct * ctx);
-+ void (*mOPAND) (struct DAAPLexer_Ctx_struct * ctx);
-+ void (*mOPOR) (struct DAAPLexer_Ctx_struct * ctx);
-+ void (*mNEWLINE) (struct DAAPLexer_Ctx_struct * ctx);
-+ void (*mSTR) (struct DAAPLexer_Ctx_struct * ctx);
-+ void (*mESCAPED) (struct DAAPLexer_Ctx_struct * ctx);
-+ void (*mTokens) (struct DAAPLexer_Ctx_struct * ctx); const char * (*getGrammarFileName)();
-+ void (*free) (struct DAAPLexer_Ctx_struct * ctx);
-+
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pDAAPLexer DAAPLexerNew (pANTLR3_INPUT_STREAM instream);
-+ANTLR3_API pDAAPLexer DAAPLexerNewSSD (pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the lexer will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef EOF
-+#undef EOF
-+#endif
-+#ifdef Tokens
-+#undef Tokens
-+#endif
-+#define STR 9
-+#define QUOTE 10
-+#define NEWLINE 4
-+#define LPAR 7
-+#define OPOR 5
-+#define RPAR 8
-+#define ESCAPED 11
-+#define OPAND 6
-+#define EOF -1
-+#ifdef EOF
-+#undef EOF
-+#define EOF ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for DAAPLexer
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/DAAPParser.c b/src/pregen/DAAPParser.c
-new file mode 100644
-index 0000000..1091f05
---- /dev/null
-+++ b/src/pregen/DAAPParser.c
-@@ -0,0 +1,1014 @@
-+/** \file
-+ * This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : DAAP.g
-+ * - On : 2016-01-01 12:23:41
-+ * - for the parser : DAAPParserParser *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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.
-+
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include "DAAPParser.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+
-+#define CTX ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef SCOPE_TYPE
-+#undef SCOPE_STACK
-+#undef SCOPE_TOP
-+#define SCOPE_TYPE(scope) pDAAPParser_##scope##_SCOPE
-+#define SCOPE_STACK(scope) pDAAPParser_##scope##Stack
-+#define SCOPE_TOP(scope) ctx->pDAAPParser_##scope##Top
-+#define SCOPE_SIZE(scope) ctx->pDAAPParser_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i) (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+/* Macros for accessing things in the parser
-+ */
-+
-+#undef PARSER
-+#undef RECOGNIZER
-+#undef HAVEPARSEDRULE
-+#undef MEMOIZE
-+#undef INPUT
-+#undef STRSTREAM
-+#undef HASEXCEPTION
-+#undef EXCEPTION
-+#undef MATCHT
-+#undef MATCHANYT
-+#undef FOLLOWSTACK
-+#undef FOLLOWPUSH
-+#undef FOLLOWPOP
-+#undef PRECOVER
-+#undef PREPORTERROR
-+#undef LA
-+#undef LT
-+#undef CONSTRUCTEX
-+#undef CONSUME
-+#undef MARK
-+#undef REWIND
-+#undef REWINDLAST
-+#undef PERRORRECOVERY
-+#undef HASFAILED
-+#undef FAILEDFLAG
-+#undef RECOVERFROMMISMATCHEDSET
-+#undef RECOVERFROMMISMATCHEDELEMENT
-+#undef INDEX
-+#undef ADAPTOR
-+#undef SEEK
-+#undef RULEMEMO
-+#undef DBG
-+
-+#define PARSER ctx->pParser
-+#define RECOGNIZER PARSER->rec
-+#define PSRSTATE RECOGNIZER->state
-+#define HAVEPARSEDRULE(r) RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define MEMOIZE(ri,si) RECOGNIZER->memoize(RECOGNIZER, ri, si)
-+#define INPUT PARSER->tstream
-+#define STRSTREAM INPUT
-+#define ISTREAM INPUT->istream
-+#define INDEX() ISTREAM->index(INPUT->istream)
-+#define HASEXCEPTION() (PSRSTATE->error == ANTLR3_TRUE)
-+#define EXCEPTION PSRSTATE->exception
-+#define MATCHT(t, fs) RECOGNIZER->match(RECOGNIZER, t, fs)
-+#define MATCHANYT() RECOGNIZER->matchAny(RECOGNIZER)
-+#define FOLLOWSTACK PSRSTATE->following
-+#define FOLLOWPUSH(x) FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
-+#define FOLLOWPOP() FOLLOWSTACK->pop(FOLLOWSTACK)
-+#define PRECOVER() RECOGNIZER->recover(RECOGNIZER)
-+#define PREPORTERROR() RECOGNIZER->reportError(RECOGNIZER)
-+#define LA(n) INPUT->istream->_LA(ISTREAM, n)
-+#define LT(n) INPUT->_LT(INPUT, n)
-+#define CONSTRUCTEX() RECOGNIZER->exConstruct(RECOGNIZER)
-+#define CONSUME() ISTREAM->consume(ISTREAM)
-+#define MARK() ISTREAM->mark(ISTREAM)
-+#define REWIND(m) ISTREAM->rewind(ISTREAM, m)
-+#define REWINDLAST() ISTREAM->rewindLast(ISTREAM)
-+#define SEEK(n) ISTREAM->seek(ISTREAM, n)
-+#define PERRORRECOVERY PSRSTATE->errorRecovery
-+#define FAILEDFLAG PSRSTATE->failed
-+#define HASFAILED() (FAILEDFLAG == ANTLR3_TRUE)
-+#define BACKTRACKING PSRSTATE->backtracking
-+#define RECOVERFROMMISMATCHEDSET(s) RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
-+#define RECOVERFROMMISMATCHEDELEMENT(e) RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
-+#define ADAPTOR ctx->adaptor
-+#define RULEMEMO PSRSTATE->ruleMemo
-+#define DBG RECOGNIZER->debugger
-+
-+#define TOKTEXT(tok, txt) tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define UP ANTLR3_TOKEN_UP
-+#define DOWN ANTLR3_TOKEN_DOWN
-+#define EOR ANTLR3_TOKEN_EOR
-+#define INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+
-+/** \brief Table of all token names in symbolic order, mainly used for
-+ * error reporting.
-+ */
-+pANTLR3_UINT8 DAAPParserTokenNames[8+4]
-+ = {
-+ (pANTLR3_UINT8) "<invalid>", /* String to print to indicate an invalid token */
-+ (pANTLR3_UINT8) "<EOR>",
-+ (pANTLR3_UINT8) "<DOWN>",
-+ (pANTLR3_UINT8) "<UP>",
-+ (pANTLR3_UINT8) "NEWLINE",
-+ (pANTLR3_UINT8) "OPOR",
-+ (pANTLR3_UINT8) "OPAND",
-+ (pANTLR3_UINT8) "LPAR",
-+ (pANTLR3_UINT8) "RPAR",
-+ (pANTLR3_UINT8) "STR",
-+ (pANTLR3_UINT8) "QUOTE",
-+ (pANTLR3_UINT8) "ESCAPED"
-+ };
-+
-+
-+
-+// Forward declare the locally static matching functions we have generated.
-+//
-+static DAAPParser_query_return query (pDAAPParser ctx);
-+static DAAPParser_expr_return expr (pDAAPParser ctx);
-+static DAAPParser_aexpr_return aexpr (pDAAPParser ctx);
-+static DAAPParser_crit_return crit (pDAAPParser ctx);
-+static void DAAPParserFree(pDAAPParser ctx);
-+/* For use in tree output where we are accumulating rule labels via label += ruleRef
-+ * we need a function that knows how to free a return scope when the list is destroyed.
-+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
-+ */
-+static void ANTLR3_CDECL freeScope(void * scope)
-+{
-+ ANTLR3_FREE(scope);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "DAAP.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+ return fileName;
-+}
-+/** \brief Create a new DAAPParser parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pDAAPParser
-+DAAPParserNew (pANTLR3_COMMON_TOKEN_STREAM instream)
-+{
-+ // See if we can create a new parser with the standard constructor
-+ //
-+ return DAAPParserNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new DAAPParser parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pDAAPParser
-+DAAPParserNewSSD (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+ pDAAPParser ctx; /* Context structure we will build and return */
-+
-+ ctx = (pDAAPParser) ANTLR3_CALLOC(1, sizeof(DAAPParser));
-+
-+ if (ctx == NULL)
-+ {
-+ // Failed to allocate memory for parser context
-+ //
-+ return NULL;
-+ }
-+
-+ /* -------------------------------------------------------------------
-+ * Memory for basic structure is allocated, now to fill in
-+ * the base ANTLR3 structures. We initialize the function pointers
-+ * for the standard ANTLR3 parser function set, but upon return
-+ * from here, the programmer may set the pointers to provide custom
-+ * implementations of each function.
-+ *
-+ * We don't use the macros defined in DAAPParser.h here, in order that you can get a sense
-+ * of what goes where.
-+ */
-+
-+ /* Create a base parser/recognizer, using the supplied token stream
-+ */
-+ ctx->pParser = antlr3ParserNewStream(ANTLR3_SIZE_HINT, instream->tstream, state);
-+ /* Install the implementation of our DAAPParser interface
-+ */
-+ ctx->query = query;
-+ ctx->expr = expr;
-+ ctx->aexpr = aexpr;
-+ ctx->crit = crit;
-+ ctx->free = DAAPParserFree;
-+ ctx->getGrammarFileName = getGrammarFileName;
-+
-+ /* Install the scope pushing methods.
-+ */
-+ ADAPTOR = ANTLR3_TREE_ADAPTORNew(instream->tstream->tokenSource->strFactory);
-+ ctx->vectors = antlr3VectorFactoryNew(0);
-+
-+
-+
-+ /* Install the token table
-+ */
-+ PSRSTATE->tokenNames = DAAPParserTokenNames;
-+
-+
-+ /* Return the newly built parser to the caller
-+ */
-+ return ctx;
-+}
-+
-+/** Free the parser resources
-+ */
-+ static void
-+ DAAPParserFree(pDAAPParser ctx)
-+ {
-+ /* Free any scope memory
-+ */
-+
-+ ctx->vectors->close(ctx->vectors);
-+ /* We created the adaptor so we must free it
-+ */
-+ ADAPTOR->free(ADAPTOR);
-+ // Free this parser
-+ //
-+ ctx->pParser->free(ctx->pParser);
-+ ANTLR3_FREE(ctx);
-+
-+ /* Everything is released, so we can return
-+ */
-+ return;
-+ }
-+
-+/** Return token names used by this parser
-+ *
-+ * The returned pointer is used as an index into the token names table (using the token
-+ * number as the index).
-+ *
-+ * \return Pointer to first char * in the table.
-+ */
-+static pANTLR3_UINT8 *getTokenNames()
-+{
-+ return DAAPParserTokenNames;
-+}
-+
-+
-+/* Declare the bitsets
-+ */
-+
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_query42 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_query42_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_query42 = { FOLLOW_expr_in_query42_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NEWLINE_in_query44 */
-+static ANTLR3_BITWORD FOLLOW_NEWLINE_in_query44_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000) };
-+static ANTLR3_BITSET_LIST FOLLOW_NEWLINE_in_query44 = { FOLLOW_NEWLINE_in_query44_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_query47 */
-+static ANTLR3_BITWORD FOLLOW_EOF_in_query47_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_EOF_in_query47 = { FOLLOW_EOF_in_query47_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expr62 */
-+static ANTLR3_BITWORD FOLLOW_aexpr_in_expr62_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000022) };
-+static ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expr62 = { FOLLOW_aexpr_in_expr62_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OPOR_in_expr65 */
-+static ANTLR3_BITWORD FOLLOW_OPOR_in_expr65_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000280) };
-+static ANTLR3_BITSET_LIST FOLLOW_OPOR_in_expr65 = { FOLLOW_OPOR_in_expr65_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expr68 */
-+static ANTLR3_BITWORD FOLLOW_aexpr_in_expr68_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000022) };
-+static ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expr68 = { FOLLOW_aexpr_in_expr68_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_aexpr80 */
-+static ANTLR3_BITWORD FOLLOW_crit_in_aexpr80_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000042) };
-+static ANTLR3_BITSET_LIST FOLLOW_crit_in_aexpr80 = { FOLLOW_crit_in_aexpr80_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OPAND_in_aexpr83 */
-+static ANTLR3_BITWORD FOLLOW_OPAND_in_aexpr83_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000280) };
-+static ANTLR3_BITSET_LIST FOLLOW_OPAND_in_aexpr83 = { FOLLOW_OPAND_in_aexpr83_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_aexpr86 */
-+static ANTLR3_BITWORD FOLLOW_crit_in_aexpr86_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000042) };
-+static ANTLR3_BITSET_LIST FOLLOW_crit_in_aexpr86 = { FOLLOW_crit_in_aexpr86_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAR_in_crit98 */
-+static ANTLR3_BITWORD FOLLOW_LPAR_in_crit98_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000280) };
-+static ANTLR3_BITSET_LIST FOLLOW_LPAR_in_crit98 = { FOLLOW_LPAR_in_crit98_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_crit100 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_crit100_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000100) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_crit100 = { FOLLOW_expr_in_crit100_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAR_in_crit102 */
-+static ANTLR3_BITWORD FOLLOW_RPAR_in_crit102_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_RPAR_in_crit102 = { FOLLOW_RPAR_in_crit102_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_crit112 */
-+static ANTLR3_BITWORD FOLLOW_STR_in_crit112_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_STR_in_crit112 = { FOLLOW_STR_in_crit112_bits, 1 };
-+
-+
-+
-+
-+/* ==============================================
-+ * Parsing rules
-+ */
-+/**
-+ * $ANTLR start query
-+ * DAAP.g:27:1: query : expr ( NEWLINE )? EOF -> expr ;
-+ */
-+static DAAPParser_query_return
-+query(pDAAPParser ctx)
-+{
-+ DAAPParser_query_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN NEWLINE2;
-+ pANTLR3_COMMON_TOKEN EOF3;
-+ DAAPParser_expr_return expr1;
-+ #undef RETURN_TYPE_expr1
-+ #define RETURN_TYPE_expr1 DAAPParser_expr_return
-+
-+ pANTLR3_BASE_TREE NEWLINE2_tree;
-+ pANTLR3_BASE_TREE EOF3_tree;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_NEWLINE;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_EOF;
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expr;
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ NEWLINE2 = NULL;
-+ EOF3 = NULL;
-+ expr1.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ NEWLINE2_tree = NULL;
-+ EOF3_tree = NULL;
-+
-+ stream_NEWLINE = NULL;
-+ #define CREATE_stream_NEWLINE if (stream_NEWLINE == NULL) {stream_NEWLINE = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token NEWLINE"); }
-+ stream_EOF = NULL;
-+ #define CREATE_stream_EOF if (stream_EOF == NULL) {stream_EOF = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token EOF"); }
-+ stream_expr = NULL;
-+ #define CREATE_stream_expr if (stream_expr == NULL) {stream_expr = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expr"); }
-+
-+ retval.tree = NULL;
-+ {
-+ // DAAP.g:27:7: ( expr ( NEWLINE )? EOF -> expr )
-+ // DAAP.g:27:9: expr ( NEWLINE )? EOF
-+ {
-+ FOLLOWPUSH(FOLLOW_expr_in_query42);
-+ expr1=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulequeryEx;
-+ }
-+
-+ CREATE_stream_expr; stream_expr->add(stream_expr, expr1.tree, NULL);
-+
-+ // DAAP.g:27:14: ( NEWLINE )?
-+ {
-+ int alt1=2;
-+ switch ( LA(1) )
-+ {
-+ case NEWLINE:
-+ {
-+ alt1=1;
-+ }
-+ break;
-+ }
-+
-+ switch (alt1)
-+ {
-+ case 1:
-+ // DAAP.g:27:14: NEWLINE
-+ {
-+ NEWLINE2 = (pANTLR3_COMMON_TOKEN) MATCHT(NEWLINE, &FOLLOW_NEWLINE_in_query44);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulequeryEx;
-+ }
-+
-+ CREATE_stream_NEWLINE; stream_NEWLINE->add(stream_NEWLINE, NEWLINE2, NULL);
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ EOF3 = (pANTLR3_COMMON_TOKEN) MATCHT(EOF, &FOLLOW_EOF_in_query47);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulequeryEx;
-+ }
-+
-+ CREATE_stream_EOF; stream_EOF->add(stream_EOF, EOF3, NULL);
-+
-+
-+
-+ /* AST REWRITE
-+ * elements : expr
-+ * token labels :
-+ * rule labels : retval
-+ * token list labels :
-+ * rule list labels :
-+ */
-+ {
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+ stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ retval.tree = root_0;
-+ // 27:27: -> expr
-+ {
-+ ADAPTOR->addChild(ADAPTOR, root_0, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
-+
-+ }
-+
-+ retval.tree = root_0; // set result root
-+ if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+ }
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto rulequeryEx; /* Prevent compiler warnings */
-+ rulequeryEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+ if (stream_NEWLINE != NULL) stream_NEWLINE->free(stream_NEWLINE);
-+ if (stream_EOF != NULL) stream_EOF->free(stream_EOF);
-+ if (stream_expr != NULL) stream_expr->free(stream_expr);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end query */
-+
-+/**
-+ * $ANTLR start expr
-+ * DAAP.g:30:1: expr : aexpr ( OPOR aexpr )* ;
-+ */
-+static DAAPParser_expr_return
-+expr(pDAAPParser ctx)
-+{
-+ DAAPParser_expr_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN OPOR5;
-+ DAAPParser_aexpr_return aexpr4;
-+ #undef RETURN_TYPE_aexpr4
-+ #define RETURN_TYPE_aexpr4 DAAPParser_aexpr_return
-+
-+ DAAPParser_aexpr_return aexpr6;
-+ #undef RETURN_TYPE_aexpr6
-+ #define RETURN_TYPE_aexpr6 DAAPParser_aexpr_return
-+
-+ pANTLR3_BASE_TREE OPOR5_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ OPOR5 = NULL;
-+ aexpr4.tree = NULL;
-+
-+ aexpr6.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ OPOR5_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ // DAAP.g:30:6: ( aexpr ( OPOR aexpr )* )
-+ // DAAP.g:30:8: aexpr ( OPOR aexpr )*
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_aexpr_in_expr62);
-+ aexpr4=aexpr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, aexpr4.tree);
-+
-+ // DAAP.g:30:14: ( OPOR aexpr )*
-+
-+ for (;;)
-+ {
-+ int alt2=2;
-+ switch ( LA(1) )
-+ {
-+ case OPOR:
-+ {
-+ alt2=1;
-+ }
-+ break;
-+
-+ }
-+
-+ switch (alt2)
-+ {
-+ case 1:
-+ // DAAP.g:30:15: OPOR aexpr
-+ {
-+ OPOR5 = (pANTLR3_COMMON_TOKEN) MATCHT(OPOR, &FOLLOW_OPOR_in_expr65);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ OPOR5_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, OPOR5));
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, OPOR5_tree, root_0));
-+
-+ FOLLOWPUSH(FOLLOW_aexpr_in_expr68);
-+ aexpr6=aexpr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, aexpr6.tree);
-+
-+ }
-+ break;
-+
-+ default:
-+ goto loop2; /* break out of the loop */
-+ break;
-+ }
-+ }
-+ loop2: ; /* Jump out to here if this rule does not match */
-+
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleexprEx; /* Prevent compiler warnings */
-+ ruleexprEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end expr */
-+
-+/**
-+ * $ANTLR start aexpr
-+ * DAAP.g:33:1: aexpr : crit ( OPAND crit )* ;
-+ */
-+static DAAPParser_aexpr_return
-+aexpr(pDAAPParser ctx)
-+{
-+ DAAPParser_aexpr_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN OPAND8;
-+ DAAPParser_crit_return crit7;
-+ #undef RETURN_TYPE_crit7
-+ #define RETURN_TYPE_crit7 DAAPParser_crit_return
-+
-+ DAAPParser_crit_return crit9;
-+ #undef RETURN_TYPE_crit9
-+ #define RETURN_TYPE_crit9 DAAPParser_crit_return
-+
-+ pANTLR3_BASE_TREE OPAND8_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ OPAND8 = NULL;
-+ crit7.tree = NULL;
-+
-+ crit9.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ OPAND8_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ // DAAP.g:33:7: ( crit ( OPAND crit )* )
-+ // DAAP.g:33:9: crit ( OPAND crit )*
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_crit_in_aexpr80);
-+ crit7=crit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleaexprEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, crit7.tree);
-+
-+ // DAAP.g:33:14: ( OPAND crit )*
-+
-+ for (;;)
-+ {
-+ int alt3=2;
-+ switch ( LA(1) )
-+ {
-+ case OPAND:
-+ {
-+ alt3=1;
-+ }
-+ break;
-+
-+ }
-+
-+ switch (alt3)
-+ {
-+ case 1:
-+ // DAAP.g:33:15: OPAND crit
-+ {
-+ OPAND8 = (pANTLR3_COMMON_TOKEN) MATCHT(OPAND, &FOLLOW_OPAND_in_aexpr83);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleaexprEx;
-+ }
-+
-+ OPAND8_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, OPAND8));
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, OPAND8_tree, root_0));
-+
-+ FOLLOWPUSH(FOLLOW_crit_in_aexpr86);
-+ crit9=crit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleaexprEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, crit9.tree);
-+
-+ }
-+ break;
-+
-+ default:
-+ goto loop3; /* break out of the loop */
-+ break;
-+ }
-+ }
-+ loop3: ; /* Jump out to here if this rule does not match */
-+
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleaexprEx; /* Prevent compiler warnings */
-+ ruleaexprEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end aexpr */
-+
-+/**
-+ * $ANTLR start crit
-+ * DAAP.g:36:1: crit : ( LPAR expr RPAR -> expr | STR );
-+ */
-+static DAAPParser_crit_return
-+crit(pDAAPParser ctx)
-+{
-+ DAAPParser_crit_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN LPAR10;
-+ pANTLR3_COMMON_TOKEN RPAR12;
-+ pANTLR3_COMMON_TOKEN STR13;
-+ DAAPParser_expr_return expr11;
-+ #undef RETURN_TYPE_expr11
-+ #define RETURN_TYPE_expr11 DAAPParser_expr_return
-+
-+ pANTLR3_BASE_TREE LPAR10_tree;
-+ pANTLR3_BASE_TREE RPAR12_tree;
-+ pANTLR3_BASE_TREE STR13_tree;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_RPAR;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LPAR;
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expr;
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ LPAR10 = NULL;
-+ RPAR12 = NULL;
-+ STR13 = NULL;
-+ expr11.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ LPAR10_tree = NULL;
-+ RPAR12_tree = NULL;
-+ STR13_tree = NULL;
-+
-+ stream_RPAR = NULL;
-+ #define CREATE_stream_RPAR if (stream_RPAR == NULL) {stream_RPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token RPAR"); }
-+ stream_LPAR = NULL;
-+ #define CREATE_stream_LPAR if (stream_LPAR == NULL) {stream_LPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LPAR"); }
-+ stream_expr = NULL;
-+ #define CREATE_stream_expr if (stream_expr == NULL) {stream_expr = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expr"); }
-+
-+ retval.tree = NULL;
-+ {
-+ {
-+ // DAAP.g:36:6: ( LPAR expr RPAR -> expr | STR )
-+
-+ ANTLR3_UINT32 alt4;
-+
-+ alt4=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case LPAR:
-+ {
-+ alt4=1;
-+ }
-+ break;
-+ case STR:
-+ {
-+ alt4=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto rulecritEx;
-+ }
-+
-+ switch (alt4)
-+ {
-+ case 1:
-+ // DAAP.g:36:8: LPAR expr RPAR
-+ {
-+ LPAR10 = (pANTLR3_COMMON_TOKEN) MATCHT(LPAR, &FOLLOW_LPAR_in_crit98);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ CREATE_stream_LPAR; stream_LPAR->add(stream_LPAR, LPAR10, NULL);
-+
-+ FOLLOWPUSH(FOLLOW_expr_in_crit100);
-+ expr11=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ CREATE_stream_expr; stream_expr->add(stream_expr, expr11.tree, NULL);
-+ RPAR12 = (pANTLR3_COMMON_TOKEN) MATCHT(RPAR, &FOLLOW_RPAR_in_crit102);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ CREATE_stream_RPAR; stream_RPAR->add(stream_RPAR, RPAR12, NULL);
-+
-+
-+
-+ /* AST REWRITE
-+ * elements : expr
-+ * token labels :
-+ * rule labels : retval
-+ * token list labels :
-+ * rule list labels :
-+ */
-+ {
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+ stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ retval.tree = root_0;
-+ // 36:24: -> expr
-+ {
-+ ADAPTOR->addChild(ADAPTOR, root_0, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
-+
-+ }
-+
-+ retval.tree = root_0; // set result root
-+ if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+ }
-+ }
-+ break;
-+ case 2:
-+ // DAAP.g:37:4: STR
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ STR13 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_crit112);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ STR13_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STR13));
-+ ADAPTOR->addChild(ADAPTOR, root_0, STR13_tree);
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto rulecritEx; /* Prevent compiler warnings */
-+ rulecritEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+ if (stream_RPAR != NULL) stream_RPAR->free(stream_RPAR);
-+ if (stream_LPAR != NULL) stream_LPAR->free(stream_LPAR);
-+ if (stream_expr != NULL) stream_expr->free(stream_expr);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end crit */
-+/* End of parsing rules
-+ * ==============================================
-+ */
-+
-+/* ==============================================
-+ * Syntactic predicates
-+ */
-+/* End of syntactic predicates
-+ * ==============================================
-+ */
-+
-+
-+
-+
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/DAAPParser.h b/src/pregen/DAAPParser.h
-new file mode 100644
-index 0000000..e206694
---- /dev/null
-+++ b/src/pregen/DAAPParser.h
-@@ -0,0 +1,226 @@
-+/** \file
-+ * This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : DAAP.g
-+ * - On : 2016-01-01 12:23:41
-+ * - for the parser : DAAPParserParser *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The parser DAAPParser has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ *
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pDAAPParser, which is returned from a call to DAAPParserNew().
-+ *
-+ * The methods in pDAAPParser are as follows:
-+ *
-+ * - DAAPParser_query_return pDAAPParser->query(pDAAPParser)
-+ * - DAAPParser_expr_return pDAAPParser->expr(pDAAPParser)
-+ * - DAAPParser_aexpr_return pDAAPParser->aexpr(pDAAPParser)
-+ * - DAAPParser_crit_return pDAAPParser->crit(pDAAPParser)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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 _DAAPParser_H
-+#define _DAAPParser_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct DAAPParser_Ctx_struct DAAPParser, * pDAAPParser;
-+
-+
-+
-+#ifdef ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter, - Rules with parameters that are not used
-+// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
-+// initialized but unused variable - tree rewrite variables declared but not needed
-+// Unreferenced local variable - lexer rule declares but does not always use _type
-+// potentially unitialized variable used - retval always returned from a rule
-+// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+typedef struct DAAPParser_query_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ DAAPParser_query_return;
-+
-+typedef struct DAAPParser_expr_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ DAAPParser_expr_return;
-+
-+typedef struct DAAPParser_aexpr_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ DAAPParser_aexpr_return;
-+
-+typedef struct DAAPParser_crit_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ DAAPParser_crit_return;
-+
-+
-+
-+/** Context tracking structure for DAAPParser
-+ */
-+struct DAAPParser_Ctx_struct
-+{
-+ /** Built in ANTLR3 context tracker contains all the generic elements
-+ * required for context tracking.
-+ */
-+ pANTLR3_PARSER pParser;
-+
-+
-+ DAAPParser_query_return (*query) (struct DAAPParser_Ctx_struct * ctx);
-+ DAAPParser_expr_return (*expr) (struct DAAPParser_Ctx_struct * ctx);
-+ DAAPParser_aexpr_return (*aexpr) (struct DAAPParser_Ctx_struct * ctx);
-+ DAAPParser_crit_return (*crit) (struct DAAPParser_Ctx_struct * ctx);
-+ // Delegated rules
-+ const char * (*getGrammarFileName)();
-+ void (*free) (struct DAAPParser_Ctx_struct * ctx);
-+ /* @headerFile.members() */
-+ pANTLR3_BASE_TREE_ADAPTOR adaptor;
-+ pANTLR3_VECTOR_FACTORY vectors;
-+ /* End @headerFile.members() */
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pDAAPParser DAAPParserNew (pANTLR3_COMMON_TOKEN_STREAM instream);
-+ANTLR3_API pDAAPParser DAAPParserNewSSD (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the parser will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef EOF
-+#undef EOF
-+#endif
-+#ifdef Tokens
-+#undef Tokens
-+#endif
-+#define STR 9
-+#define QUOTE 10
-+#define LPAR 7
-+#define NEWLINE 4
-+#define OPOR 5
-+#define RPAR 8
-+#define ESCAPED 11
-+#define OPAND 6
-+#define EOF -1
-+#ifdef EOF
-+#undef EOF
-+#define EOF ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for DAAPParser
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/RSP.u b/src/pregen/RSP.u
-new file mode 100644
-index 0000000..89256ff
---- /dev/null
-+++ b/src/pregen/RSP.u
-@@ -0,0 +1,6 @@
-+RSPParser.c : RSP.g
-+./RSP.tokens : RSP.g
-+RSPParser.h : RSP.g
-+RSPLexer.c : RSP.g
-+RSPLexer.h : RSP.g
-+ANTLR_PRODUCTS += RSPParser.c ./RSP.tokens RSPParser.h RSPLexer.c RSPLexer.h
-\ No newline at end of file
-diff --git a/src/pregen/RSP2SQL.c b/src/pregen/RSP2SQL.c
-new file mode 100644
-index 0000000..40958f9
---- /dev/null
-+++ b/src/pregen/RSP2SQL.c
-@@ -0,0 +1,2546 @@
-+/** \file
-+ * This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : RSP2SQL.g
-+ * - On : 2016-01-01 12:23:43
-+ * - for the tree parser : RSP2SQLTreeParser *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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.
-+
-+
-+/* =============================================================================
-+ * This is what the grammar programmer asked us to put at the top of every file.
-+ */
-+
-+ /* Needs #define _GNU_SOURCE for strptime() */
-+
-+ #include <stdio.h>
-+ #include <string.h>
-+ #include <time.h>
-+ #include <stdint.h>
-+
-+ #include "logger.h"
-+ #include "db.h"
-+ #include "misc.h"
-+ #include "rsp_query.h"
-+
-+/* End of Header action.
-+ * =============================================================================
-+ */
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include "RSP2SQL.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+
-+#define CTX ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef SCOPE_TYPE
-+#undef SCOPE_STACK
-+#undef SCOPE_TOP
-+#define SCOPE_TYPE(scope) pRSP2SQL_##scope##_SCOPE
-+#define SCOPE_STACK(scope) pRSP2SQL_##scope##Stack
-+#define SCOPE_TOP(scope) ctx->pRSP2SQL_##scope##Top
-+#define SCOPE_SIZE(scope) ctx->pRSP2SQL_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i) (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+/* Macros for accessing things in the parser
-+ */
-+
-+#undef PARSER
-+#undef RECOGNIZER
-+#undef HAVEPARSEDRULE
-+#undef INPUT
-+#undef STRSTREAM
-+#undef HASEXCEPTION
-+#undef EXCEPTION
-+#undef MATCHT
-+#undef MATCHANYT
-+#undef FOLLOWSTACK
-+#undef FOLLOWPUSH
-+#undef FOLLOWPOP
-+#undef PRECOVER
-+#undef PREPORTERROR
-+#undef LA
-+#undef LT
-+#undef CONSTRUCTEX
-+#undef CONSUME
-+#undef MARK
-+#undef REWIND
-+#undef REWINDLAST
-+#undef PERRORRECOVERY
-+#undef HASFAILED
-+#undef FAILEDFLAG
-+#undef RECOVERFROMMISMATCHEDSET
-+#undef RECOVERFROMMISMATCHEDELEMENT
-+#undef BACKTRACKING
-+#undef ADAPTOR
-+#undef RULEMEMO
-+#undef SEEK
-+#undef INDEX
-+#undef DBG
-+
-+#define PARSER ctx->pTreeParser
-+#define RECOGNIZER PARSER->rec
-+#define PSRSTATE RECOGNIZER->state
-+#define HAVEPARSEDRULE(r) RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define INPUT PARSER->ctnstream
-+#define ISTREAM INPUT->tnstream->istream
-+#define STRSTREAM INPUT->tnstream
-+#define HASEXCEPTION() (PSRSTATE->error == ANTLR3_TRUE)
-+#define EXCEPTION PSRSTATE->exception
-+#define MATCHT(t, fs) RECOGNIZER->match(RECOGNIZER, t, fs)
-+#define MATCHANYT() RECOGNIZER->matchAny(RECOGNIZER)
-+#define FOLLOWSTACK PSRSTATE->following
-+#define FOLLOWPUSH(x) FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
-+#define FOLLOWPOP() FOLLOWSTACK->pop(FOLLOWSTACK)
-+#define PRECOVER() RECOGNIZER->recover(RECOGNIZER)
-+#define PREPORTERROR() RECOGNIZER->reportError(RECOGNIZER)
-+#define LA(n) ISTREAM->_LA(ISTREAM, n)
-+#define LT(n) INPUT->tnstream->_LT(INPUT->tnstream, n)
-+#define CONSTRUCTEX() RECOGNIZER->exConstruct(RECOGNIZER)
-+#define CONSUME() ISTREAM->consume(ISTREAM)
-+#define MARK() ISTREAM->mark(ISTREAM)
-+#define REWIND(m) ISTREAM->rewind(ISTREAM, m)
-+#define REWINDLAST() ISTREAM->rewindLast(ISTREAM)
-+#define PERRORRECOVERY PSRSTATE->errorRecovery
-+#define FAILEDFLAG PSRSTATE->failed
-+#define HASFAILED() (FAILEDFLAG == ANTLR3_TRUE)
-+#define BACKTRACKING PSRSTATE->backtracking
-+#define RECOVERFROMMISMATCHEDSET(s) RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
-+#define RECOVERFROMMISMATCHEDELEMENT(e) RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
-+#define ADAPTOR INPUT->adaptor
-+#define RULEMEMO PSRSTATE->ruleMemo
-+#define SEEK(n) ISTREAM->seek(ISTREAM, n)
-+#define INDEX() ISTREAM->index(ISTREAM)
-+#define DBG RECOGNIZER->debugger
-+
-+
-+#define TOKTEXT(tok, txt) tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define UP ANTLR3_TOKEN_UP
-+#define DOWN ANTLR3_TOKEN_DOWN
-+#define EOR ANTLR3_TOKEN_EOR
-+#define INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+
-+/** \brief Table of all token names in symbolic order, mainly used for
-+ * error reporting.
-+ */
-+pANTLR3_UINT8 RSP2SQLTokenNames[30+4]
-+ = {
-+ (pANTLR3_UINT8) "<invalid>", /* String to print to indicate an invalid token */
-+ (pANTLR3_UINT8) "<EOR>",
-+ (pANTLR3_UINT8) "<DOWN>",
-+ (pANTLR3_UINT8) "<UP>",
-+ (pANTLR3_UINT8) "NEWLINE",
-+ (pANTLR3_UINT8) "OR",
-+ (pANTLR3_UINT8) "AND",
-+ (pANTLR3_UINT8) "LPAR",
-+ (pANTLR3_UINT8) "RPAR",
-+ (pANTLR3_UINT8) "FIELD",
-+ (pANTLR3_UINT8) "STR",
-+ (pANTLR3_UINT8) "NOT",
-+ (pANTLR3_UINT8) "EQUAL",
-+ (pANTLR3_UINT8) "INCLUDES",
-+ (pANTLR3_UINT8) "STARTSW",
-+ (pANTLR3_UINT8) "ENDSW",
-+ (pANTLR3_UINT8) "INT",
-+ (pANTLR3_UINT8) "LESS",
-+ (pANTLR3_UINT8) "GREATER",
-+ (pANTLR3_UINT8) "LTE",
-+ (pANTLR3_UINT8) "GTE",
-+ (pANTLR3_UINT8) "BEFORE",
-+ (pANTLR3_UINT8) "AFTER",
-+ (pANTLR3_UINT8) "DATE",
-+ (pANTLR3_UINT8) "TODAY",
-+ (pANTLR3_UINT8) "DAY",
-+ (pANTLR3_UINT8) "WEEK",
-+ (pANTLR3_UINT8) "MONTH",
-+ (pANTLR3_UINT8) "YEAR",
-+ (pANTLR3_UINT8) "QUOTE",
-+ (pANTLR3_UINT8) "WS",
-+ (pANTLR3_UINT8) "DIGIT19",
-+ (pANTLR3_UINT8) "DIGIT09",
-+ (pANTLR3_UINT8) "ESCAPED"
-+ };
-+
-+
-+
-+// Forward declare the locally static matching functions we have generated.
-+//
-+static pANTLR3_STRING query (pRSP2SQL ctx);
-+static RSP2SQL_expr_return expr (pRSP2SQL ctx);
-+static RSP2SQL_strcrit_return strcrit (pRSP2SQL ctx);
-+static pANTLR3_COMMON_TOKEN strop (pRSP2SQL ctx);
-+static RSP2SQL_intcrit_return intcrit (pRSP2SQL ctx);
-+static pANTLR3_COMMON_TOKEN intop (pRSP2SQL ctx);
-+static RSP2SQL_datecrit_return datecrit (pRSP2SQL ctx);
-+static pANTLR3_COMMON_TOKEN dateop (pRSP2SQL ctx);
-+static RSP2SQL_datespec_return datespec (pRSP2SQL ctx);
-+static RSP2SQL_dateref_return dateref (pRSP2SQL ctx);
-+static RSP2SQL_dateintval_return dateintval (pRSP2SQL ctx);
-+static void RSP2SQLFree(pRSP2SQL ctx);
-+/* For use in tree output where we are accumulating rule labels via label += ruleRef
-+ * we need a function that knows how to free a return scope when the list is destroyed.
-+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
-+ */
-+static void ANTLR3_CDECL freeScope(void * scope)
-+{
-+ ANTLR3_FREE(scope);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "RSP2SQL.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+ return fileName;
-+}
-+/** \brief Create a new RSP2SQL parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pRSP2SQL
-+RSP2SQLNew (pANTLR3_COMMON_TREE_NODE_STREAM instream)
-+{
-+ // See if we can create a new parser with the standard constructor
-+ //
-+ return RSP2SQLNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new RSP2SQL parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pRSP2SQL
-+RSP2SQLNewSSD (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+ pRSP2SQL ctx; /* Context structure we will build and return */
-+
-+ ctx = (pRSP2SQL) ANTLR3_CALLOC(1, sizeof(RSP2SQL));
-+
-+ if (ctx == NULL)
-+ {
-+ // Failed to allocate memory for parser context
-+ //
-+ return NULL;
-+ }
-+
-+ /* -------------------------------------------------------------------
-+ * Memory for basic structure is allocated, now to fill in
-+ * the base ANTLR3 structures. We initialize the function pointers
-+ * for the standard ANTLR3 parser function set, but upon return
-+ * from here, the programmer may set the pointers to provide custom
-+ * implementations of each function.
-+ *
-+ * We don't use the macros defined in RSP2SQL.h here, in order that you can get a sense
-+ * of what goes where.
-+ */
-+
-+ /* Create a base Tree parser/recognizer, using the supplied tree node stream
-+ */
-+ ctx->pTreeParser = antlr3TreeParserNewStream(ANTLR3_SIZE_HINT, instream, state);
-+ /* Install the implementation of our RSP2SQL interface
-+ */
-+ ctx->query = query;
-+ ctx->expr = expr;
-+ ctx->strcrit = strcrit;
-+ ctx->strop = strop;
-+ ctx->intcrit = intcrit;
-+ ctx->intop = intop;
-+ ctx->datecrit = datecrit;
-+ ctx->dateop = dateop;
-+ ctx->datespec = datespec;
-+ ctx->dateref = dateref;
-+ ctx->dateintval = dateintval;
-+ ctx->free = RSP2SQLFree;
-+ ctx->getGrammarFileName = getGrammarFileName;
-+
-+ /* Install the scope pushing methods.
-+ */
-+
-+
-+
-+
-+
-+ /* Install the token table
-+ */
-+ PSRSTATE->tokenNames = RSP2SQLTokenNames;
-+
-+
-+ /* Return the newly built parser to the caller
-+ */
-+ return ctx;
-+}
-+
-+/** Free the parser resources
-+ */
-+ static void
-+ RSP2SQLFree(pRSP2SQL ctx)
-+ {
-+ /* Free any scope memory
-+ */
-+
-+
-+ // Free this parser
-+ //
-+ ctx->pTreeParser->free(ctx->pTreeParser);
-+ ANTLR3_FREE(ctx);
-+
-+ /* Everything is released, so we can return
-+ */
-+ return;
-+ }
-+
-+/** Return token names used by this tree parser
-+ *
-+ * The returned pointer is used as an index into the token names table (using the token
-+ * number as the index).
-+ *
-+ * \return Pointer to first char * in the table.
-+ */
-+static pANTLR3_UINT8 *getTokenNames()
-+{
-+ return RSP2SQLTokenNames;
-+}
-+
-+
-+ #define RSP_TYPE_STRING 0
-+ #define RSP_TYPE_INT 1
-+ #define RSP_TYPE_DATE 2
-+
-+ struct rsp_query_field_map {
-+ char *rsp_field;
-+ int field_type;
-+ /* RSP fields are named after the DB columns - or vice versa */
-+ };
-+
-+ /* gperf static hash, rsp_query.gperf */
-+ #include "rsp_query_hash.c"
-+
-+
-+/* Declare the bitsets
-+ */
-+
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_query70 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_query70_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_query70 = { FOLLOW_expr_in_query70_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AND_in_expr95 */
-+static ANTLR3_BITWORD FOLLOW_AND_in_expr95_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static ANTLR3_BITSET_LIST FOLLOW_AND_in_expr95 = { FOLLOW_AND_in_expr95_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr101 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_expr101_bits[] = { ANTLR3_UINT64_LIT(0x00000000007EF860) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_expr101 = { FOLLOW_expr_in_expr101_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr107 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_expr107_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_expr107 = { FOLLOW_expr_in_expr107_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OR_in_expr118 */
-+static ANTLR3_BITWORD FOLLOW_OR_in_expr118_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static ANTLR3_BITSET_LIST FOLLOW_OR_in_expr118 = { FOLLOW_OR_in_expr118_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr124 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_expr124_bits[] = { ANTLR3_UINT64_LIT(0x00000000007EF860) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_expr124 = { FOLLOW_expr_in_expr124_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_expr130 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_expr130_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_expr130 = { FOLLOW_expr_in_expr130_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_strcrit_in_expr144 */
-+static ANTLR3_BITWORD FOLLOW_strcrit_in_expr144_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_strcrit_in_expr144 = { FOLLOW_strcrit_in_expr144_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_expr154 */
-+static ANTLR3_BITWORD FOLLOW_NOT_in_expr154_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static ANTLR3_BITSET_LIST FOLLOW_NOT_in_expr154 = { FOLLOW_NOT_in_expr154_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_strcrit_in_expr160 */
-+static ANTLR3_BITWORD FOLLOW_strcrit_in_expr160_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static ANTLR3_BITSET_LIST FOLLOW_strcrit_in_expr160 = { FOLLOW_strcrit_in_expr160_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_intcrit_in_expr174 */
-+static ANTLR3_BITWORD FOLLOW_intcrit_in_expr174_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_intcrit_in_expr174 = { FOLLOW_intcrit_in_expr174_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_expr184 */
-+static ANTLR3_BITWORD FOLLOW_NOT_in_expr184_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static ANTLR3_BITSET_LIST FOLLOW_NOT_in_expr184 = { FOLLOW_NOT_in_expr184_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_intcrit_in_expr190 */
-+static ANTLR3_BITWORD FOLLOW_intcrit_in_expr190_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static ANTLR3_BITSET_LIST FOLLOW_intcrit_in_expr190 = { FOLLOW_intcrit_in_expr190_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_datecrit_in_expr204 */
-+static ANTLR3_BITWORD FOLLOW_datecrit_in_expr204_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_datecrit_in_expr204 = { FOLLOW_datecrit_in_expr204_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_strop_in_strcrit233 */
-+static ANTLR3_BITWORD FOLLOW_strop_in_strcrit233_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static ANTLR3_BITSET_LIST FOLLOW_strop_in_strcrit233 = { FOLLOW_strop_in_strcrit233_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_strcrit239 */
-+static ANTLR3_BITWORD FOLLOW_FIELD_in_strcrit239_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000400) };
-+static ANTLR3_BITSET_LIST FOLLOW_FIELD_in_strcrit239 = { FOLLOW_FIELD_in_strcrit239_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_strcrit245 */
-+static ANTLR3_BITWORD FOLLOW_STR_in_strcrit245_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static ANTLR3_BITSET_LIST FOLLOW_STR_in_strcrit245 = { FOLLOW_STR_in_strcrit245_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQUAL_in_strop274 */
-+static ANTLR3_BITWORD FOLLOW_EQUAL_in_strop274_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_EQUAL_in_strop274 = { FOLLOW_EQUAL_in_strop274_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCLUDES_in_strop287 */
-+static ANTLR3_BITWORD FOLLOW_INCLUDES_in_strop287_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_INCLUDES_in_strop287 = { FOLLOW_INCLUDES_in_strop287_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STARTSW_in_strop300 */
-+static ANTLR3_BITWORD FOLLOW_STARTSW_in_strop300_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_STARTSW_in_strop300 = { FOLLOW_STARTSW_in_strop300_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENDSW_in_strop313 */
-+static ANTLR3_BITWORD FOLLOW_ENDSW_in_strop313_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_ENDSW_in_strop313 = { FOLLOW_ENDSW_in_strop313_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_intop_in_intcrit342 */
-+static ANTLR3_BITWORD FOLLOW_intop_in_intcrit342_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static ANTLR3_BITSET_LIST FOLLOW_intop_in_intcrit342 = { FOLLOW_intop_in_intcrit342_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_intcrit348 */
-+static ANTLR3_BITWORD FOLLOW_FIELD_in_intcrit348_bits[] = { ANTLR3_UINT64_LIT(0x0000000000010000) };
-+static ANTLR3_BITSET_LIST FOLLOW_FIELD_in_intcrit348 = { FOLLOW_FIELD_in_intcrit348_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_intcrit354 */
-+static ANTLR3_BITWORD FOLLOW_INT_in_intcrit354_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static ANTLR3_BITSET_LIST FOLLOW_INT_in_intcrit354 = { FOLLOW_INT_in_intcrit354_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQUAL_in_intop383 */
-+static ANTLR3_BITWORD FOLLOW_EQUAL_in_intop383_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_EQUAL_in_intop383 = { FOLLOW_EQUAL_in_intop383_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LESS_in_intop396 */
-+static ANTLR3_BITWORD FOLLOW_LESS_in_intop396_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_LESS_in_intop396 = { FOLLOW_LESS_in_intop396_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GREATER_in_intop409 */
-+static ANTLR3_BITWORD FOLLOW_GREATER_in_intop409_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_GREATER_in_intop409 = { FOLLOW_GREATER_in_intop409_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LTE_in_intop422 */
-+static ANTLR3_BITWORD FOLLOW_LTE_in_intop422_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_LTE_in_intop422 = { FOLLOW_LTE_in_intop422_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GTE_in_intop435 */
-+static ANTLR3_BITWORD FOLLOW_GTE_in_intop435_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_GTE_in_intop435 = { FOLLOW_GTE_in_intop435_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateop_in_datecrit464 */
-+static ANTLR3_BITWORD FOLLOW_dateop_in_datecrit464_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static ANTLR3_BITSET_LIST FOLLOW_dateop_in_datecrit464 = { FOLLOW_dateop_in_datecrit464_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_datecrit470 */
-+static ANTLR3_BITWORD FOLLOW_FIELD_in_datecrit470_bits[] = { ANTLR3_UINT64_LIT(0x0000000001FEF860) };
-+static ANTLR3_BITSET_LIST FOLLOW_FIELD_in_datecrit470 = { FOLLOW_FIELD_in_datecrit470_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_datespec_in_datecrit476 */
-+static ANTLR3_BITWORD FOLLOW_datespec_in_datecrit476_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static ANTLR3_BITSET_LIST FOLLOW_datespec_in_datecrit476 = { FOLLOW_datespec_in_datecrit476_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_dateop505 */
-+static ANTLR3_BITWORD FOLLOW_BEFORE_in_dateop505_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_dateop505 = { FOLLOW_BEFORE_in_dateop505_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_dateop518 */
-+static ANTLR3_BITWORD FOLLOW_AFTER_in_dateop518_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_AFTER_in_dateop518 = { FOLLOW_AFTER_in_dateop518_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateref_in_datespec546 */
-+static ANTLR3_BITWORD FOLLOW_dateref_in_datespec546_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_dateref_in_datespec546 = { FOLLOW_dateref_in_datespec546_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateop_in_datespec560 */
-+static ANTLR3_BITWORD FOLLOW_dateop_in_datespec560_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static ANTLR3_BITSET_LIST FOLLOW_dateop_in_datespec560 = { FOLLOW_dateop_in_datespec560_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateref_in_datespec566 */
-+static ANTLR3_BITWORD FOLLOW_dateref_in_datespec566_bits[] = { ANTLR3_UINT64_LIT(0x0000000000010000) };
-+static ANTLR3_BITSET_LIST FOLLOW_dateref_in_datespec566 = { FOLLOW_dateref_in_datespec566_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_datespec572 */
-+static ANTLR3_BITWORD FOLLOW_INT_in_datespec572_bits[] = { ANTLR3_UINT64_LIT(0x000000001E000000) };
-+static ANTLR3_BITSET_LIST FOLLOW_INT_in_datespec572 = { FOLLOW_INT_in_datespec572_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateintval_in_datespec578 */
-+static ANTLR3_BITWORD FOLLOW_dateintval_in_datespec578_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static ANTLR3_BITSET_LIST FOLLOW_dateintval_in_datespec578 = { FOLLOW_dateintval_in_datespec578_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateref607 */
-+static ANTLR3_BITWORD FOLLOW_DATE_in_dateref607_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateref607 = { FOLLOW_DATE_in_dateref607_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_TODAY_in_dateref616 */
-+static ANTLR3_BITWORD FOLLOW_TODAY_in_dateref616_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_TODAY_in_dateref616 = { FOLLOW_TODAY_in_dateref616_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DAY_in_dateintval640 */
-+static ANTLR3_BITWORD FOLLOW_DAY_in_dateintval640_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_DAY_in_dateintval640 = { FOLLOW_DAY_in_dateintval640_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_WEEK_in_dateintval649 */
-+static ANTLR3_BITWORD FOLLOW_WEEK_in_dateintval649_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_WEEK_in_dateintval649 = { FOLLOW_WEEK_in_dateintval649_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MONTH_in_dateintval658 */
-+static ANTLR3_BITWORD FOLLOW_MONTH_in_dateintval658_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_MONTH_in_dateintval658 = { FOLLOW_MONTH_in_dateintval658_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_YEAR_in_dateintval667 */
-+static ANTLR3_BITWORD FOLLOW_YEAR_in_dateintval667_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_YEAR_in_dateintval667 = { FOLLOW_YEAR_in_dateintval667_bits, 1 };
-+
-+
-+
-+
-+/* ==============================================
-+ * Parsing rules
-+ */
-+/**
-+ * $ANTLR start query
-+ * RSP2SQL.g:56:1: query returns [ pANTLR3_STRING result ] : e= expr ;
-+ */
-+static pANTLR3_STRING
-+query(pRSP2SQL ctx)
-+{
-+ pANTLR3_STRING result = NULL;
-+
-+ RSP2SQL_expr_return e;
-+ #undef RETURN_TYPE_e
-+ #define RETURN_TYPE_e RSP2SQL_expr_return
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ result= NULL;
-+ {
-+ // RSP2SQL.g:58:2: (e= expr )
-+ // RSP2SQL.g:58:4: e= expr
-+ {
-+ FOLLOWPUSH(FOLLOW_expr_in_query70);
-+ e=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulequeryEx;
-+ }
-+
-+ {
-+
-+ if (!e.valid)
-+ {
-+ result= NULL;
-+ }
-+ else
-+ {
-+ result= e.result->factory->newRaw(e.result->factory);
-+ result->append8(result, "(");
-+ result->appendS(result, e.result);
-+ result->append8(result, ")");
-+ }
-+
-+ }
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto rulequeryEx; /* Prevent compiler warnings */
-+ rulequeryEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return result;
-+}
-+/* $ANTLR end query */
-+
-+/**
-+ * $ANTLR start expr
-+ * RSP2SQL.g:74:1: expr returns [ pANTLR3_STRING result, int valid ] : ( ^( AND a= expr b= expr ) | ^( OR a= expr b= expr ) | c= strcrit | ^( NOT c= strcrit ) | i= intcrit | ^( NOT i= intcrit ) | d= datecrit );
-+ */
-+static RSP2SQL_expr_return
-+expr(pRSP2SQL ctx)
-+{
-+ RSP2SQL_expr_return retval;
-+
-+ RSP2SQL_expr_return a;
-+ #undef RETURN_TYPE_a
-+ #define RETURN_TYPE_a RSP2SQL_expr_return
-+
-+ RSP2SQL_expr_return b;
-+ #undef RETURN_TYPE_b
-+ #define RETURN_TYPE_b RSP2SQL_expr_return
-+
-+ RSP2SQL_strcrit_return c;
-+ #undef RETURN_TYPE_c
-+ #define RETURN_TYPE_c RSP2SQL_strcrit_return
-+
-+ RSP2SQL_intcrit_return i;
-+ #undef RETURN_TYPE_i
-+ #define RETURN_TYPE_i RSP2SQL_intcrit_return
-+
-+ RSP2SQL_datecrit_return d;
-+ #undef RETURN_TYPE_d
-+ #define RETURN_TYPE_d RSP2SQL_datecrit_return
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ retval.result= NULL; retval.valid= 1;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ {
-+ {
-+ // RSP2SQL.g:76:2: ( ^( AND a= expr b= expr ) | ^( OR a= expr b= expr ) | c= strcrit | ^( NOT c= strcrit ) | i= intcrit | ^( NOT i= intcrit ) | d= datecrit )
-+
-+ ANTLR3_UINT32 alt1;
-+
-+ alt1=7;
-+
-+ switch ( LA(1) )
-+ {
-+ case AND:
-+ {
-+ alt1=1;
-+ }
-+ break;
-+ case OR:
-+ {
-+ alt1=2;
-+ }
-+ break;
-+ case EQUAL:
-+ {
-+ switch ( LA(2) )
-+ {
-+ case DOWN:
-+ {
-+ switch ( LA(3) )
-+ {
-+ case FIELD:
-+ {
-+ switch ( LA(4) )
-+ {
-+ case INT:
-+ {
-+ alt1=5;
-+ }
-+ break;
-+ case STR:
-+ {
-+ alt1=3;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 10;
-+
-+
-+ goto ruleexprEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 8;
-+
-+
-+ goto ruleexprEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 3;
-+
-+
-+ goto ruleexprEx;
-+ }
-+
-+ }
-+ break;
-+ case INCLUDES:
-+ case STARTSW:
-+ case ENDSW:
-+ {
-+ alt1=3;
-+ }
-+ break;
-+ case NOT:
-+ {
-+ switch ( LA(2) )
-+ {
-+ case DOWN:
-+ {
-+ switch ( LA(3) )
-+ {
-+ case EQUAL:
-+ {
-+ switch ( LA(4) )
-+ {
-+ case DOWN:
-+ {
-+ switch ( LA(5) )
-+ {
-+ case FIELD:
-+ {
-+ switch ( LA(6) )
-+ {
-+ case STR:
-+ {
-+ alt1=4;
-+ }
-+ break;
-+ case INT:
-+ {
-+ alt1=6;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 15;
-+
-+
-+ goto ruleexprEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 14;
-+
-+
-+ goto ruleexprEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 11;
-+
-+
-+ goto ruleexprEx;
-+ }
-+
-+ }
-+ break;
-+ case LESS:
-+ case GREATER:
-+ case LTE:
-+ case GTE:
-+ {
-+ alt1=6;
-+ }
-+ break;
-+ case INCLUDES:
-+ case STARTSW:
-+ case ENDSW:
-+ {
-+ alt1=4;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 9;
-+
-+
-+ goto ruleexprEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 5;
-+
-+
-+ goto ruleexprEx;
-+ }
-+
-+ }
-+ break;
-+ case LESS:
-+ case GREATER:
-+ case LTE:
-+ case GTE:
-+ {
-+ alt1=5;
-+ }
-+ break;
-+ case BEFORE:
-+ case AFTER:
-+ {
-+ alt1=7;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleexprEx;
-+ }
-+
-+ switch (alt1)
-+ {
-+ case 1:
-+ // RSP2SQL.g:76:4: ^( AND a= expr b= expr )
-+ {
-+ MATCHT(AND, &FOLLOW_AND_in_expr95);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_DOWN, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expr_in_expr101);
-+ a=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expr_in_expr107);
-+ b=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_UP, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ {
-+
-+ if (!a.valid || !b.valid)
-+ {
-+ retval.valid= 0;
-+ }
-+ else
-+ {
-+ retval.result= a.result->factory->newRaw(a.result->factory);
-+ retval.result->append8(retval.result, "(");
-+ retval.result->appendS(retval.result, a.result);
-+ retval.result->append8(retval.result, " AND ");
-+ retval.result->appendS(retval.result, b.result);
-+ retval.result->append8(retval.result, ")");
-+ }
-+
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP2SQL.g:92:4: ^( OR a= expr b= expr )
-+ {
-+ MATCHT(OR, &FOLLOW_OR_in_expr118);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_DOWN, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expr_in_expr124);
-+ a=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expr_in_expr130);
-+ b=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_UP, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ {
-+
-+ if (!a.valid || !b.valid)
-+ {
-+ retval.valid= 0;
-+ }
-+ else
-+ {
-+ retval.result= a.result->factory->newRaw(a.result->factory);
-+ retval.result->append8(retval.result, "(");
-+ retval.result->appendS(retval.result, a.result);
-+ retval.result->append8(retval.result, " OR ");
-+ retval.result->appendS(retval.result, b.result);
-+ retval.result->append8(retval.result, ")");
-+ }
-+
-+ }
-+
-+ }
-+ break;
-+ case 3:
-+ // RSP2SQL.g:108:4: c= strcrit
-+ {
-+ FOLLOWPUSH(FOLLOW_strcrit_in_expr144);
-+ c=strcrit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ {
-+
-+ retval.valid= c.valid;
-+ retval.result= c.result;
-+
-+ }
-+
-+ }
-+ break;
-+ case 4:
-+ // RSP2SQL.g:113:4: ^( NOT c= strcrit )
-+ {
-+ MATCHT(NOT, &FOLLOW_NOT_in_expr154);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_DOWN, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_strcrit_in_expr160);
-+ c=strcrit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_UP, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ {
-+
-+ if (!c.valid)
-+ {
-+ retval.valid= 0;
-+ }
-+ else
-+ {
-+ retval.result= c.result->factory->newRaw(c.result->factory);
-+ retval.result->append8(retval.result, "(NOT ");
-+ retval.result->appendS(retval.result, c.result);
-+ retval.result->append8(retval.result, ")");
-+ }
-+
-+ }
-+
-+ }
-+ break;
-+ case 5:
-+ // RSP2SQL.g:127:4: i= intcrit
-+ {
-+ FOLLOWPUSH(FOLLOW_intcrit_in_expr174);
-+ i=intcrit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ {
-+
-+ retval.valid= i.valid;
-+ retval.result= i.result;
-+
-+ }
-+
-+ }
-+ break;
-+ case 6:
-+ // RSP2SQL.g:132:4: ^( NOT i= intcrit )
-+ {
-+ MATCHT(NOT, &FOLLOW_NOT_in_expr184);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_DOWN, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_intcrit_in_expr190);
-+ i=intcrit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_UP, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ {
-+
-+ if (!i.valid)
-+ {
-+ retval.valid= 0;
-+ }
-+ else
-+ {
-+ retval.result= i.result->factory->newRaw(i.result->factory);
-+ retval.result->append8(retval.result, "(NOT ");
-+ retval.result->appendS(retval.result, i.result);
-+ retval.result->append8(retval.result, ")");
-+ }
-+
-+ }
-+
-+ }
-+ break;
-+ case 7:
-+ // RSP2SQL.g:146:4: d= datecrit
-+ {
-+ FOLLOWPUSH(FOLLOW_datecrit_in_expr204);
-+ d=datecrit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ {
-+
-+ retval.valid= d.valid;
-+ retval.result= d.result;
-+
-+ }
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleexprEx; /* Prevent compiler warnings */
-+ ruleexprEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end expr */
-+
-+/**
-+ * $ANTLR start strcrit
-+ * RSP2SQL.g:153:1: strcrit returns [ pANTLR3_STRING result, int valid ] : ^(o= strop f= FIELD s= STR ) ;
-+ */
-+static RSP2SQL_strcrit_return
-+strcrit(pRSP2SQL ctx)
-+{
-+ RSP2SQL_strcrit_return retval;
-+
-+ pANTLR3_BASE_TREE f;
-+ pANTLR3_BASE_TREE s;
-+ pANTLR3_COMMON_TOKEN o;
-+ #undef RETURN_TYPE_o
-+ #define RETURN_TYPE_o pANTLR3_COMMON_TOKEN
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ retval.result= NULL; retval.valid= 1;
-+ f = NULL;
-+ s = NULL;
-+ o = NULL;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ {
-+ // RSP2SQL.g:155:2: ( ^(o= strop f= FIELD s= STR ) )
-+ // RSP2SQL.g:155:4: ^(o= strop f= FIELD s= STR )
-+ {
-+ FOLLOWPUSH(FOLLOW_strop_in_strcrit233);
-+ o=strop(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestrcritEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_DOWN, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestrcritEx;
-+ }
-+
-+ f = (pANTLR3_BASE_TREE) MATCHT(FIELD, &FOLLOW_FIELD_in_strcrit239);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestrcritEx;
-+ }
-+
-+ s = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_strcrit245);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestrcritEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_UP, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestrcritEx;
-+ }
-+
-+ {
-+
-+ char *op;
-+ const struct rsp_query_field_map *rqfp;
-+ pANTLR3_STRING field;
-+ char *escaped;
-+ ANTLR3_UINT32 optok;
-+
-+ escaped = NULL;
-+
-+ op = NULL;
-+ optok = o->getType(o);
-+ switch (optok)
-+ {
-+ case EQUAL:
-+ op = " = ";
-+ break;
-+
-+ case INCLUDES:
-+ case STARTSW:
-+ case ENDSW:
-+ op = " LIKE ";
-+ break;
-+ }
-+
-+ field = f->getText(f);
-+
-+ /* Field lookup */
-+ rqfp = rsp_query_field_lookup((char *)field->chars, strlen((char *)field->chars));
-+ if (!rqfp)
-+ {
-+ DPRINTF(E_LOG, L_RSP, "Field '%s' is not a valid field in queries\n", field->chars);
-+ retval.valid= 0;
-+ goto strcrit_valid_0; /* ABORT */
-+ }
-+
-+ /* Check field type */
-+ if (rqfp->field_type != RSP_TYPE_STRING)
-+ {
-+ DPRINTF(E_LOG, L_RSP, "Field '%s' is not a string field\n", field->chars);
-+ retval.valid= 0;
-+ goto strcrit_valid_0; /* ABORT */
-+ }
-+
-+ escaped = db_escape_string((char *)s->getText(s)->chars);
-+ if (!escaped)
-+ {
-+ DPRINTF(E_LOG, L_RSP, "Could not escape value\n");
-+ retval.valid= 0;
-+ goto strcrit_valid_0; /* ABORT */
-+ }
-+
-+ retval.result= field->factory->newRaw(field->factory);
-+ retval.result->append8(retval.result, "f.");
-+ retval.result->appendS(retval.result, field);
-+ retval.result->append8(retval.result, op);
-+ retval.result->append8(retval.result, "'");
-+ if ((optok == INCLUDES) || (optok == STARTSW))
-+ retval.result->append8(retval.result, "%");
-+
-+ retval.result->append8(retval.result, escaped);
-+
-+ if ((optok == INCLUDES) || (optok == ENDSW))
-+ retval.result->append8(retval.result, "%");
-+ retval.result->append8(retval.result, "'");
-+
-+ strcrit_valid_0:
-+ ;
-+
-+ if (escaped)
-+ free(escaped);
-+
-+ }
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto rulestrcritEx; /* Prevent compiler warnings */
-+ rulestrcritEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end strcrit */
-+
-+/**
-+ * $ANTLR start strop
-+ * RSP2SQL.g:229:1: strop returns [ pANTLR3_COMMON_TOKEN op ] : (n= EQUAL | n= INCLUDES | n= STARTSW | n= ENDSW );
-+ */
-+static pANTLR3_COMMON_TOKEN
-+strop(pRSP2SQL ctx)
-+{
-+ pANTLR3_COMMON_TOKEN op = NULL;
-+
-+ pANTLR3_BASE_TREE n;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ op= NULL;
-+ n = NULL;
-+
-+ {
-+ {
-+ // RSP2SQL.g:231:2: (n= EQUAL | n= INCLUDES | n= STARTSW | n= ENDSW )
-+
-+ ANTLR3_UINT32 alt2;
-+
-+ alt2=4;
-+
-+ switch ( LA(1) )
-+ {
-+ case EQUAL:
-+ {
-+ alt2=1;
-+ }
-+ break;
-+ case INCLUDES:
-+ {
-+ alt2=2;
-+ }
-+ break;
-+ case STARTSW:
-+ {
-+ alt2=3;
-+ }
-+ break;
-+ case ENDSW:
-+ {
-+ alt2=4;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 2;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto rulestropEx;
-+ }
-+
-+ switch (alt2)
-+ {
-+ case 1:
-+ // RSP2SQL.g:231:4: n= EQUAL
-+ {
-+ n = (pANTLR3_BASE_TREE) MATCHT(EQUAL, &FOLLOW_EQUAL_in_strop274);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestropEx;
-+ }
-+
-+ {
-+ op= n->getToken(n);
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP2SQL.g:233:4: n= INCLUDES
-+ {
-+ n = (pANTLR3_BASE_TREE) MATCHT(INCLUDES, &FOLLOW_INCLUDES_in_strop287);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestropEx;
-+ }
-+
-+ {
-+ op= n->getToken(n);
-+ }
-+
-+ }
-+ break;
-+ case 3:
-+ // RSP2SQL.g:235:4: n= STARTSW
-+ {
-+ n = (pANTLR3_BASE_TREE) MATCHT(STARTSW, &FOLLOW_STARTSW_in_strop300);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestropEx;
-+ }
-+
-+ {
-+ op= n->getToken(n);
-+ }
-+
-+ }
-+ break;
-+ case 4:
-+ // RSP2SQL.g:237:4: n= ENDSW
-+ {
-+ n = (pANTLR3_BASE_TREE) MATCHT(ENDSW, &FOLLOW_ENDSW_in_strop313);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestropEx;
-+ }
-+
-+ {
-+ op= n->getToken(n);
-+ }
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto rulestropEx; /* Prevent compiler warnings */
-+ rulestropEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return op;
-+}
-+/* $ANTLR end strop */
-+
-+/**
-+ * $ANTLR start intcrit
-+ * RSP2SQL.g:241:1: intcrit returns [ pANTLR3_STRING result, int valid ] : ^(o= intop f= FIELD i= INT ) ;
-+ */
-+static RSP2SQL_intcrit_return
-+intcrit(pRSP2SQL ctx)
-+{
-+ RSP2SQL_intcrit_return retval;
-+
-+ pANTLR3_BASE_TREE f;
-+ pANTLR3_BASE_TREE i;
-+ pANTLR3_COMMON_TOKEN o;
-+ #undef RETURN_TYPE_o
-+ #define RETURN_TYPE_o pANTLR3_COMMON_TOKEN
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ retval.result= NULL; retval.valid= 1;
-+ f = NULL;
-+ i = NULL;
-+ o = NULL;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ {
-+ // RSP2SQL.g:243:2: ( ^(o= intop f= FIELD i= INT ) )
-+ // RSP2SQL.g:243:4: ^(o= intop f= FIELD i= INT )
-+ {
-+ FOLLOWPUSH(FOLLOW_intop_in_intcrit342);
-+ o=intop(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintcritEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_DOWN, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintcritEx;
-+ }
-+
-+ f = (pANTLR3_BASE_TREE) MATCHT(FIELD, &FOLLOW_FIELD_in_intcrit348);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintcritEx;
-+ }
-+
-+ i = (pANTLR3_BASE_TREE) MATCHT(INT, &FOLLOW_INT_in_intcrit354);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintcritEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_UP, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintcritEx;
-+ }
-+
-+ {
-+
-+ char *op;
-+ const struct rsp_query_field_map *rqfp;
-+ pANTLR3_STRING field;
-+
-+ op = NULL;
-+ switch (o->getType(o))
-+ {
-+ case EQUAL:
-+ op = " = ";
-+ break;
-+
-+ case LESS:
-+ op = " < ";
-+ break;
-+
-+ case GREATER:
-+ op = " > ";
-+ break;
-+
-+ case LTE:
-+ op = " <= ";
-+ break;
-+
-+ case GTE:
-+ op = " >= ";
-+ break;
-+ }
-+
-+ field = f->getText(f);
-+
-+ /* Field lookup */
-+ rqfp = rsp_query_field_lookup((char *)field->chars, strlen((char *)field->chars));
-+ if (!rqfp)
-+ {
-+ DPRINTF(E_LOG, L_RSP, "Field '%s' is not a valid field in queries\n", field->chars);
-+ retval.valid= 0;
-+ goto intcrit_valid_0; /* ABORT */
-+ }
-+
-+ /* Check field type */
-+ if (rqfp->field_type != RSP_TYPE_INT)
-+ {
-+ DPRINTF(E_LOG, L_RSP, "Field '%s' is not an integer field\n", field->chars);
-+ retval.valid= 0;
-+ goto intcrit_valid_0; /* ABORT */
-+ }
-+
-+ retval.result= field->factory->newRaw(field->factory);
-+ retval.result->append8(retval.result, "f.");
-+ retval.result->appendS(retval.result, field);
-+ retval.result->append8(retval.result, op);
-+ retval.result->appendS(retval.result, i->getText(i));
-+
-+ intcrit_valid_0:
-+ ;
-+
-+ }
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleintcritEx; /* Prevent compiler warnings */
-+ ruleintcritEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end intcrit */
-+
-+/**
-+ * $ANTLR start intop
-+ * RSP2SQL.g:303:1: intop returns [ pANTLR3_COMMON_TOKEN op ] : (n= EQUAL | n= LESS | n= GREATER | n= LTE | n= GTE );
-+ */
-+static pANTLR3_COMMON_TOKEN
-+intop(pRSP2SQL ctx)
-+{
-+ pANTLR3_COMMON_TOKEN op = NULL;
-+
-+ pANTLR3_BASE_TREE n;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ op= NULL;
-+ n = NULL;
-+
-+ {
-+ {
-+ // RSP2SQL.g:305:2: (n= EQUAL | n= LESS | n= GREATER | n= LTE | n= GTE )
-+
-+ ANTLR3_UINT32 alt3;
-+
-+ alt3=5;
-+
-+ switch ( LA(1) )
-+ {
-+ case EQUAL:
-+ {
-+ alt3=1;
-+ }
-+ break;
-+ case LESS:
-+ {
-+ alt3=2;
-+ }
-+ break;
-+ case GREATER:
-+ {
-+ alt3=3;
-+ }
-+ break;
-+ case LTE:
-+ {
-+ alt3=4;
-+ }
-+ break;
-+ case GTE:
-+ {
-+ alt3=5;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleintopEx;
-+ }
-+
-+ switch (alt3)
-+ {
-+ case 1:
-+ // RSP2SQL.g:305:4: n= EQUAL
-+ {
-+ n = (pANTLR3_BASE_TREE) MATCHT(EQUAL, &FOLLOW_EQUAL_in_intop383);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintopEx;
-+ }
-+
-+ {
-+ op= n->getToken(n);
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP2SQL.g:307:4: n= LESS
-+ {
-+ n = (pANTLR3_BASE_TREE) MATCHT(LESS, &FOLLOW_LESS_in_intop396);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintopEx;
-+ }
-+
-+ {
-+ op= n->getToken(n);
-+ }
-+
-+ }
-+ break;
-+ case 3:
-+ // RSP2SQL.g:309:4: n= GREATER
-+ {
-+ n = (pANTLR3_BASE_TREE) MATCHT(GREATER, &FOLLOW_GREATER_in_intop409);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintopEx;
-+ }
-+
-+ {
-+ op= n->getToken(n);
-+ }
-+
-+ }
-+ break;
-+ case 4:
-+ // RSP2SQL.g:311:4: n= LTE
-+ {
-+ n = (pANTLR3_BASE_TREE) MATCHT(LTE, &FOLLOW_LTE_in_intop422);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintopEx;
-+ }
-+
-+ {
-+ op= n->getToken(n);
-+ }
-+
-+ }
-+ break;
-+ case 5:
-+ // RSP2SQL.g:313:4: n= GTE
-+ {
-+ n = (pANTLR3_BASE_TREE) MATCHT(GTE, &FOLLOW_GTE_in_intop435);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintopEx;
-+ }
-+
-+ {
-+ op= n->getToken(n);
-+ }
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleintopEx; /* Prevent compiler warnings */
-+ ruleintopEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return op;
-+}
-+/* $ANTLR end intop */
-+
-+/**
-+ * $ANTLR start datecrit
-+ * RSP2SQL.g:317:1: datecrit returns [ pANTLR3_STRING result, int valid ] : ^(o= dateop f= FIELD d= datespec ) ;
-+ */
-+static RSP2SQL_datecrit_return
-+datecrit(pRSP2SQL ctx)
-+{
-+ RSP2SQL_datecrit_return retval;
-+
-+ pANTLR3_BASE_TREE f;
-+ pANTLR3_COMMON_TOKEN o;
-+ #undef RETURN_TYPE_o
-+ #define RETURN_TYPE_o pANTLR3_COMMON_TOKEN
-+
-+ RSP2SQL_datespec_return d;
-+ #undef RETURN_TYPE_d
-+ #define RETURN_TYPE_d RSP2SQL_datespec_return
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ retval.result= NULL; retval.valid= 1;
-+ f = NULL;
-+ o = NULL;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ {
-+ // RSP2SQL.g:319:2: ( ^(o= dateop f= FIELD d= datespec ) )
-+ // RSP2SQL.g:319:4: ^(o= dateop f= FIELD d= datespec )
-+ {
-+ FOLLOWPUSH(FOLLOW_dateop_in_datecrit464);
-+ o=dateop(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatecritEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_DOWN, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatecritEx;
-+ }
-+
-+ f = (pANTLR3_BASE_TREE) MATCHT(FIELD, &FOLLOW_FIELD_in_datecrit470);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatecritEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_datespec_in_datecrit476);
-+ d=datespec(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatecritEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_UP, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatecritEx;
-+ }
-+
-+ {
-+
-+ char *op;
-+ const struct rsp_query_field_map *rqfp;
-+ pANTLR3_STRING field;
-+ char buf[32];
-+ int ret;
-+
-+ op = NULL;
-+ switch (o->getType(o))
-+ {
-+ case BEFORE:
-+ op = " < ";
-+ break;
-+
-+ case AFTER:
-+ op = " > ";
-+ break;
-+ }
-+
-+ field = f->getText(f);
-+
-+ /* Field lookup */
-+ rqfp = rsp_query_field_lookup((char *)field->chars, strlen((char *)field->chars));
-+ if (!rqfp)
-+ {
-+ DPRINTF(E_LOG, L_RSP, "Field '%s' is not a valid field in queries\n", field->chars);
-+ retval.valid= 0;
-+ goto datecrit_valid_0; /* ABORT */
-+ }
-+
-+ /* Check field type */
-+ if (rqfp->field_type != RSP_TYPE_DATE)
-+ {
-+ DPRINTF(E_LOG, L_RSP, "Field '%s' is not a date field\n", field->chars);
-+ retval.valid= 0;
-+ goto datecrit_valid_0; /* ABORT */
-+ }
-+
-+ ret = snprintf(buf, sizeof(buf), "%ld", d.date);
-+ if ((ret < 0) || (ret >= sizeof(buf)))
-+ {
-+ DPRINTF(E_LOG, L_RSP, "Date %ld too large for buffer, oops!\n", d.date);
-+ retval.valid= 0;
-+ goto datecrit_valid_0; /* ABORT */
-+ }
-+
-+ retval.result= field->factory->newRaw(field->factory);
-+ retval.result->append8(retval.result, "f.");
-+ retval.result->appendS(retval.result, field);
-+ retval.result->append8(retval.result, op);
-+ retval.result->append8(retval.result, buf);
-+
-+ datecrit_valid_0:
-+ ;
-+
-+ }
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruledatecritEx; /* Prevent compiler warnings */
-+ ruledatecritEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end datecrit */
-+
-+/**
-+ * $ANTLR start dateop
-+ * RSP2SQL.g:377:1: dateop returns [ pANTLR3_COMMON_TOKEN op ] : (n= BEFORE | n= AFTER );
-+ */
-+static pANTLR3_COMMON_TOKEN
-+dateop(pRSP2SQL ctx)
-+{
-+ pANTLR3_COMMON_TOKEN op = NULL;
-+
-+ pANTLR3_BASE_TREE n;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ op= NULL;
-+ n = NULL;
-+
-+ {
-+ {
-+ // RSP2SQL.g:379:2: (n= BEFORE | n= AFTER )
-+
-+ ANTLR3_UINT32 alt4;
-+
-+ alt4=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case BEFORE:
-+ {
-+ alt4=1;
-+ }
-+ break;
-+ case AFTER:
-+ {
-+ alt4=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruledateopEx;
-+ }
-+
-+ switch (alt4)
-+ {
-+ case 1:
-+ // RSP2SQL.g:379:4: n= BEFORE
-+ {
-+ n = (pANTLR3_BASE_TREE) MATCHT(BEFORE, &FOLLOW_BEFORE_in_dateop505);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledateopEx;
-+ }
-+
-+ {
-+ op= n->getToken(n);
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP2SQL.g:381:4: n= AFTER
-+ {
-+ n = (pANTLR3_BASE_TREE) MATCHT(AFTER, &FOLLOW_AFTER_in_dateop518);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledateopEx;
-+ }
-+
-+ {
-+ op= n->getToken(n);
-+ }
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruledateopEx; /* Prevent compiler warnings */
-+ ruledateopEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return op;
-+}
-+/* $ANTLR end dateop */
-+
-+/**
-+ * $ANTLR start datespec
-+ * RSP2SQL.g:385:1: datespec returns [ time_t date, int valid ] : (r= dateref | ^(o= dateop r= dateref m= INT i= dateintval ) );
-+ */
-+static RSP2SQL_datespec_return
-+datespec(pRSP2SQL ctx)
-+{
-+ RSP2SQL_datespec_return retval;
-+
-+ pANTLR3_BASE_TREE m;
-+ RSP2SQL_dateref_return r;
-+ #undef RETURN_TYPE_r
-+ #define RETURN_TYPE_r RSP2SQL_dateref_return
-+
-+ pANTLR3_COMMON_TOKEN o;
-+ #undef RETURN_TYPE_o
-+ #define RETURN_TYPE_o pANTLR3_COMMON_TOKEN
-+
-+ RSP2SQL_dateintval_return i;
-+ #undef RETURN_TYPE_i
-+ #define RETURN_TYPE_i RSP2SQL_dateintval_return
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ retval.date= 0; retval.valid= 1;
-+ m = NULL;
-+ o = NULL;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ {
-+ {
-+ // RSP2SQL.g:387:2: (r= dateref | ^(o= dateop r= dateref m= INT i= dateintval ) )
-+
-+ ANTLR3_UINT32 alt5;
-+
-+ alt5=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case DATE:
-+ case TODAY:
-+ {
-+ alt5=1;
-+ }
-+ break;
-+ case BEFORE:
-+ case AFTER:
-+ {
-+ alt5=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 5;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruledatespecEx;
-+ }
-+
-+ switch (alt5)
-+ {
-+ case 1:
-+ // RSP2SQL.g:387:4: r= dateref
-+ {
-+ FOLLOWPUSH(FOLLOW_dateref_in_datespec546);
-+ r=dateref(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatespecEx;
-+ }
-+
-+ {
-+
-+ if (!r.valid)
-+ retval.valid= 0;
-+ else
-+ retval.date= r.date;
-+
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP2SQL.g:394:4: ^(o= dateop r= dateref m= INT i= dateintval )
-+ {
-+ FOLLOWPUSH(FOLLOW_dateop_in_datespec560);
-+ o=dateop(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatespecEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_DOWN, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatespecEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_dateref_in_datespec566);
-+ r=dateref(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatespecEx;
-+ }
-+
-+ m = (pANTLR3_BASE_TREE) MATCHT(INT, &FOLLOW_INT_in_datespec572);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatespecEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_dateintval_in_datespec578);
-+ i=dateintval(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatespecEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_UP, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatespecEx;
-+ }
-+
-+ {
-+
-+ int32_t val;
-+ int ret;
-+
-+ if (!r.valid || !i.valid)
-+ {
-+ retval.valid= 0;
-+ goto datespec_valid_0; /* ABORT */
-+ }
-+
-+ ret = safe_atoi32((char *)m->getText(m)->chars, &val);
-+ if (ret < 0)
-+ {
-+ DPRINTF(E_LOG, L_RSP, "Could not convert '%s' to integer\n", (char *)m->getText(m));
-+ retval.valid= 0;
-+ goto datespec_valid_0; /* ABORT */
-+ }
-+
-+ switch (o->getType(o))
-+ {
-+ case BEFORE:
-+ retval.date= r.date - (val * i.period);
-+ break;
-+
-+ case AFTER:
-+ retval.date= r.date + (val * i.period);
-+ break;
-+ }
-+
-+ datespec_valid_0:
-+ ;
-+
-+ }
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruledatespecEx; /* Prevent compiler warnings */
-+ ruledatespecEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end datespec */
-+
-+/**
-+ * $ANTLR start dateref
-+ * RSP2SQL.g:429:1: dateref returns [ time_t date, int valid ] : (n= DATE | TODAY );
-+ */
-+static RSP2SQL_dateref_return
-+dateref(pRSP2SQL ctx)
-+{
-+ RSP2SQL_dateref_return retval;
-+
-+ pANTLR3_BASE_TREE n;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ retval.date= 0; retval.valid= 1;
-+ n = NULL;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ {
-+ {
-+ // RSP2SQL.g:431:2: (n= DATE | TODAY )
-+
-+ ANTLR3_UINT32 alt6;
-+
-+ alt6=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case DATE:
-+ {
-+ alt6=1;
-+ }
-+ break;
-+ case TODAY:
-+ {
-+ alt6=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 6;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruledaterefEx;
-+ }
-+
-+ switch (alt6)
-+ {
-+ case 1:
-+ // RSP2SQL.g:431:4: n= DATE
-+ {
-+ n = (pANTLR3_BASE_TREE) MATCHT(DATE, &FOLLOW_DATE_in_dateref607);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledaterefEx;
-+ }
-+
-+ {
-+
-+ struct tm tm;
-+ char *ret;
-+
-+ ret = strptime((char *)n->getText(n), "%Y-%m-%d", &tm);
-+ if (!ret)
-+ {
-+ DPRINTF(E_LOG, L_RSP, "Date '%s' could not be interpreted\n", (char *)n->getText(n));
-+ retval.valid= 0;
-+ goto dateref_valid_0; /* ABORT */
-+ }
-+ else
-+ {
-+ if (*ret != '\0')
-+ DPRINTF(E_LOG, L_RSP, "Garbage at end of date '%s' ?!\n", (char *)n->getText(n));
-+
-+ retval.date= mktime(&tm);
-+ if (retval.date == (time_t) -1)
-+ {
-+ DPRINTF(E_LOG, L_RSP, "Date '%s' could not be converted to an epoch\n", (char *)n->getText(n));
-+ retval.valid= 0;
-+ goto dateref_valid_0; /* ABORT */
-+ }
-+ }
-+
-+ dateref_valid_0:
-+ ;
-+
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP2SQL.g:460:4: TODAY
-+ {
-+ MATCHT(TODAY, &FOLLOW_TODAY_in_dateref616);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledaterefEx;
-+ }
-+
-+ {
-+ retval.date= time(NULL);
-+ }
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruledaterefEx; /* Prevent compiler warnings */
-+ ruledaterefEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end dateref */
-+
-+/**
-+ * $ANTLR start dateintval
-+ * RSP2SQL.g:464:1: dateintval returns [ time_t period, int valid ] : ( DAY | WEEK | MONTH | YEAR );
-+ */
-+static RSP2SQL_dateintval_return
-+dateintval(pRSP2SQL ctx)
-+{
-+ RSP2SQL_dateintval_return retval;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ retval.period= 0; retval.valid= 1;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ {
-+ {
-+ // RSP2SQL.g:466:2: ( DAY | WEEK | MONTH | YEAR )
-+
-+ ANTLR3_UINT32 alt7;
-+
-+ alt7=4;
-+
-+ switch ( LA(1) )
-+ {
-+ case DAY:
-+ {
-+ alt7=1;
-+ }
-+ break;
-+ case WEEK:
-+ {
-+ alt7=2;
-+ }
-+ break;
-+ case MONTH:
-+ {
-+ alt7=3;
-+ }
-+ break;
-+ case YEAR:
-+ {
-+ alt7=4;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 7;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruledateintvalEx;
-+ }
-+
-+ switch (alt7)
-+ {
-+ case 1:
-+ // RSP2SQL.g:466:4: DAY
-+ {
-+ MATCHT(DAY, &FOLLOW_DAY_in_dateintval640);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledateintvalEx;
-+ }
-+
-+ {
-+ retval.period= 24 * 60 * 60;
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP2SQL.g:468:4: WEEK
-+ {
-+ MATCHT(WEEK, &FOLLOW_WEEK_in_dateintval649);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledateintvalEx;
-+ }
-+
-+ {
-+ retval.period= 7 * 24 * 60 * 60;
-+ }
-+
-+ }
-+ break;
-+ case 3:
-+ // RSP2SQL.g:470:4: MONTH
-+ {
-+ MATCHT(MONTH, &FOLLOW_MONTH_in_dateintval658);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledateintvalEx;
-+ }
-+
-+ {
-+ retval.period= 30 * 24 * 60 * 60;
-+ }
-+
-+ }
-+ break;
-+ case 4:
-+ // RSP2SQL.g:472:4: YEAR
-+ {
-+ MATCHT(YEAR, &FOLLOW_YEAR_in_dateintval667);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledateintvalEx;
-+ }
-+
-+ {
-+ retval.period= 365 * 24 * 60 * 60;
-+ }
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruledateintvalEx; /* Prevent compiler warnings */
-+ ruledateintvalEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end dateintval */
-+/* End of parsing rules
-+ * ==============================================
-+ */
-+
-+/* ==============================================
-+ * Syntactic predicates
-+ */
-+/* End of syntactic predicates
-+ * ==============================================
-+ */
-+
-+
-+
-+
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/RSP2SQL.h b/src/pregen/RSP2SQL.h
-new file mode 100644
-index 0000000..08ac7bb
---- /dev/null
-+++ b/src/pregen/RSP2SQL.h
-@@ -0,0 +1,291 @@
-+/** \file
-+ * This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : RSP2SQL.g
-+ * - On : 2016-01-01 12:23:43
-+ * - for the tree parser : RSP2SQLTreeParser *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The tree parser RSP2SQL has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ *
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pRSP2SQL, which is returned from a call to RSP2SQLNew().
-+ *
-+ * The methods in pRSP2SQL are as follows:
-+ *
-+ * - pANTLR3_STRING pRSP2SQL->query(pRSP2SQL)
-+ * - RSP2SQL_expr_return pRSP2SQL->expr(pRSP2SQL)
-+ * - RSP2SQL_strcrit_return pRSP2SQL->strcrit(pRSP2SQL)
-+ * - pANTLR3_COMMON_TOKEN pRSP2SQL->strop(pRSP2SQL)
-+ * - RSP2SQL_intcrit_return pRSP2SQL->intcrit(pRSP2SQL)
-+ * - pANTLR3_COMMON_TOKEN pRSP2SQL->intop(pRSP2SQL)
-+ * - RSP2SQL_datecrit_return pRSP2SQL->datecrit(pRSP2SQL)
-+ * - pANTLR3_COMMON_TOKEN pRSP2SQL->dateop(pRSP2SQL)
-+ * - RSP2SQL_datespec_return pRSP2SQL->datespec(pRSP2SQL)
-+ * - RSP2SQL_dateref_return pRSP2SQL->dateref(pRSP2SQL)
-+ * - RSP2SQL_dateintval_return pRSP2SQL->dateintval(pRSP2SQL)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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 _RSP2SQL_H
-+#define _RSP2SQL_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct RSP2SQL_Ctx_struct RSP2SQL, * pRSP2SQL;
-+
-+
-+
-+ /* Needs #define _GNU_SOURCE for strptime() */
-+
-+ #include <stdio.h>
-+ #include <string.h>
-+ #include <time.h>
-+ #include <stdint.h>
-+
-+ #include "logger.h"
-+ #include "db.h"
-+ #include "misc.h"
-+ #include "rsp_query.h"
-+
-+
-+#ifdef ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter, - Rules with parameters that are not used
-+// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
-+// initialized but unused variable - tree rewrite variables declared but not needed
-+// Unreferenced local variable - lexer rule declares but does not always use _type
-+// potentially unitialized variable used - retval always returned from a rule
-+// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+typedef struct RSP2SQL_expr_return_struct
-+{
-+ pANTLR3_BASE_TREE start;
-+ pANTLR3_BASE_TREE stop;
-+ pANTLR3_STRING result;
-+ int valid;
-+}
-+ RSP2SQL_expr_return;
-+
-+typedef struct RSP2SQL_strcrit_return_struct
-+{
-+ pANTLR3_BASE_TREE start;
-+ pANTLR3_BASE_TREE stop;
-+ pANTLR3_STRING result;
-+ int valid;
-+}
-+ RSP2SQL_strcrit_return;
-+
-+typedef struct RSP2SQL_intcrit_return_struct
-+{
-+ pANTLR3_BASE_TREE start;
-+ pANTLR3_BASE_TREE stop;
-+ pANTLR3_STRING result;
-+ int valid;
-+}
-+ RSP2SQL_intcrit_return;
-+
-+typedef struct RSP2SQL_datecrit_return_struct
-+{
-+ pANTLR3_BASE_TREE start;
-+ pANTLR3_BASE_TREE stop;
-+ pANTLR3_STRING result;
-+ int valid;
-+}
-+ RSP2SQL_datecrit_return;
-+
-+typedef struct RSP2SQL_datespec_return_struct
-+{
-+ pANTLR3_BASE_TREE start;
-+ pANTLR3_BASE_TREE stop;
-+ time_t date;
-+ int valid;
-+}
-+ RSP2SQL_datespec_return;
-+
-+typedef struct RSP2SQL_dateref_return_struct
-+{
-+ pANTLR3_BASE_TREE start;
-+ pANTLR3_BASE_TREE stop;
-+ time_t date;
-+ int valid;
-+}
-+ RSP2SQL_dateref_return;
-+
-+typedef struct RSP2SQL_dateintval_return_struct
-+{
-+ pANTLR3_BASE_TREE start;
-+ pANTLR3_BASE_TREE stop;
-+ time_t period;
-+ int valid;
-+}
-+ RSP2SQL_dateintval_return;
-+
-+
-+
-+/** Context tracking structure for RSP2SQL
-+ */
-+struct RSP2SQL_Ctx_struct
-+{
-+ /** Built in ANTLR3 context tracker contains all the generic elements
-+ * required for context tracking.
-+ */
-+ pANTLR3_TREE_PARSER pTreeParser;
-+
-+
-+ pANTLR3_STRING (*query) (struct RSP2SQL_Ctx_struct * ctx);
-+ RSP2SQL_expr_return (*expr) (struct RSP2SQL_Ctx_struct * ctx);
-+ RSP2SQL_strcrit_return (*strcrit) (struct RSP2SQL_Ctx_struct * ctx);
-+ pANTLR3_COMMON_TOKEN (*strop) (struct RSP2SQL_Ctx_struct * ctx);
-+ RSP2SQL_intcrit_return (*intcrit) (struct RSP2SQL_Ctx_struct * ctx);
-+ pANTLR3_COMMON_TOKEN (*intop) (struct RSP2SQL_Ctx_struct * ctx);
-+ RSP2SQL_datecrit_return (*datecrit) (struct RSP2SQL_Ctx_struct * ctx);
-+ pANTLR3_COMMON_TOKEN (*dateop) (struct RSP2SQL_Ctx_struct * ctx);
-+ RSP2SQL_datespec_return (*datespec) (struct RSP2SQL_Ctx_struct * ctx);
-+ RSP2SQL_dateref_return (*dateref) (struct RSP2SQL_Ctx_struct * ctx);
-+ RSP2SQL_dateintval_return (*dateintval) (struct RSP2SQL_Ctx_struct * ctx);
-+ // Delegated rules
-+ const char * (*getGrammarFileName)();
-+ void (*free) (struct RSP2SQL_Ctx_struct * ctx);
-+
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pRSP2SQL RSP2SQLNew (pANTLR3_COMMON_TREE_NODE_STREAM instream);
-+ANTLR3_API pRSP2SQL RSP2SQLNewSSD (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the tree parser will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef EOF
-+#undef EOF
-+#endif
-+#ifdef Tokens
-+#undef Tokens
-+#endif
-+#define STARTSW 14
-+#define WEEK 26
-+#define TODAY 24
-+#define YEAR 28
-+#define ENDSW 15
-+#define GTE 20
-+#define BEFORE 21
-+#define DAY 25
-+#define INT 16
-+#define NOT 11
-+#define AFTER 22
-+#define AND 6
-+#define EOF -1
-+#define LTE 19
-+#define MONTH 27
-+#define DIGIT19 31
-+#define INCLUDES 13
-+#define STR 10
-+#define QUOTE 29
-+#define GREATER 18
-+#define WS 30
-+#define LPAR 7
-+#define NEWLINE 4
-+#define EQUAL 12
-+#define OR 5
-+#define LESS 17
-+#define FIELD 9
-+#define RPAR 8
-+#define ESCAPED 33
-+#define DATE 23
-+#define DIGIT09 32
-+#ifdef EOF
-+#undef EOF
-+#define EOF ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for RSP2SQL
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/RSP2SQL.u b/src/pregen/RSP2SQL.u
-new file mode 100644
-index 0000000..53d8cda
---- /dev/null
-+++ b/src/pregen/RSP2SQL.u
-@@ -0,0 +1,5 @@
-+RSP2SQL.g: RSP.tokens
-+RSP2SQL.c : RSP2SQL.g
-+./RSP2SQL.tokens : RSP2SQL.g
-+RSP2SQL.h : RSP2SQL.g
-+ANTLR_PRODUCTS += RSP2SQL.c ./RSP2SQL.tokens RSP2SQL.h
-\ No newline at end of file
-diff --git a/src/pregen/RSPLexer.c b/src/pregen/RSPLexer.c
-new file mode 100644
-index 0000000..2e3faae
---- /dev/null
-+++ b/src/pregen/RSPLexer.c
-@@ -0,0 +1,4867 @@
-+/** \file
-+ * This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : RSP.g
-+ * - On : 2016-01-01 12:23:42
-+ * - for the lexer : RSPLexerLexer *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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.
-+
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include "RSPLexer.h"
-+/* ----------------------------------------- */
-+
-+
-+/** String literals used by RSPLexer that we must do things like MATCHS() with.
-+ * C will normally just lay down 8 bit characters, and you can use L"xxx" to
-+ * get wchar_t, but wchar_t is 16 bits on Windows, which is not UTF32 and so
-+ * we perform this little trick of defining the literals as arrays of UINT32
-+ * and passing in the address of these.
-+ */
-+static ANTLR3_UCHAR lit_1[] = { 0x61, 0x6E, 0x64, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_2[] = { 0x6F, 0x72, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_3[] = { 0x69, 0x6E, 0x63, 0x6C, 0x75, 0x64, 0x65, 0x73, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_4[] = { 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x77, 0x69, 0x74, 0x68, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_5[] = { 0x65, 0x6E, 0x64, 0x73, 0x77, 0x69, 0x74, 0x68, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_6[] = { 0x3E, 0x3D, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_7[] = { 0x3C, 0x3D, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_8[] = { 0x62, 0x65, 0x66, 0x6F, 0x72, 0x65, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_9[] = { 0x61, 0x66, 0x74, 0x65, 0x72, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_10[] = { 0x64, 0x61, 0x79, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_11[] = { 0x64, 0x61, 0x79, 0x73, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_12[] = { 0x77, 0x65, 0x65, 0x6B, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_13[] = { 0x77, 0x65, 0x65, 0x6B, 0x73, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_14[] = { 0x6D, 0x6F, 0x6E, 0x74, 0x68, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_15[] = { 0x6D, 0x6F, 0x6E, 0x74, 0x68, 0x73, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_16[] = { 0x79, 0x65, 0x61, 0x72, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_17[] = { 0x79, 0x65, 0x61, 0x72, 0x73, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_18[] = { 0x74, 0x6F, 0x64, 0x61, 0x79, ANTLR3_STRING_TERMINATOR};
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+
-+#define CTX ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef SCOPE_TYPE
-+#undef SCOPE_STACK
-+#undef SCOPE_TOP
-+#define SCOPE_TYPE(scope) pRSPLexer_##scope##_SCOPE
-+#define SCOPE_STACK(scope) pRSPLexer_##scope##Stack
-+#define SCOPE_TOP(scope) ctx->pRSPLexer_##scope##Top
-+#define SCOPE_SIZE(scope) ctx->pRSPLexer_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i) (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+
-+/* Macros for accessing things in a lexer
-+ */
-+#undef LEXER
-+#undef RECOGNIZER
-+#undef RULEMEMO
-+#undef GETCHARINDEX
-+#undef GETLINE
-+#undef GETCHARPOSITIONINLINE
-+#undef EMIT
-+#undef EMITNEW
-+#undef MATCHC
-+#undef MATCHS
-+#undef MATCHRANGE
-+#undef LTOKEN
-+#undef HASFAILED
-+#undef FAILEDFLAG
-+#undef INPUT
-+#undef STRSTREAM
-+#undef LA
-+#undef HASEXCEPTION
-+#undef EXCEPTION
-+#undef CONSTRUCTEX
-+#undef CONSUME
-+#undef LRECOVER
-+#undef MARK
-+#undef REWIND
-+#undef REWINDLAST
-+#undef BACKTRACKING
-+#undef MATCHANY
-+#undef MEMOIZE
-+#undef HAVEPARSEDRULE
-+#undef GETTEXT
-+#undef INDEX
-+#undef SEEK
-+#undef PUSHSTREAM
-+#undef POPSTREAM
-+#undef SETTEXT
-+#undef SETTEXT8
-+
-+#define LEXER ctx->pLexer
-+#define RECOGNIZER LEXER->rec
-+#define LEXSTATE RECOGNIZER->state
-+#define TOKSOURCE LEXSTATE->tokSource
-+#define GETCHARINDEX() LEXER->getCharIndex(LEXER)
-+#define GETLINE() LEXER->getLine(LEXER)
-+#define GETTEXT() LEXER->getText(LEXER)
-+#define GETCHARPOSITIONINLINE() LEXER->getCharPositionInLine(LEXER)
-+#define EMIT() LEXSTATE->type = _type; LEXER->emit(LEXER)
-+#define EMITNEW(t) LEXER->emitNew(LEXER, t)
-+#define MATCHC(c) LEXER->matchc(LEXER, c)
-+#define MATCHS(s) LEXER->matchs(LEXER, s)
-+#define MATCHRANGE(c1,c2) LEXER->matchRange(LEXER, c1, c2)
-+#define MATCHANY() LEXER->matchAny(LEXER)
-+#define LTOKEN LEXSTATE->token
-+#define HASFAILED() (LEXSTATE->failed == ANTLR3_TRUE)
-+#define BACKTRACKING LEXSTATE->backtracking
-+#define FAILEDFLAG LEXSTATE->failed
-+#define INPUT LEXER->input
-+#define STRSTREAM INPUT
-+#define ISTREAM INPUT->istream
-+#define INDEX() ISTREAM->index(ISTREAM)
-+#define SEEK(n) ISTREAM->seek(ISTREAM, n)
-+#define EOF_TOKEN &(LEXSTATE->tokSource->eofToken)
-+#define HASEXCEPTION() (LEXSTATE->error == ANTLR3_TRUE)
-+#define EXCEPTION LEXSTATE->exception
-+#define CONSTRUCTEX() RECOGNIZER->exConstruct(RECOGNIZER)
-+#define LRECOVER() LEXER->recover(LEXER)
-+#define MARK() ISTREAM->mark(ISTREAM)
-+#define REWIND(m) ISTREAM->rewind(ISTREAM, m)
-+#define REWINDLAST() ISTREAM->rewindLast(ISTREAM)
-+#define MEMOIZE(ri,si) RECOGNIZER->memoize(RECOGNIZER, ri, si)
-+#define HAVEPARSEDRULE(r) RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define PUSHSTREAM(str) LEXER->pushCharStream(LEXER, str)
-+#define POPSTREAM() LEXER->popCharStream(LEXER)
-+#define SETTEXT(str) LEXSTATE->text = str
-+#define SKIP() LEXSTATE->token = &(TOKSOURCE->skipToken)
-+#define USER1 LEXSTATE->user1
-+#define USER2 LEXSTATE->user2
-+#define USER3 LEXSTATE->user3
-+#define CUSTOM LEXSTATE->custom
-+#define RULEMEMO LEXSTATE->ruleMemo
-+#define DBG RECOGNIZER->debugger
-+
-+/* If we have been told we can rely on the standard 8 bit or 16 bit input
-+ * stream, then we can define our macros to use the direct pointers
-+ * in the input object, which is much faster than indirect calls. This
-+ * is really only significant to lexers with a lot of fragment rules (which
-+ * do not place LA(1) in a temporary at the moment) and even then
-+ * only if there is a lot of input (order of say 1M or so).
-+ */
-+#if defined(ANTLR3_INLINE_INPUT_ASCII) || defined(ANTLR3_INLINE_INPUT_UTF16)
-+
-+# ifdef ANTLR3_INLINE_INPUT_ASCII
-+
-+/* 8 bit "ASCII" (actually any 8 bit character set) */
-+
-+# define NEXTCHAR ((pANTLR3_UINT8)(INPUT->nextChar))
-+# define DATAP ((pANTLR3_UINT8)(INPUT->data))
-+
-+# else
-+
-+# define NEXTCHAR ((pANTLR3_UINT16)(INPUT->nextChar))
-+# define DATAP ((pANTLR3_UINT16)(INPUT->data))
-+
-+# endif
-+
-+# define LA(n) ((NEXTCHAR + n) > (DATAP + INPUT->sizeBuf) ? ANTLR3_CHARSTREAM_EOF : (ANTLR3_UCHAR)(*(NEXTCHAR + n - 1)))
-+# define CONSUME() \
-+{ \
-+ if (NEXTCHAR < (DATAP + INPUT->sizeBuf)) \
-+ { \
-+ INPUT->charPositionInLine++; \
-+ if ((ANTLR3_UCHAR)(*NEXTCHAR) == INPUT->newlineChar) \
-+ { \
-+ INPUT->line++; \
-+ INPUT->charPositionInLine = 0; \
-+ INPUT->currentLine = (void *)(NEXTCHAR + 1); \
-+ } \
-+ INPUT->nextChar = (void *)(NEXTCHAR + 1); \
-+ } \
-+}
-+
-+#else
-+
-+// Pick up the input character by calling the input stream implementation.
-+//
-+#define CONSUME() INPUT->istream->consume(INPUT->istream)
-+#define LA(n) INPUT->istream->_LA(INPUT->istream, n)
-+
-+#endif
-+#define TOKTEXT(tok, txt) tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define UP ANTLR3_TOKEN_UP
-+#define DOWN ANTLR3_TOKEN_DOWN
-+#define EOR ANTLR3_TOKEN_EOR
-+#define INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+/* Forward declare the locally static matching functions we have generated and any predicate functions.
-+ */
-+static ANTLR3_INLINE void mQUOTE (pRSPLexer ctx);
-+static ANTLR3_INLINE void mLPAR (pRSPLexer ctx);
-+static ANTLR3_INLINE void mRPAR (pRSPLexer ctx);
-+static ANTLR3_INLINE void mAND (pRSPLexer ctx);
-+static ANTLR3_INLINE void mOR (pRSPLexer ctx);
-+static ANTLR3_INLINE void mNOT (pRSPLexer ctx);
-+static ANTLR3_INLINE void mEQUAL (pRSPLexer ctx);
-+static ANTLR3_INLINE void mINCLUDES (pRSPLexer ctx);
-+static ANTLR3_INLINE void mSTARTSW (pRSPLexer ctx);
-+static ANTLR3_INLINE void mENDSW (pRSPLexer ctx);
-+static ANTLR3_INLINE void mGREATER (pRSPLexer ctx);
-+static ANTLR3_INLINE void mLESS (pRSPLexer ctx);
-+static ANTLR3_INLINE void mGTE (pRSPLexer ctx);
-+static ANTLR3_INLINE void mLTE (pRSPLexer ctx);
-+static ANTLR3_INLINE void mBEFORE (pRSPLexer ctx);
-+static ANTLR3_INLINE void mAFTER (pRSPLexer ctx);
-+static ANTLR3_INLINE void mDAY (pRSPLexer ctx);
-+static ANTLR3_INLINE void mWEEK (pRSPLexer ctx);
-+static ANTLR3_INLINE void mMONTH (pRSPLexer ctx);
-+static ANTLR3_INLINE void mYEAR (pRSPLexer ctx);
-+static ANTLR3_INLINE void mTODAY (pRSPLexer ctx);
-+static ANTLR3_INLINE void mNEWLINE (pRSPLexer ctx);
-+static ANTLR3_INLINE void mWS (pRSPLexer ctx);
-+static ANTLR3_INLINE void mFIELD (pRSPLexer ctx);
-+static ANTLR3_INLINE void mINT (pRSPLexer ctx);
-+static ANTLR3_INLINE void mDATE (pRSPLexer ctx);
-+static ANTLR3_INLINE void mSTR (pRSPLexer ctx);
-+static ANTLR3_INLINE void mESCAPED (pRSPLexer ctx);
-+static ANTLR3_INLINE void mDIGIT09 (pRSPLexer ctx);
-+static ANTLR3_INLINE void mDIGIT19 (pRSPLexer ctx);
-+static ANTLR3_INLINE void mTokens (pRSPLexer ctx);
-+static void RSPLexerFree(pRSPLexer ctx);
-+
-+/* =========================================================================
-+ * Lexer matching rules end.
-+ * =========================================================================
-+ */
-+
-+
-+
-+static void
-+RSPLexerFree (pRSPLexer ctx)
-+{
-+ LEXER->free(LEXER);
-+
-+ ANTLR3_FREE(ctx);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "RSP.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+ return fileName;
-+}
-+
-+/** \brief Create a new lexer called RSPLexer
-+ *
-+ * \param[in] instream Pointer to an initialized input stream
-+ * \return
-+ * - Success pRSPLexer initialized for the lex start
-+ * - Fail NULL
-+ */
-+ANTLR3_API pRSPLexer RSPLexerNew
-+(pANTLR3_INPUT_STREAM instream)
-+{
-+ // See if we can create a new lexer with the standard constructor
-+ //
-+ return RSPLexerNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new lexer called RSPLexer
-+ *
-+ * \param[in] instream Pointer to an initialized input stream
-+ * \param[state] state Previously created shared recognizer stat
-+ * \return
-+ * - Success pRSPLexer initialized for the lex start
-+ * - Fail NULL
-+ */
-+ANTLR3_API pRSPLexer RSPLexerNewSSD
-+(pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+ pRSPLexer ctx; // Context structure we will build and return
-+
-+ ctx = (pRSPLexer) ANTLR3_CALLOC(1, sizeof(RSPLexer));
-+
-+ if (ctx == NULL)
-+ {
-+ // Failed to allocate memory for lexer context
-+ return NULL;
-+ }
-+
-+ /* -------------------------------------------------------------------
-+ * Memory for basic structure is allocated, now to fill in
-+ * in base ANTLR3 structures. We initialize the function pointers
-+ * for the standard ANTLR3 lexer function set, but upon return
-+ * from here, the programmer may set the pointers to provide custom
-+ * implementations of each function.
-+ *
-+ * We don't use the macros defined in RSPLexer.h here so you can get a sense
-+ * of what goes where.
-+ */
-+
-+ /* Create a base lexer, using the supplied input stream
-+ */
-+ ctx->pLexer = antlr3LexerNewStream(ANTLR3_SIZE_HINT, instream, state);
-+
-+ /* Check that we allocated the memory correctly
-+ */
-+ if (ctx->pLexer == NULL)
-+ {
-+ ANTLR3_FREE(ctx);
-+ return NULL;
-+ }
-+ /* Install the implementation of our RSPLexer interface
-+ */
-+ ctx->mQUOTE = mQUOTE;
-+ ctx->mLPAR = mLPAR;
-+ ctx->mRPAR = mRPAR;
-+ ctx->mAND = mAND;
-+ ctx->mOR = mOR;
-+ ctx->mNOT = mNOT;
-+ ctx->mEQUAL = mEQUAL;
-+ ctx->mINCLUDES = mINCLUDES;
-+ ctx->mSTARTSW = mSTARTSW;
-+ ctx->mENDSW = mENDSW;
-+ ctx->mGREATER = mGREATER;
-+ ctx->mLESS = mLESS;
-+ ctx->mGTE = mGTE;
-+ ctx->mLTE = mLTE;
-+ ctx->mBEFORE = mBEFORE;
-+ ctx->mAFTER = mAFTER;
-+ ctx->mDAY = mDAY;
-+ ctx->mWEEK = mWEEK;
-+ ctx->mMONTH = mMONTH;
-+ ctx->mYEAR = mYEAR;
-+ ctx->mTODAY = mTODAY;
-+ ctx->mNEWLINE = mNEWLINE;
-+ ctx->mWS = mWS;
-+ ctx->mFIELD = mFIELD;
-+ ctx->mINT = mINT;
-+ ctx->mDATE = mDATE;
-+ ctx->mSTR = mSTR;
-+ ctx->mESCAPED = mESCAPED;
-+ ctx->mDIGIT09 = mDIGIT09;
-+ ctx->mDIGIT19 = mDIGIT19;
-+ ctx->mTokens = mTokens;
-+
-+ /** When the nextToken() call is made to this lexer's pANTLR3_TOKEN_SOURCE
-+ * it will call mTokens() in this generated code, and will pass it the ctx
-+ * pointer of this lexer, not the context of the base lexer, so store that now.
-+ */
-+ ctx->pLexer->ctx = ctx;
-+
-+ /**Install the token matching function
-+ */
-+ ctx->pLexer->mTokens = (void (*) (void *))(mTokens);
-+
-+ ctx->getGrammarFileName = getGrammarFileName;
-+ ctx->free = RSPLexerFree;
-+
-+
-+
-+
-+
-+ /* Return the newly built lexer to the caller
-+ */
-+ return ctx;
-+}
-+
-+
-+/* =========================================================================
-+ * Functions to match the lexer grammar defined tokens from the input stream
-+ */
-+
-+// Comes from: 85:7: ( '\"' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start QUOTE
-+ *
-+ * Looks to match the characters the constitute the token QUOTE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mQUOTE(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = QUOTE;
-+
-+
-+ // RSP.g:85:7: ( '\"' )
-+ // RSP.g:85:9: '\"'
-+ {
-+ MATCHC('"');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleQUOTEEx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleQUOTEEx; /* Prevent compiler warnings */
-+ ruleQUOTEEx: ;
-+
-+}
-+// $ANTLR end QUOTE
-+
-+// Comes from: 86:6: ( '(' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LPAR
-+ *
-+ * Looks to match the characters the constitute the token LPAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLPAR(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = LPAR;
-+
-+
-+ // RSP.g:86:6: ( '(' )
-+ // RSP.g:86:8: '('
-+ {
-+ MATCHC('(');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleLPAREx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleLPAREx; /* Prevent compiler warnings */
-+ ruleLPAREx: ;
-+
-+}
-+// $ANTLR end LPAR
-+
-+// Comes from: 87:6: ( ')' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start RPAR
-+ *
-+ * Looks to match the characters the constitute the token RPAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mRPAR(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = RPAR;
-+
-+
-+ // RSP.g:87:6: ( ')' )
-+ // RSP.g:87:8: ')'
-+ {
-+ MATCHC(')');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleRPAREx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleRPAREx; /* Prevent compiler warnings */
-+ ruleRPAREx: ;
-+
-+}
-+// $ANTLR end RPAR
-+
-+// Comes from: 89:5: ( 'and' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start AND
-+ *
-+ * Looks to match the characters the constitute the token AND
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mAND(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = AND;
-+
-+
-+ // RSP.g:89:5: ( 'and' )
-+ // RSP.g:89:7: 'and'
-+ {
-+ MATCHS(lit_1);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleANDEx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleANDEx; /* Prevent compiler warnings */
-+ ruleANDEx: ;
-+
-+}
-+// $ANTLR end AND
-+
-+// Comes from: 90:4: ( 'or' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start OR
-+ *
-+ * Looks to match the characters the constitute the token OR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mOR(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = OR;
-+
-+
-+ // RSP.g:90:4: ( 'or' )
-+ // RSP.g:90:6: 'or'
-+ {
-+ MATCHS(lit_2);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleOREx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleOREx; /* Prevent compiler warnings */
-+ ruleOREx: ;
-+
-+}
-+// $ANTLR end OR
-+
-+// Comes from: 91:5: ( '!' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start NOT
-+ *
-+ * Looks to match the characters the constitute the token NOT
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mNOT(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = NOT;
-+
-+
-+ // RSP.g:91:5: ( '!' )
-+ // RSP.g:91:7: '!'
-+ {
-+ MATCHC('!');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleNOTEx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleNOTEx; /* Prevent compiler warnings */
-+ ruleNOTEx: ;
-+
-+}
-+// $ANTLR end NOT
-+
-+// Comes from: 94:7: ( '=' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start EQUAL
-+ *
-+ * Looks to match the characters the constitute the token EQUAL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mEQUAL(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = EQUAL;
-+
-+
-+ // RSP.g:94:7: ( '=' )
-+ // RSP.g:94:9: '='
-+ {
-+ MATCHC('=');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleEQUALEx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleEQUALEx; /* Prevent compiler warnings */
-+ ruleEQUALEx: ;
-+
-+}
-+// $ANTLR end EQUAL
-+
-+// Comes from: 97:9: ( 'includes' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start INCLUDES
-+ *
-+ * Looks to match the characters the constitute the token INCLUDES
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mINCLUDES(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = INCLUDES;
-+
-+
-+ // RSP.g:97:9: ( 'includes' )
-+ // RSP.g:97:11: 'includes'
-+ {
-+ MATCHS(lit_3);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINCLUDESEx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleINCLUDESEx; /* Prevent compiler warnings */
-+ ruleINCLUDESEx: ;
-+
-+}
-+// $ANTLR end INCLUDES
-+
-+// Comes from: 98:9: ( 'startswith' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start STARTSW
-+ *
-+ * Looks to match the characters the constitute the token STARTSW
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mSTARTSW(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = STARTSW;
-+
-+
-+ // RSP.g:98:9: ( 'startswith' )
-+ // RSP.g:98:11: 'startswith'
-+ {
-+ MATCHS(lit_4);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTARTSWEx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleSTARTSWEx; /* Prevent compiler warnings */
-+ ruleSTARTSWEx: ;
-+
-+}
-+// $ANTLR end STARTSW
-+
-+// Comes from: 99:7: ( 'endswith' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start ENDSW
-+ *
-+ * Looks to match the characters the constitute the token ENDSW
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mENDSW(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = ENDSW;
-+
-+
-+ // RSP.g:99:7: ( 'endswith' )
-+ // RSP.g:99:9: 'endswith'
-+ {
-+ MATCHS(lit_5);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleENDSWEx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleENDSWEx; /* Prevent compiler warnings */
-+ ruleENDSWEx: ;
-+
-+}
-+// $ANTLR end ENDSW
-+
-+// Comes from: 102:9: ( '>' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start GREATER
-+ *
-+ * Looks to match the characters the constitute the token GREATER
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mGREATER(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = GREATER;
-+
-+
-+ // RSP.g:102:9: ( '>' )
-+ // RSP.g:102:11: '>'
-+ {
-+ MATCHC('>');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleGREATEREx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleGREATEREx; /* Prevent compiler warnings */
-+ ruleGREATEREx: ;
-+
-+}
-+// $ANTLR end GREATER
-+
-+// Comes from: 103:6: ( '<' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LESS
-+ *
-+ * Looks to match the characters the constitute the token LESS
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLESS(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = LESS;
-+
-+
-+ // RSP.g:103:6: ( '<' )
-+ // RSP.g:103:8: '<'
-+ {
-+ MATCHC('<');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleLESSEx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleLESSEx; /* Prevent compiler warnings */
-+ ruleLESSEx: ;
-+
-+}
-+// $ANTLR end LESS
-+
-+// Comes from: 104:5: ( '>=' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start GTE
-+ *
-+ * Looks to match the characters the constitute the token GTE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mGTE(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = GTE;
-+
-+
-+ // RSP.g:104:5: ( '>=' )
-+ // RSP.g:104:7: '>='
-+ {
-+ MATCHS(lit_6);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleGTEEx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleGTEEx; /* Prevent compiler warnings */
-+ ruleGTEEx: ;
-+
-+}
-+// $ANTLR end GTE
-+
-+// Comes from: 105:5: ( '<=' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LTE
-+ *
-+ * Looks to match the characters the constitute the token LTE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLTE(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = LTE;
-+
-+
-+ // RSP.g:105:5: ( '<=' )
-+ // RSP.g:105:7: '<='
-+ {
-+ MATCHS(lit_7);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleLTEEx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleLTEEx; /* Prevent compiler warnings */
-+ ruleLTEEx: ;
-+
-+}
-+// $ANTLR end LTE
-+
-+// Comes from: 108:8: ( 'before' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start BEFORE
-+ *
-+ * Looks to match the characters the constitute the token BEFORE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mBEFORE(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = BEFORE;
-+
-+
-+ // RSP.g:108:8: ( 'before' )
-+ // RSP.g:108:10: 'before'
-+ {
-+ MATCHS(lit_8);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleBEFOREEx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleBEFOREEx; /* Prevent compiler warnings */
-+ ruleBEFOREEx: ;
-+
-+}
-+// $ANTLR end BEFORE
-+
-+// Comes from: 109:7: ( 'after' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start AFTER
-+ *
-+ * Looks to match the characters the constitute the token AFTER
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mAFTER(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = AFTER;
-+
-+
-+ // RSP.g:109:7: ( 'after' )
-+ // RSP.g:109:9: 'after'
-+ {
-+ MATCHS(lit_9);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleAFTEREx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleAFTEREx; /* Prevent compiler warnings */
-+ ruleAFTEREx: ;
-+
-+}
-+// $ANTLR end AFTER
-+
-+// Comes from: 110:5: ( 'day' | 'days' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DAY
-+ *
-+ * Looks to match the characters the constitute the token DAY
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDAY(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = DAY;
-+
-+
-+ {
-+ // RSP.g:110:5: ( 'day' | 'days' )
-+
-+ ANTLR3_UINT32 alt1;
-+
-+ alt1=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case 'd':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'a':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'y':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 's':
-+ {
-+ alt1=2;
-+ }
-+ break;
-+
-+ default:
-+ alt1=1;}
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 2;
-+
-+
-+ goto ruleDAYEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 1;
-+
-+
-+ goto ruleDAYEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleDAYEx;
-+ }
-+
-+ switch (alt1)
-+ {
-+ case 1:
-+ // RSP.g:110:7: 'day'
-+ {
-+ MATCHS(lit_10);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDAYEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:110:15: 'days'
-+ {
-+ MATCHS(lit_11);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDAYEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleDAYEx; /* Prevent compiler warnings */
-+ ruleDAYEx: ;
-+
-+}
-+// $ANTLR end DAY
-+
-+// Comes from: 111:6: ( 'week' | 'weeks' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start WEEK
-+ *
-+ * Looks to match the characters the constitute the token WEEK
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mWEEK(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = WEEK;
-+
-+
-+ {
-+ // RSP.g:111:6: ( 'week' | 'weeks' )
-+
-+ ANTLR3_UINT32 alt2;
-+
-+ alt2=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case 'w':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'e':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'e':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 'k':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 's':
-+ {
-+ alt2=2;
-+ }
-+ break;
-+
-+ default:
-+ alt2=1;}
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 2;
-+ EXCEPTION->state = 3;
-+
-+
-+ goto ruleWEEKEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 2;
-+ EXCEPTION->state = 2;
-+
-+
-+ goto ruleWEEKEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 2;
-+ EXCEPTION->state = 1;
-+
-+
-+ goto ruleWEEKEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 2;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleWEEKEx;
-+ }
-+
-+ switch (alt2)
-+ {
-+ case 1:
-+ // RSP.g:111:8: 'week'
-+ {
-+ MATCHS(lit_12);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleWEEKEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:111:17: 'weeks'
-+ {
-+ MATCHS(lit_13);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleWEEKEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleWEEKEx; /* Prevent compiler warnings */
-+ ruleWEEKEx: ;
-+
-+}
-+// $ANTLR end WEEK
-+
-+// Comes from: 112:7: ( 'month' | 'months' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start MONTH
-+ *
-+ * Looks to match the characters the constitute the token MONTH
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mMONTH(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = MONTH;
-+
-+
-+ {
-+ // RSP.g:112:7: ( 'month' | 'months' )
-+
-+ ANTLR3_UINT32 alt3;
-+
-+ alt3=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case 'm':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'o':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'n':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 't':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 'h':
-+ {
-+ switch ( LA(6) )
-+ {
-+ case 's':
-+ {
-+ alt3=2;
-+ }
-+ break;
-+
-+ default:
-+ alt3=1;}
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 4;
-+
-+
-+ goto ruleMONTHEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 3;
-+
-+
-+ goto ruleMONTHEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 2;
-+
-+
-+ goto ruleMONTHEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 1;
-+
-+
-+ goto ruleMONTHEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleMONTHEx;
-+ }
-+
-+ switch (alt3)
-+ {
-+ case 1:
-+ // RSP.g:112:9: 'month'
-+ {
-+ MATCHS(lit_14);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleMONTHEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:112:19: 'months'
-+ {
-+ MATCHS(lit_15);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleMONTHEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleMONTHEx; /* Prevent compiler warnings */
-+ ruleMONTHEx: ;
-+
-+}
-+// $ANTLR end MONTH
-+
-+// Comes from: 113:6: ( 'year' | 'years' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start YEAR
-+ *
-+ * Looks to match the characters the constitute the token YEAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mYEAR(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = YEAR;
-+
-+
-+ {
-+ // RSP.g:113:6: ( 'year' | 'years' )
-+
-+ ANTLR3_UINT32 alt4;
-+
-+ alt4=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case 'y':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'e':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'a':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 'r':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 's':
-+ {
-+ alt4=2;
-+ }
-+ break;
-+
-+ default:
-+ alt4=1;}
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 3;
-+
-+
-+ goto ruleYEAREx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 2;
-+
-+
-+ goto ruleYEAREx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 1;
-+
-+
-+ goto ruleYEAREx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleYEAREx;
-+ }
-+
-+ switch (alt4)
-+ {
-+ case 1:
-+ // RSP.g:113:8: 'year'
-+ {
-+ MATCHS(lit_16);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleYEAREx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:113:17: 'years'
-+ {
-+ MATCHS(lit_17);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleYEAREx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleYEAREx; /* Prevent compiler warnings */
-+ ruleYEAREx: ;
-+
-+}
-+// $ANTLR end YEAR
-+
-+// Comes from: 114:7: ( 'today' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start TODAY
-+ *
-+ * Looks to match the characters the constitute the token TODAY
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mTODAY(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = TODAY;
-+
-+
-+ // RSP.g:114:7: ( 'today' )
-+ // RSP.g:114:9: 'today'
-+ {
-+ MATCHS(lit_18);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTODAYEx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleTODAYEx; /* Prevent compiler warnings */
-+ ruleTODAYEx: ;
-+
-+}
-+// $ANTLR end TODAY
-+
-+// Comes from: 116:9: ( ( '\\r' )? '\\n' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start NEWLINE
-+ *
-+ * Looks to match the characters the constitute the token NEWLINE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mNEWLINE(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = NEWLINE;
-+
-+
-+ // RSP.g:116:9: ( ( '\\r' )? '\\n' )
-+ // RSP.g:116:11: ( '\\r' )? '\\n'
-+ {
-+
-+ // RSP.g:116:11: ( '\\r' )?
-+ {
-+ int alt5=2;
-+ switch ( LA(1) )
-+ {
-+ case '\r':
-+ {
-+ alt5=1;
-+ }
-+ break;
-+ }
-+
-+ switch (alt5)
-+ {
-+ case 1:
-+ // RSP.g:116:11: '\\r'
-+ {
-+ MATCHC('\r');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleNEWLINEEx;
-+ }
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ MATCHC('\n');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleNEWLINEEx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleNEWLINEEx; /* Prevent compiler warnings */
-+ ruleNEWLINEEx: ;
-+
-+}
-+// $ANTLR end NEWLINE
-+
-+// Comes from: 118:4: ( ( ' ' | '\\t' ) )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start WS
-+ *
-+ * Looks to match the characters the constitute the token WS
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mWS(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = WS;
-+
-+
-+ // RSP.g:118:4: ( ( ' ' | '\\t' ) )
-+ // RSP.g:118:6: ( ' ' | '\\t' )
-+ {
-+ if ( LA(1) == '\t' || LA(1) == ' ' )
-+ {
-+ CONSUME();
-+
-+ }
-+ else
-+ {
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+ LRECOVER(); goto ruleWSEx;
-+ }
-+
-+ {
-+ LEXSTATE->channel = HIDDEN;
-+ }
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleWSEx; /* Prevent compiler warnings */
-+ ruleWSEx: ;
-+
-+}
-+// $ANTLR end WS
-+
-+// Comes from: 120:7: ( 'a' .. 'z' ( 'a' .. 'z' | '_' )* 'a' .. 'z' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start FIELD
-+ *
-+ * Looks to match the characters the constitute the token FIELD
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mFIELD(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = FIELD;
-+
-+
-+ // RSP.g:120:7: ( 'a' .. 'z' ( 'a' .. 'z' | '_' )* 'a' .. 'z' )
-+ // RSP.g:120:9: 'a' .. 'z' ( 'a' .. 'z' | '_' )* 'a' .. 'z'
-+ {
-+ MATCHRANGE('a', 'z');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleFIELDEx;
-+ }
-+
-+
-+ // RSP.g:120:18: ( 'a' .. 'z' | '_' )*
-+
-+ for (;;)
-+ {
-+ int alt6=2;
-+ switch ( LA(1) )
-+ {
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt6=1;
-+ }
-+ break;
-+
-+ }
-+
-+ }
-+ break;
-+ case '_':
-+ {
-+ alt6=1;
-+ }
-+ break;
-+
-+ }
-+
-+ switch (alt6)
-+ {
-+ case 1:
-+ // RSP.g:
-+ {
-+ if ( LA(1) == '_' || ((LA(1) >= 'a') && (LA(1) <= 'z')) )
-+ {
-+ CONSUME();
-+
-+ }
-+ else
-+ {
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+ LRECOVER(); goto ruleFIELDEx;
-+ }
-+
-+
-+ }
-+ break;
-+
-+ default:
-+ goto loop6; /* break out of the loop */
-+ break;
-+ }
-+ }
-+ loop6: ; /* Jump out to here if this rule does not match */
-+
-+ MATCHRANGE('a', 'z');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleFIELDEx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleFIELDEx; /* Prevent compiler warnings */
-+ ruleFIELDEx: ;
-+
-+}
-+// $ANTLR end FIELD
-+
-+// Comes from: 122:5: ( DIGIT19 ( DIGIT09 )* )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start INT
-+ *
-+ * Looks to match the characters the constitute the token INT
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mINT(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = INT;
-+
-+
-+ // RSP.g:122:5: ( DIGIT19 ( DIGIT09 )* )
-+ // RSP.g:122:7: DIGIT19 ( DIGIT09 )*
-+ {
-+ /* 122:7: DIGIT19 ( DIGIT09 )* */
-+ mDIGIT19(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINTEx;
-+ }
-+
-+
-+ // RSP.g:122:15: ( DIGIT09 )*
-+
-+ for (;;)
-+ {
-+ int alt7=2;
-+ switch ( LA(1) )
-+ {
-+ case '0':
-+ case '1':
-+ case '2':
-+ case '3':
-+ case '4':
-+ case '5':
-+ case '6':
-+ case '7':
-+ case '8':
-+ case '9':
-+ {
-+ alt7=1;
-+ }
-+ break;
-+
-+ }
-+
-+ switch (alt7)
-+ {
-+ case 1:
-+ // RSP.g:122:15: DIGIT09
-+ {
-+ /* 122:15: DIGIT09 */
-+ mDIGIT09(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINTEx;
-+ }
-+
-+
-+ }
-+ break;
-+
-+ default:
-+ goto loop7; /* break out of the loop */
-+ break;
-+ }
-+ }
-+ loop7: ; /* Jump out to here if this rule does not match */
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleINTEx; /* Prevent compiler warnings */
-+ ruleINTEx: ;
-+
-+}
-+// $ANTLR end INT
-+
-+// Comes from: 125:6: ( DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DATE
-+ *
-+ * Looks to match the characters the constitute the token DATE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDATE(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = DATE;
-+
-+
-+ // RSP.g:125:6: ( DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) )
-+ // RSP.g:125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' )
-+ {
-+ /* 125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) */
-+ mDIGIT19(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+ /* 125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) */
-+ mDIGIT09(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+ /* 125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) */
-+ mDIGIT09(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+ /* 125:8: DIGIT19 DIGIT09 DIGIT09 DIGIT09 '-' ( '0' DIGIT19 | '1' '0' .. '2' ) '-' ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' ) */
-+ mDIGIT09(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+ MATCHC('-');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ // RSP.g:125:44: ( '0' DIGIT19 | '1' '0' .. '2' )
-+ {
-+ int alt8=2;
-+ switch ( LA(1) )
-+ {
-+ case '0':
-+ {
-+ alt8=1;
-+ }
-+ break;
-+ case '1':
-+ {
-+ alt8=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 8;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleDATEEx;
-+ }
-+
-+ switch (alt8)
-+ {
-+ case 1:
-+ // RSP.g:125:45: '0' DIGIT19
-+ {
-+ MATCHC('0');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+ /* 125:45: '0' DIGIT19 */
-+ mDIGIT19(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:125:59: '1' '0' .. '2'
-+ {
-+ MATCHC('1');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+ MATCHRANGE('0', '2');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ MATCHC('-');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ // RSP.g:125:77: ( '0' DIGIT19 | '1' .. '2' DIGIT09 | '3' '0' .. '1' )
-+ {
-+ int alt9=3;
-+ switch ( LA(1) )
-+ {
-+ case '0':
-+ {
-+ alt9=1;
-+ }
-+ break;
-+ case '1':
-+ case '2':
-+ {
-+ alt9=2;
-+ }
-+ break;
-+ case '3':
-+ {
-+ alt9=3;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 9;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleDATEEx;
-+ }
-+
-+ switch (alt9)
-+ {
-+ case 1:
-+ // RSP.g:125:78: '0' DIGIT19
-+ {
-+ MATCHC('0');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+ /* 125:78: '0' DIGIT19 */
-+ mDIGIT19(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:125:92: '1' .. '2' DIGIT09
-+ {
-+ MATCHRANGE('1', '2');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+ /* 125:92: '1' .. '2' DIGIT09 */
-+ mDIGIT09(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // RSP.g:125:111: '3' '0' .. '1'
-+ {
-+ MATCHC('3');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+ MATCHRANGE('0', '1');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleDATEEx; /* Prevent compiler warnings */
-+ ruleDATEEx: ;
-+
-+}
-+// $ANTLR end DATE
-+
-+// Comes from: 133:2: ( QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start STR
-+ *
-+ * Looks to match the characters the constitute the token STR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mSTR(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+ pANTLR3_COMMON_TOKEN esc;
-+ ANTLR3_UINT32 reg;
-+
-+
-+ esc = NULL;
-+
-+ _type = STR;
-+
-+ pANTLR3_STRING unesc = GETTEXT()->factory->newRaw(GETTEXT()->factory);
-+
-+ // RSP.g:133:2: ( QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE )
-+ // RSP.g:133:4: QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE
-+ {
-+ /* 133:4: QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE */
-+ mQUOTE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTREx;
-+ }
-+
-+ // RSP.g:133:10: (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+
-+ {
-+ int cnt10=0;
-+
-+ for (;;)
-+ {
-+ int alt10=3;
-+ {
-+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
-+ */
-+ int LA10_0 = LA(1);
-+ if ( (((LA10_0 >= 0x0000) && (LA10_0 <= '!')) || ((LA10_0 >= '#') && (LA10_0 <= '[')) || ((LA10_0 >= ']') && (LA10_0 <= 0xFFFF))) )
-+ {
-+ alt10=1;
-+ }
-+ else if ( (LA10_0 == '\\') )
-+ {
-+ alt10=2;
-+ }
-+
-+ }
-+ switch (alt10)
-+ {
-+ case 1:
-+ // RSP.g:133:12: reg=~ ( '\\\\' | '\"' )
-+ {
-+ reg= LA(1);
-+ if ( ((LA(1) >= 0x0000) && (LA(1) <= '!')) || ((LA(1) >= '#') && (LA(1) <= '[')) || ((LA(1) >= ']') && (LA(1) <= 0xFFFF)) )
-+ {
-+ CONSUME();
-+
-+ }
-+ else
-+ {
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+ LRECOVER(); goto ruleSTREx;
-+ }
-+
-+ {
-+ unesc->addc(unesc, reg);
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:134:6: esc= ESCAPED
-+ {
-+ /* 134:6: esc= ESCAPED */
-+ {
-+ ANTLR3_MARKER escStart381 = GETCHARINDEX();
-+ mESCAPED(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTREx;
-+ }
-+
-+ esc = LEXSTATE->tokFactory->newToken(LEXSTATE->tokFactory);
-+ esc->setType(esc, ANTLR3_TOKEN_INVALID);
-+ esc->setStartIndex(esc, escStart381);
-+ esc->setStopIndex(esc, GETCHARINDEX()-1);
-+ esc->input = INPUT;
-+ }
-+ {
-+ unesc->appendS(unesc, GETTEXT());
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+
-+ if ( cnt10 >= 1 )
-+ {
-+ goto loop10;
-+ }
-+ /* mismatchedSetEx()
-+ */
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
-+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
-+
-+
-+ goto ruleSTREx;
-+ }
-+ cnt10++;
-+ }
-+ loop10: ; /* Jump to here if this rule does not match */
-+ }
-+ /* 133:4: QUOTE (reg=~ ( '\\\\' | '\"' ) | esc= ESCAPED )+ QUOTE */
-+ mQUOTE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTREx;
-+ }
-+
-+ {
-+ SETTEXT(unesc);
-+ }
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleSTREx; /* Prevent compiler warnings */
-+ ruleSTREx: ;
-+
-+ esc = NULL;
-+
-+}
-+// $ANTLR end STR
-+
-+// Comes from: 138:9: ( '\\\\' ( '\\\\' | '\"' ) )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start ESCAPED
-+ *
-+ * Looks to match the characters the constitute the token ESCAPED
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mESCAPED(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+
-+ // RSP.g:138:9: ( '\\\\' ( '\\\\' | '\"' ) )
-+ // RSP.g:138:11: '\\\\' ( '\\\\' | '\"' )
-+ {
-+ MATCHC('\\');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleESCAPEDEx;
-+ }
-+
-+
-+ // RSP.g:139:3: ( '\\\\' | '\"' )
-+ {
-+ int alt11=2;
-+ switch ( LA(1) )
-+ {
-+ case '\\':
-+ {
-+ alt11=1;
-+ }
-+ break;
-+ case '"':
-+ {
-+ alt11=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 11;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleESCAPEDEx;
-+ }
-+
-+ switch (alt11)
-+ {
-+ case 1:
-+ // RSP.g:139:5: '\\\\'
-+ {
-+ MATCHC('\\');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleESCAPEDEx;
-+ }
-+
-+ {
-+ SETTEXT(GETTEXT()->factory->newStr8(GETTEXT()->factory, (pANTLR3_UINT8)"\\"));
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:140:5: '\"'
-+ {
-+ MATCHC('"');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleESCAPEDEx;
-+ }
-+
-+ {
-+ SETTEXT(GETTEXT()->factory->newStr8(GETTEXT()->factory, (pANTLR3_UINT8)"\""));
-+ }
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+
-+ }
-+
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleESCAPEDEx; /* Prevent compiler warnings */
-+ ruleESCAPEDEx: ;
-+
-+}
-+// $ANTLR end ESCAPED
-+
-+// Comes from: 145:9: ( '0' .. '9' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DIGIT09
-+ *
-+ * Looks to match the characters the constitute the token DIGIT09
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDIGIT09(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+
-+ // RSP.g:145:9: ( '0' .. '9' )
-+ // RSP.g:145:11: '0' .. '9'
-+ {
-+ MATCHRANGE('0', '9');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDIGIT09Ex;
-+ }
-+
-+
-+ }
-+
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleDIGIT09Ex; /* Prevent compiler warnings */
-+ ruleDIGIT09Ex: ;
-+
-+}
-+// $ANTLR end DIGIT09
-+
-+// Comes from: 148:9: ( '1' .. '9' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DIGIT19
-+ *
-+ * Looks to match the characters the constitute the token DIGIT19
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDIGIT19(pRSPLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+
-+ // RSP.g:148:9: ( '1' .. '9' )
-+ // RSP.g:148:11: '1' .. '9'
-+ {
-+ MATCHRANGE('1', '9');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDIGIT19Ex;
-+ }
-+
-+
-+ }
-+
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleDIGIT19Ex; /* Prevent compiler warnings */
-+ ruleDIGIT19Ex: ;
-+
-+}
-+// $ANTLR end DIGIT19
-+
-+/** This is the entry point in to the lexer from an object that
-+ * wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
-+ */
-+static void
-+mTokens(pRSPLexer ctx)
-+{
-+ {
-+ // RSP.g:1:8: ( QUOTE | LPAR | RPAR | AND | OR | NOT | EQUAL | INCLUDES | STARTSW | ENDSW | GREATER | LESS | GTE | LTE | BEFORE | AFTER | DAY | WEEK | MONTH | YEAR | TODAY | NEWLINE | WS | FIELD | INT | DATE | STR )
-+
-+ ANTLR3_UINT32 alt12;
-+
-+ alt12=27;
-+
-+ switch ( LA(1) )
-+ {
-+ case '"':
-+ {
-+
-+ {
-+ int LA12_1 = LA(2);
-+ if ( (((LA12_1 >= 0x0000) && (LA12_1 <= '!')) || ((LA12_1 >= '#') && (LA12_1 <= 0xFFFF))) )
-+ {
-+ alt12=27;
-+ }
-+ else
-+ {
-+ alt12=1; }
-+ }
-+ }
-+ break;
-+ case '(':
-+ {
-+ alt12=2;
-+ }
-+ break;
-+ case ')':
-+ {
-+ alt12=3;
-+ }
-+ break;
-+ case 'a':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'n':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'd':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=4;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+ case 'f':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 't':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 'e':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 'r':
-+ {
-+ switch ( LA(6) )
-+ {
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=16;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 12;
-+ EXCEPTION->state = 4;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'o':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'r':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=5;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 12;
-+ EXCEPTION->state = 5;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case '!':
-+ {
-+ alt12=6;
-+ }
-+ break;
-+ case '=':
-+ {
-+ alt12=7;
-+ }
-+ break;
-+ case 'i':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'n':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'c':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 'l':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 'u':
-+ {
-+ switch ( LA(6) )
-+ {
-+ case 'd':
-+ {
-+ switch ( LA(7) )
-+ {
-+ case 'e':
-+ {
-+ switch ( LA(8) )
-+ {
-+ case 's':
-+ {
-+ switch ( LA(9) )
-+ {
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=8;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 12;
-+ EXCEPTION->state = 8;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 's':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 't':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'a':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 'r':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 't':
-+ {
-+ switch ( LA(6) )
-+ {
-+ case 's':
-+ {
-+ switch ( LA(7) )
-+ {
-+ case 'w':
-+ {
-+ switch ( LA(8) )
-+ {
-+ case 'i':
-+ {
-+ switch ( LA(9) )
-+ {
-+ case 't':
-+ {
-+ switch ( LA(10) )
-+ {
-+ case 'h':
-+ {
-+ switch ( LA(11) )
-+ {
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=9;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 12;
-+ EXCEPTION->state = 9;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'e':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'n':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'd':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 's':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 'w':
-+ {
-+ switch ( LA(6) )
-+ {
-+ case 'i':
-+ {
-+ switch ( LA(7) )
-+ {
-+ case 't':
-+ {
-+ switch ( LA(8) )
-+ {
-+ case 'h':
-+ {
-+ switch ( LA(9) )
-+ {
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=10;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 12;
-+ EXCEPTION->state = 10;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case '>':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case '=':
-+ {
-+ alt12=13;
-+ }
-+ break;
-+
-+ default:
-+ alt12=11;}
-+
-+ }
-+ break;
-+ case '<':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case '=':
-+ {
-+ alt12=14;
-+ }
-+ break;
-+
-+ default:
-+ alt12=12;}
-+
-+ }
-+ break;
-+ case 'b':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'e':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'f':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 'o':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 'r':
-+ {
-+ switch ( LA(6) )
-+ {
-+ case 'e':
-+ {
-+ switch ( LA(7) )
-+ {
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=15;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 12;
-+ EXCEPTION->state = 13;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'd':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'a':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'y':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 's':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=17;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=17;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 12;
-+ EXCEPTION->state = 14;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'w':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'e':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'e':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 'k':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 's':
-+ {
-+ switch ( LA(6) )
-+ {
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=18;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=18;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 12;
-+ EXCEPTION->state = 15;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'm':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'o':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'n':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 't':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 'h':
-+ {
-+ switch ( LA(6) )
-+ {
-+ case 's':
-+ {
-+ switch ( LA(7) )
-+ {
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=19;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=19;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 12;
-+ EXCEPTION->state = 16;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'y':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'e':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'a':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 'r':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 's':
-+ {
-+ switch ( LA(6) )
-+ {
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=20;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=20;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 12;
-+ EXCEPTION->state = 17;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 't':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'o':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'd':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 'a':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 'y':
-+ {
-+ switch ( LA(6) )
-+ {
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'o':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ alt12=21;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=24;}
-+
-+ }
-+ break;
-+ case '_':
-+ case 'a':
-+ case 'b':
-+ case 'c':
-+ case 'd':
-+ case 'e':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'i':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'm':
-+ case 'n':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 's':
-+ case 't':
-+ case 'u':
-+ case 'v':
-+ case 'w':
-+ case 'x':
-+ case 'y':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 12;
-+ EXCEPTION->state = 18;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case '\n':
-+ case '\r':
-+ {
-+ alt12=22;
-+ }
-+ break;
-+ case '\t':
-+ case ' ':
-+ {
-+ alt12=23;
-+ }
-+ break;
-+ case 'c':
-+ case 'f':
-+ case 'g':
-+ case 'h':
-+ case 'j':
-+ case 'k':
-+ case 'l':
-+ case 'n':
-+ case 'p':
-+ case 'q':
-+ case 'r':
-+ case 'u':
-+ case 'v':
-+ case 'x':
-+ case 'z':
-+ {
-+ alt12=24;
-+ }
-+ break;
-+ case '1':
-+ case '2':
-+ case '3':
-+ case '4':
-+ case '5':
-+ case '6':
-+ case '7':
-+ case '8':
-+ case '9':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case '0':
-+ case '1':
-+ case '2':
-+ case '3':
-+ case '4':
-+ case '5':
-+ case '6':
-+ case '7':
-+ case '8':
-+ case '9':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case '0':
-+ case '1':
-+ case '2':
-+ case '3':
-+ case '4':
-+ case '5':
-+ case '6':
-+ case '7':
-+ case '8':
-+ case '9':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case '0':
-+ case '1':
-+ case '2':
-+ case '3':
-+ case '4':
-+ case '5':
-+ case '6':
-+ case '7':
-+ case '8':
-+ case '9':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case '-':
-+ {
-+ alt12=26;
-+ }
-+ break;
-+
-+ default:
-+ alt12=25;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=25;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=25;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt12=25;}
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 12;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ switch (alt12)
-+ {
-+ case 1:
-+ // RSP.g:1:10: QUOTE
-+ {
-+ /* 1:10: QUOTE */
-+ mQUOTE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:1:16: LPAR
-+ {
-+ /* 1:16: LPAR */
-+ mLPAR(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // RSP.g:1:21: RPAR
-+ {
-+ /* 1:21: RPAR */
-+ mRPAR(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // RSP.g:1:26: AND
-+ {
-+ /* 1:26: AND */
-+ mAND(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 5:
-+ // RSP.g:1:30: OR
-+ {
-+ /* 1:30: OR */
-+ mOR(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 6:
-+ // RSP.g:1:33: NOT
-+ {
-+ /* 1:33: NOT */
-+ mNOT(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 7:
-+ // RSP.g:1:37: EQUAL
-+ {
-+ /* 1:37: EQUAL */
-+ mEQUAL(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 8:
-+ // RSP.g:1:43: INCLUDES
-+ {
-+ /* 1:43: INCLUDES */
-+ mINCLUDES(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 9:
-+ // RSP.g:1:52: STARTSW
-+ {
-+ /* 1:52: STARTSW */
-+ mSTARTSW(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 10:
-+ // RSP.g:1:60: ENDSW
-+ {
-+ /* 1:60: ENDSW */
-+ mENDSW(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 11:
-+ // RSP.g:1:66: GREATER
-+ {
-+ /* 1:66: GREATER */
-+ mGREATER(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 12:
-+ // RSP.g:1:74: LESS
-+ {
-+ /* 1:74: LESS */
-+ mLESS(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 13:
-+ // RSP.g:1:79: GTE
-+ {
-+ /* 1:79: GTE */
-+ mGTE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 14:
-+ // RSP.g:1:83: LTE
-+ {
-+ /* 1:83: LTE */
-+ mLTE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 15:
-+ // RSP.g:1:87: BEFORE
-+ {
-+ /* 1:87: BEFORE */
-+ mBEFORE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 16:
-+ // RSP.g:1:94: AFTER
-+ {
-+ /* 1:94: AFTER */
-+ mAFTER(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 17:
-+ // RSP.g:1:100: DAY
-+ {
-+ /* 1:100: DAY */
-+ mDAY(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 18:
-+ // RSP.g:1:104: WEEK
-+ {
-+ /* 1:104: WEEK */
-+ mWEEK(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 19:
-+ // RSP.g:1:109: MONTH
-+ {
-+ /* 1:109: MONTH */
-+ mMONTH(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 20:
-+ // RSP.g:1:115: YEAR
-+ {
-+ /* 1:115: YEAR */
-+ mYEAR(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 21:
-+ // RSP.g:1:120: TODAY
-+ {
-+ /* 1:120: TODAY */
-+ mTODAY(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 22:
-+ // RSP.g:1:126: NEWLINE
-+ {
-+ /* 1:126: NEWLINE */
-+ mNEWLINE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 23:
-+ // RSP.g:1:134: WS
-+ {
-+ /* 1:134: WS */
-+ mWS(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 24:
-+ // RSP.g:1:137: FIELD
-+ {
-+ /* 1:137: FIELD */
-+ mFIELD(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 25:
-+ // RSP.g:1:143: INT
-+ {
-+ /* 1:143: INT */
-+ mINT(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 26:
-+ // RSP.g:1:147: DATE
-+ {
-+ /* 1:147: DATE */
-+ mDATE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 27:
-+ // RSP.g:1:152: STR
-+ {
-+ /* 1:152: STR */
-+ mSTR(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+
-+
-+ goto ruleTokensEx; /* Prevent compiler warnings */
-+ruleTokensEx: ;
-+}
-+
-+/* =========================================================================
-+ * Lexer matching rules end.
-+ * =========================================================================
-+ */
-+/* End of Lexer code
-+ * ================================================
-+ * ================================================
-+ */
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/RSPLexer.h b/src/pregen/RSPLexer.h
-new file mode 100644
-index 0000000..27bc791
---- /dev/null
-+++ b/src/pregen/RSPLexer.h
-@@ -0,0 +1,254 @@
-+/** \file
-+ * This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : RSP.g
-+ * - On : 2016-01-01 12:23:42
-+ * - for the lexer : RSPLexerLexer *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The lexer RSPLexer has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ *
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pRSPLexer, which is returned from a call to RSPLexerNew().
-+ *
-+ * As this is a generated lexer, it is unlikely you will call it 'manually'. However
-+ * the methods are provided anyway.
-+ * * The methods in pRSPLexer are as follows:
-+ *
-+ * - void pRSPLexer->QUOTE(pRSPLexer)
-+ * - void pRSPLexer->LPAR(pRSPLexer)
-+ * - void pRSPLexer->RPAR(pRSPLexer)
-+ * - void pRSPLexer->AND(pRSPLexer)
-+ * - void pRSPLexer->OR(pRSPLexer)
-+ * - void pRSPLexer->NOT(pRSPLexer)
-+ * - void pRSPLexer->EQUAL(pRSPLexer)
-+ * - void pRSPLexer->INCLUDES(pRSPLexer)
-+ * - void pRSPLexer->STARTSW(pRSPLexer)
-+ * - void pRSPLexer->ENDSW(pRSPLexer)
-+ * - void pRSPLexer->GREATER(pRSPLexer)
-+ * - void pRSPLexer->LESS(pRSPLexer)
-+ * - void pRSPLexer->GTE(pRSPLexer)
-+ * - void pRSPLexer->LTE(pRSPLexer)
-+ * - void pRSPLexer->BEFORE(pRSPLexer)
-+ * - void pRSPLexer->AFTER(pRSPLexer)
-+ * - void pRSPLexer->DAY(pRSPLexer)
-+ * - void pRSPLexer->WEEK(pRSPLexer)
-+ * - void pRSPLexer->MONTH(pRSPLexer)
-+ * - void pRSPLexer->YEAR(pRSPLexer)
-+ * - void pRSPLexer->TODAY(pRSPLexer)
-+ * - void pRSPLexer->NEWLINE(pRSPLexer)
-+ * - void pRSPLexer->WS(pRSPLexer)
-+ * - void pRSPLexer->FIELD(pRSPLexer)
-+ * - void pRSPLexer->INT(pRSPLexer)
-+ * - void pRSPLexer->DATE(pRSPLexer)
-+ * - void pRSPLexer->STR(pRSPLexer)
-+ * - void pRSPLexer->ESCAPED(pRSPLexer)
-+ * - void pRSPLexer->DIGIT09(pRSPLexer)
-+ * - void pRSPLexer->DIGIT19(pRSPLexer)
-+ * - void pRSPLexer->Tokens(pRSPLexer)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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 _RSPLexer_H
-+#define _RSPLexer_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct RSPLexer_Ctx_struct RSPLexer, * pRSPLexer;
-+
-+
-+
-+#ifdef ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter, - Rules with parameters that are not used
-+// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
-+// initialized but unused variable - tree rewrite variables declared but not needed
-+// Unreferenced local variable - lexer rule declares but does not always use _type
-+// potentially unitialized variable used - retval always returned from a rule
-+// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+
-+/** Context tracking structure for RSPLexer
-+ */
-+struct RSPLexer_Ctx_struct
-+{
-+ /** Built in ANTLR3 context tracker contains all the generic elements
-+ * required for context tracking.
-+ */
-+ pANTLR3_LEXER pLexer;
-+
-+
-+ void (*mQUOTE) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mLPAR) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mRPAR) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mAND) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mOR) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mNOT) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mEQUAL) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mINCLUDES) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mSTARTSW) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mENDSW) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mGREATER) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mLESS) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mGTE) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mLTE) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mBEFORE) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mAFTER) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mDAY) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mWEEK) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mMONTH) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mYEAR) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mTODAY) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mNEWLINE) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mWS) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mFIELD) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mINT) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mDATE) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mSTR) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mESCAPED) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mDIGIT09) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mDIGIT19) (struct RSPLexer_Ctx_struct * ctx);
-+ void (*mTokens) (struct RSPLexer_Ctx_struct * ctx); const char * (*getGrammarFileName)();
-+ void (*free) (struct RSPLexer_Ctx_struct * ctx);
-+
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pRSPLexer RSPLexerNew (pANTLR3_INPUT_STREAM instream);
-+ANTLR3_API pRSPLexer RSPLexerNewSSD (pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the lexer will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef EOF
-+#undef EOF
-+#endif
-+#ifdef Tokens
-+#undef Tokens
-+#endif
-+#define STARTSW 14
-+#define WEEK 26
-+#define TODAY 24
-+#define YEAR 28
-+#define ENDSW 15
-+#define GTE 20
-+#define BEFORE 21
-+#define DAY 25
-+#define INT 16
-+#define NOT 11
-+#define AFTER 22
-+#define AND 6
-+#define EOF -1
-+#define LTE 19
-+#define MONTH 27
-+#define DIGIT19 31
-+#define INCLUDES 13
-+#define STR 10
-+#define QUOTE 29
-+#define GREATER 18
-+#define WS 30
-+#define LPAR 7
-+#define NEWLINE 4
-+#define EQUAL 12
-+#define OR 5
-+#define LESS 17
-+#define FIELD 9
-+#define RPAR 8
-+#define ESCAPED 33
-+#define DATE 23
-+#define DIGIT09 32
-+#ifdef EOF
-+#undef EOF
-+#define EOF ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for RSPLexer
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/RSPParser.c b/src/pregen/RSPParser.c
-new file mode 100644
-index 0000000..ba8a9d2
---- /dev/null
-+++ b/src/pregen/RSPParser.c
-@@ -0,0 +1,3152 @@
-+/** \file
-+ * This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : RSP.g
-+ * - On : 2016-01-01 12:23:42
-+ * - for the parser : RSPParserParser *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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.
-+
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include "RSPParser.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+
-+#define CTX ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef SCOPE_TYPE
-+#undef SCOPE_STACK
-+#undef SCOPE_TOP
-+#define SCOPE_TYPE(scope) pRSPParser_##scope##_SCOPE
-+#define SCOPE_STACK(scope) pRSPParser_##scope##Stack
-+#define SCOPE_TOP(scope) ctx->pRSPParser_##scope##Top
-+#define SCOPE_SIZE(scope) ctx->pRSPParser_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i) (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+/* Macros for accessing things in the parser
-+ */
-+
-+#undef PARSER
-+#undef RECOGNIZER
-+#undef HAVEPARSEDRULE
-+#undef MEMOIZE
-+#undef INPUT
-+#undef STRSTREAM
-+#undef HASEXCEPTION
-+#undef EXCEPTION
-+#undef MATCHT
-+#undef MATCHANYT
-+#undef FOLLOWSTACK
-+#undef FOLLOWPUSH
-+#undef FOLLOWPOP
-+#undef PRECOVER
-+#undef PREPORTERROR
-+#undef LA
-+#undef LT
-+#undef CONSTRUCTEX
-+#undef CONSUME
-+#undef MARK
-+#undef REWIND
-+#undef REWINDLAST
-+#undef PERRORRECOVERY
-+#undef HASFAILED
-+#undef FAILEDFLAG
-+#undef RECOVERFROMMISMATCHEDSET
-+#undef RECOVERFROMMISMATCHEDELEMENT
-+#undef INDEX
-+#undef ADAPTOR
-+#undef SEEK
-+#undef RULEMEMO
-+#undef DBG
-+
-+#define PARSER ctx->pParser
-+#define RECOGNIZER PARSER->rec
-+#define PSRSTATE RECOGNIZER->state
-+#define HAVEPARSEDRULE(r) RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define MEMOIZE(ri,si) RECOGNIZER->memoize(RECOGNIZER, ri, si)
-+#define INPUT PARSER->tstream
-+#define STRSTREAM INPUT
-+#define ISTREAM INPUT->istream
-+#define INDEX() ISTREAM->index(INPUT->istream)
-+#define HASEXCEPTION() (PSRSTATE->error == ANTLR3_TRUE)
-+#define EXCEPTION PSRSTATE->exception
-+#define MATCHT(t, fs) RECOGNIZER->match(RECOGNIZER, t, fs)
-+#define MATCHANYT() RECOGNIZER->matchAny(RECOGNIZER)
-+#define FOLLOWSTACK PSRSTATE->following
-+#define FOLLOWPUSH(x) FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
-+#define FOLLOWPOP() FOLLOWSTACK->pop(FOLLOWSTACK)
-+#define PRECOVER() RECOGNIZER->recover(RECOGNIZER)
-+#define PREPORTERROR() RECOGNIZER->reportError(RECOGNIZER)
-+#define LA(n) INPUT->istream->_LA(ISTREAM, n)
-+#define LT(n) INPUT->_LT(INPUT, n)
-+#define CONSTRUCTEX() RECOGNIZER->exConstruct(RECOGNIZER)
-+#define CONSUME() ISTREAM->consume(ISTREAM)
-+#define MARK() ISTREAM->mark(ISTREAM)
-+#define REWIND(m) ISTREAM->rewind(ISTREAM, m)
-+#define REWINDLAST() ISTREAM->rewindLast(ISTREAM)
-+#define SEEK(n) ISTREAM->seek(ISTREAM, n)
-+#define PERRORRECOVERY PSRSTATE->errorRecovery
-+#define FAILEDFLAG PSRSTATE->failed
-+#define HASFAILED() (FAILEDFLAG == ANTLR3_TRUE)
-+#define BACKTRACKING PSRSTATE->backtracking
-+#define RECOVERFROMMISMATCHEDSET(s) RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
-+#define RECOVERFROMMISMATCHEDELEMENT(e) RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
-+#define ADAPTOR ctx->adaptor
-+#define RULEMEMO PSRSTATE->ruleMemo
-+#define DBG RECOGNIZER->debugger
-+
-+#define TOKTEXT(tok, txt) tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define UP ANTLR3_TOKEN_UP
-+#define DOWN ANTLR3_TOKEN_DOWN
-+#define EOR ANTLR3_TOKEN_EOR
-+#define INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+
-+/** \brief Table of all token names in symbolic order, mainly used for
-+ * error reporting.
-+ */
-+pANTLR3_UINT8 RSPParserTokenNames[30+4]
-+ = {
-+ (pANTLR3_UINT8) "<invalid>", /* String to print to indicate an invalid token */
-+ (pANTLR3_UINT8) "<EOR>",
-+ (pANTLR3_UINT8) "<DOWN>",
-+ (pANTLR3_UINT8) "<UP>",
-+ (pANTLR3_UINT8) "NEWLINE",
-+ (pANTLR3_UINT8) "OR",
-+ (pANTLR3_UINT8) "AND",
-+ (pANTLR3_UINT8) "LPAR",
-+ (pANTLR3_UINT8) "RPAR",
-+ (pANTLR3_UINT8) "FIELD",
-+ (pANTLR3_UINT8) "STR",
-+ (pANTLR3_UINT8) "NOT",
-+ (pANTLR3_UINT8) "EQUAL",
-+ (pANTLR3_UINT8) "INCLUDES",
-+ (pANTLR3_UINT8) "STARTSW",
-+ (pANTLR3_UINT8) "ENDSW",
-+ (pANTLR3_UINT8) "INT",
-+ (pANTLR3_UINT8) "LESS",
-+ (pANTLR3_UINT8) "GREATER",
-+ (pANTLR3_UINT8) "LTE",
-+ (pANTLR3_UINT8) "GTE",
-+ (pANTLR3_UINT8) "BEFORE",
-+ (pANTLR3_UINT8) "AFTER",
-+ (pANTLR3_UINT8) "DATE",
-+ (pANTLR3_UINT8) "TODAY",
-+ (pANTLR3_UINT8) "DAY",
-+ (pANTLR3_UINT8) "WEEK",
-+ (pANTLR3_UINT8) "MONTH",
-+ (pANTLR3_UINT8) "YEAR",
-+ (pANTLR3_UINT8) "QUOTE",
-+ (pANTLR3_UINT8) "WS",
-+ (pANTLR3_UINT8) "DIGIT19",
-+ (pANTLR3_UINT8) "DIGIT09",
-+ (pANTLR3_UINT8) "ESCAPED"
-+ };
-+
-+
-+
-+// Forward declare the locally static matching functions we have generated.
-+//
-+static RSPParser_query_return query (pRSPParser ctx);
-+static RSPParser_expr_return expr (pRSPParser ctx);
-+static RSPParser_aexpr_return aexpr (pRSPParser ctx);
-+static RSPParser_crit_return crit (pRSPParser ctx);
-+static RSPParser_strcrit_return strcrit (pRSPParser ctx);
-+static RSPParser_strop_return strop (pRSPParser ctx);
-+static RSPParser_intcrit_return intcrit (pRSPParser ctx);
-+static RSPParser_intop_return intop (pRSPParser ctx);
-+static RSPParser_datecrit_return datecrit (pRSPParser ctx);
-+static RSPParser_dateop_return dateop (pRSPParser ctx);
-+static RSPParser_datespec_return datespec (pRSPParser ctx);
-+static RSPParser_dateref_return dateref (pRSPParser ctx);
-+static RSPParser_dateintval_return dateintval (pRSPParser ctx);
-+static void RSPParserFree(pRSPParser ctx);
-+/* For use in tree output where we are accumulating rule labels via label += ruleRef
-+ * we need a function that knows how to free a return scope when the list is destroyed.
-+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
-+ */
-+static void ANTLR3_CDECL freeScope(void * scope)
-+{
-+ ANTLR3_FREE(scope);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "RSP.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+ return fileName;
-+}
-+/** \brief Create a new RSPParser parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pRSPParser
-+RSPParserNew (pANTLR3_COMMON_TOKEN_STREAM instream)
-+{
-+ // See if we can create a new parser with the standard constructor
-+ //
-+ return RSPParserNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new RSPParser parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pRSPParser
-+RSPParserNewSSD (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+ pRSPParser ctx; /* Context structure we will build and return */
-+
-+ ctx = (pRSPParser) ANTLR3_CALLOC(1, sizeof(RSPParser));
-+
-+ if (ctx == NULL)
-+ {
-+ // Failed to allocate memory for parser context
-+ //
-+ return NULL;
-+ }
-+
-+ /* -------------------------------------------------------------------
-+ * Memory for basic structure is allocated, now to fill in
-+ * the base ANTLR3 structures. We initialize the function pointers
-+ * for the standard ANTLR3 parser function set, but upon return
-+ * from here, the programmer may set the pointers to provide custom
-+ * implementations of each function.
-+ *
-+ * We don't use the macros defined in RSPParser.h here, in order that you can get a sense
-+ * of what goes where.
-+ */
-+
-+ /* Create a base parser/recognizer, using the supplied token stream
-+ */
-+ ctx->pParser = antlr3ParserNewStream(ANTLR3_SIZE_HINT, instream->tstream, state);
-+ /* Install the implementation of our RSPParser interface
-+ */
-+ ctx->query = query;
-+ ctx->expr = expr;
-+ ctx->aexpr = aexpr;
-+ ctx->crit = crit;
-+ ctx->strcrit = strcrit;
-+ ctx->strop = strop;
-+ ctx->intcrit = intcrit;
-+ ctx->intop = intop;
-+ ctx->datecrit = datecrit;
-+ ctx->dateop = dateop;
-+ ctx->datespec = datespec;
-+ ctx->dateref = dateref;
-+ ctx->dateintval = dateintval;
-+ ctx->free = RSPParserFree;
-+ ctx->getGrammarFileName = getGrammarFileName;
-+
-+ /* Install the scope pushing methods.
-+ */
-+ ADAPTOR = ANTLR3_TREE_ADAPTORNew(instream->tstream->tokenSource->strFactory);
-+ ctx->vectors = antlr3VectorFactoryNew(0);
-+
-+
-+
-+ /* Install the token table
-+ */
-+ PSRSTATE->tokenNames = RSPParserTokenNames;
-+
-+
-+ /* Return the newly built parser to the caller
-+ */
-+ return ctx;
-+}
-+
-+/** Free the parser resources
-+ */
-+ static void
-+ RSPParserFree(pRSPParser ctx)
-+ {
-+ /* Free any scope memory
-+ */
-+
-+ ctx->vectors->close(ctx->vectors);
-+ /* We created the adaptor so we must free it
-+ */
-+ ADAPTOR->free(ADAPTOR);
-+ // Free this parser
-+ //
-+ ctx->pParser->free(ctx->pParser);
-+ ANTLR3_FREE(ctx);
-+
-+ /* Everything is released, so we can return
-+ */
-+ return;
-+ }
-+
-+/** Return token names used by this parser
-+ *
-+ * The returned pointer is used as an index into the token names table (using the token
-+ * number as the index).
-+ *
-+ * \return Pointer to first char * in the table.
-+ */
-+static pANTLR3_UINT8 *getTokenNames()
-+{
-+ return RSPParserTokenNames;
-+}
-+
-+
-+/* Declare the bitsets
-+ */
-+
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_query42 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_query42_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_query42 = { FOLLOW_expr_in_query42_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NEWLINE_in_query44 */
-+static ANTLR3_BITWORD FOLLOW_NEWLINE_in_query44_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000) };
-+static ANTLR3_BITSET_LIST FOLLOW_NEWLINE_in_query44 = { FOLLOW_NEWLINE_in_query44_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_query47 */
-+static ANTLR3_BITWORD FOLLOW_EOF_in_query47_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_EOF_in_query47 = { FOLLOW_EOF_in_query47_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expr63 */
-+static ANTLR3_BITWORD FOLLOW_aexpr_in_expr63_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000022) };
-+static ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expr63 = { FOLLOW_aexpr_in_expr63_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OR_in_expr66 */
-+static ANTLR3_BITWORD FOLLOW_OR_in_expr66_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000280) };
-+static ANTLR3_BITSET_LIST FOLLOW_OR_in_expr66 = { FOLLOW_OR_in_expr66_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expr69 */
-+static ANTLR3_BITWORD FOLLOW_aexpr_in_expr69_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000022) };
-+static ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expr69 = { FOLLOW_aexpr_in_expr69_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_aexpr81 */
-+static ANTLR3_BITWORD FOLLOW_crit_in_aexpr81_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000042) };
-+static ANTLR3_BITSET_LIST FOLLOW_crit_in_aexpr81 = { FOLLOW_crit_in_aexpr81_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AND_in_aexpr84 */
-+static ANTLR3_BITWORD FOLLOW_AND_in_aexpr84_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000280) };
-+static ANTLR3_BITSET_LIST FOLLOW_AND_in_aexpr84 = { FOLLOW_AND_in_aexpr84_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_aexpr87 */
-+static ANTLR3_BITWORD FOLLOW_crit_in_aexpr87_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000042) };
-+static ANTLR3_BITSET_LIST FOLLOW_crit_in_aexpr87 = { FOLLOW_crit_in_aexpr87_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAR_in_crit99 */
-+static ANTLR3_BITWORD FOLLOW_LPAR_in_crit99_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000280) };
-+static ANTLR3_BITSET_LIST FOLLOW_LPAR_in_crit99 = { FOLLOW_LPAR_in_crit99_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expr_in_crit101 */
-+static ANTLR3_BITWORD FOLLOW_expr_in_crit101_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000100) };
-+static ANTLR3_BITSET_LIST FOLLOW_expr_in_crit101 = { FOLLOW_expr_in_crit101_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAR_in_crit103 */
-+static ANTLR3_BITWORD FOLLOW_RPAR_in_crit103_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_RPAR_in_crit103 = { FOLLOW_RPAR_in_crit103_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_strcrit_in_crit114 */
-+static ANTLR3_BITWORD FOLLOW_strcrit_in_crit114_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_strcrit_in_crit114 = { FOLLOW_strcrit_in_crit114_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_intcrit_in_crit119 */
-+static ANTLR3_BITWORD FOLLOW_intcrit_in_crit119_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_intcrit_in_crit119 = { FOLLOW_intcrit_in_crit119_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_datecrit_in_crit124 */
-+static ANTLR3_BITWORD FOLLOW_datecrit_in_crit124_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_datecrit_in_crit124 = { FOLLOW_datecrit_in_crit124_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_strcrit134 */
-+static ANTLR3_BITWORD FOLLOW_FIELD_in_strcrit134_bits[] = { ANTLR3_UINT64_LIT(0x000000000000F000) };
-+static ANTLR3_BITSET_LIST FOLLOW_FIELD_in_strcrit134 = { FOLLOW_FIELD_in_strcrit134_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_strop_in_strcrit136 */
-+static ANTLR3_BITWORD FOLLOW_strop_in_strcrit136_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000400) };
-+static ANTLR3_BITSET_LIST FOLLOW_strop_in_strcrit136 = { FOLLOW_strop_in_strcrit136_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_strcrit138 */
-+static ANTLR3_BITWORD FOLLOW_STR_in_strcrit138_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_STR_in_strcrit138 = { FOLLOW_STR_in_strcrit138_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_strcrit155 */
-+static ANTLR3_BITWORD FOLLOW_FIELD_in_strcrit155_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000800) };
-+static ANTLR3_BITSET_LIST FOLLOW_FIELD_in_strcrit155 = { FOLLOW_FIELD_in_strcrit155_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_strcrit157 */
-+static ANTLR3_BITWORD FOLLOW_NOT_in_strcrit157_bits[] = { ANTLR3_UINT64_LIT(0x000000000000F000) };
-+static ANTLR3_BITSET_LIST FOLLOW_NOT_in_strcrit157 = { FOLLOW_NOT_in_strcrit157_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_strop_in_strcrit159 */
-+static ANTLR3_BITWORD FOLLOW_strop_in_strcrit159_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000400) };
-+static ANTLR3_BITSET_LIST FOLLOW_strop_in_strcrit159 = { FOLLOW_strop_in_strcrit159_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_strcrit161 */
-+static ANTLR3_BITWORD FOLLOW_STR_in_strcrit161_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_STR_in_strcrit161 = { FOLLOW_STR_in_strcrit161_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQUAL_in_strop188 */
-+static ANTLR3_BITWORD FOLLOW_EQUAL_in_strop188_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_EQUAL_in_strop188 = { FOLLOW_EQUAL_in_strop188_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCLUDES_in_strop195 */
-+static ANTLR3_BITWORD FOLLOW_INCLUDES_in_strop195_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_INCLUDES_in_strop195 = { FOLLOW_INCLUDES_in_strop195_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STARTSW_in_strop202 */
-+static ANTLR3_BITWORD FOLLOW_STARTSW_in_strop202_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_STARTSW_in_strop202 = { FOLLOW_STARTSW_in_strop202_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENDSW_in_strop209 */
-+static ANTLR3_BITWORD FOLLOW_ENDSW_in_strop209_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_ENDSW_in_strop209 = { FOLLOW_ENDSW_in_strop209_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_intcrit219 */
-+static ANTLR3_BITWORD FOLLOW_FIELD_in_intcrit219_bits[] = { ANTLR3_UINT64_LIT(0x00000000001E1000) };
-+static ANTLR3_BITSET_LIST FOLLOW_FIELD_in_intcrit219 = { FOLLOW_FIELD_in_intcrit219_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_intop_in_intcrit221 */
-+static ANTLR3_BITWORD FOLLOW_intop_in_intcrit221_bits[] = { ANTLR3_UINT64_LIT(0x0000000000010000) };
-+static ANTLR3_BITSET_LIST FOLLOW_intop_in_intcrit221 = { FOLLOW_intop_in_intcrit221_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_intcrit223 */
-+static ANTLR3_BITWORD FOLLOW_INT_in_intcrit223_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_INT_in_intcrit223 = { FOLLOW_INT_in_intcrit223_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_intcrit240 */
-+static ANTLR3_BITWORD FOLLOW_FIELD_in_intcrit240_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000800) };
-+static ANTLR3_BITSET_LIST FOLLOW_FIELD_in_intcrit240 = { FOLLOW_FIELD_in_intcrit240_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_intcrit242 */
-+static ANTLR3_BITWORD FOLLOW_NOT_in_intcrit242_bits[] = { ANTLR3_UINT64_LIT(0x00000000001E1000) };
-+static ANTLR3_BITSET_LIST FOLLOW_NOT_in_intcrit242 = { FOLLOW_NOT_in_intcrit242_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_intop_in_intcrit244 */
-+static ANTLR3_BITWORD FOLLOW_intop_in_intcrit244_bits[] = { ANTLR3_UINT64_LIT(0x0000000000010000) };
-+static ANTLR3_BITSET_LIST FOLLOW_intop_in_intcrit244 = { FOLLOW_intop_in_intcrit244_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_intcrit246 */
-+static ANTLR3_BITWORD FOLLOW_INT_in_intcrit246_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_INT_in_intcrit246 = { FOLLOW_INT_in_intcrit246_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EQUAL_in_intop273 */
-+static ANTLR3_BITWORD FOLLOW_EQUAL_in_intop273_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_EQUAL_in_intop273 = { FOLLOW_EQUAL_in_intop273_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LESS_in_intop280 */
-+static ANTLR3_BITWORD FOLLOW_LESS_in_intop280_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_LESS_in_intop280 = { FOLLOW_LESS_in_intop280_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GREATER_in_intop287 */
-+static ANTLR3_BITWORD FOLLOW_GREATER_in_intop287_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_GREATER_in_intop287 = { FOLLOW_GREATER_in_intop287_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LTE_in_intop294 */
-+static ANTLR3_BITWORD FOLLOW_LTE_in_intop294_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_LTE_in_intop294 = { FOLLOW_LTE_in_intop294_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_GTE_in_intop301 */
-+static ANTLR3_BITWORD FOLLOW_GTE_in_intop301_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_GTE_in_intop301 = { FOLLOW_GTE_in_intop301_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_FIELD_in_datecrit310 */
-+static ANTLR3_BITWORD FOLLOW_FIELD_in_datecrit310_bits[] = { ANTLR3_UINT64_LIT(0x0000000000600000) };
-+static ANTLR3_BITSET_LIST FOLLOW_FIELD_in_datecrit310 = { FOLLOW_FIELD_in_datecrit310_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateop_in_datecrit312 */
-+static ANTLR3_BITWORD FOLLOW_dateop_in_datecrit312_bits[] = { ANTLR3_UINT64_LIT(0x0000000001810000) };
-+static ANTLR3_BITSET_LIST FOLLOW_dateop_in_datecrit312 = { FOLLOW_dateop_in_datecrit312_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_datespec_in_datecrit314 */
-+static ANTLR3_BITWORD FOLLOW_datespec_in_datecrit314_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_datespec_in_datecrit314 = { FOLLOW_datespec_in_datecrit314_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_dateop337 */
-+static ANTLR3_BITWORD FOLLOW_BEFORE_in_dateop337_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_dateop337 = { FOLLOW_BEFORE_in_dateop337_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_dateop344 */
-+static ANTLR3_BITWORD FOLLOW_AFTER_in_dateop344_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_AFTER_in_dateop344 = { FOLLOW_AFTER_in_dateop344_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateref_in_datespec353 */
-+static ANTLR3_BITWORD FOLLOW_dateref_in_datespec353_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_dateref_in_datespec353 = { FOLLOW_dateref_in_datespec353_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_datespec358 */
-+static ANTLR3_BITWORD FOLLOW_INT_in_datespec358_bits[] = { ANTLR3_UINT64_LIT(0x000000001E000000) };
-+static ANTLR3_BITSET_LIST FOLLOW_INT_in_datespec358 = { FOLLOW_INT_in_datespec358_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateintval_in_datespec360 */
-+static ANTLR3_BITWORD FOLLOW_dateintval_in_datespec360_bits[] = { ANTLR3_UINT64_LIT(0x0000000000600000) };
-+static ANTLR3_BITSET_LIST FOLLOW_dateintval_in_datespec360 = { FOLLOW_dateintval_in_datespec360_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateop_in_datespec362 */
-+static ANTLR3_BITWORD FOLLOW_dateop_in_datespec362_bits[] = { ANTLR3_UINT64_LIT(0x0000000001800000) };
-+static ANTLR3_BITSET_LIST FOLLOW_dateop_in_datespec362 = { FOLLOW_dateop_in_datespec362_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateref_in_datespec364 */
-+static ANTLR3_BITWORD FOLLOW_dateref_in_datespec364_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_dateref_in_datespec364 = { FOLLOW_dateref_in_datespec364_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateref388 */
-+static ANTLR3_BITWORD FOLLOW_DATE_in_dateref388_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateref388 = { FOLLOW_DATE_in_dateref388_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_TODAY_in_dateref395 */
-+static ANTLR3_BITWORD FOLLOW_TODAY_in_dateref395_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_TODAY_in_dateref395 = { FOLLOW_TODAY_in_dateref395_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DAY_in_dateintval408 */
-+static ANTLR3_BITWORD FOLLOW_DAY_in_dateintval408_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_DAY_in_dateintval408 = { FOLLOW_DAY_in_dateintval408_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_WEEK_in_dateintval415 */
-+static ANTLR3_BITWORD FOLLOW_WEEK_in_dateintval415_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_WEEK_in_dateintval415 = { FOLLOW_WEEK_in_dateintval415_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_MONTH_in_dateintval422 */
-+static ANTLR3_BITWORD FOLLOW_MONTH_in_dateintval422_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_MONTH_in_dateintval422 = { FOLLOW_MONTH_in_dateintval422_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_YEAR_in_dateintval429 */
-+static ANTLR3_BITWORD FOLLOW_YEAR_in_dateintval429_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_YEAR_in_dateintval429 = { FOLLOW_YEAR_in_dateintval429_bits, 1 };
-+
-+
-+
-+
-+/* ==============================================
-+ * Parsing rules
-+ */
-+/**
-+ * $ANTLR start query
-+ * RSP.g:27:1: query : expr ( NEWLINE )? EOF -> expr ;
-+ */
-+static RSPParser_query_return
-+query(pRSPParser ctx)
-+{
-+ RSPParser_query_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN NEWLINE2;
-+ pANTLR3_COMMON_TOKEN EOF3;
-+ RSPParser_expr_return expr1;
-+ #undef RETURN_TYPE_expr1
-+ #define RETURN_TYPE_expr1 RSPParser_expr_return
-+
-+ pANTLR3_BASE_TREE NEWLINE2_tree;
-+ pANTLR3_BASE_TREE EOF3_tree;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_NEWLINE;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_EOF;
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expr;
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ NEWLINE2 = NULL;
-+ EOF3 = NULL;
-+ expr1.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ NEWLINE2_tree = NULL;
-+ EOF3_tree = NULL;
-+
-+ stream_NEWLINE = NULL;
-+ #define CREATE_stream_NEWLINE if (stream_NEWLINE == NULL) {stream_NEWLINE = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token NEWLINE"); }
-+ stream_EOF = NULL;
-+ #define CREATE_stream_EOF if (stream_EOF == NULL) {stream_EOF = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token EOF"); }
-+ stream_expr = NULL;
-+ #define CREATE_stream_expr if (stream_expr == NULL) {stream_expr = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expr"); }
-+
-+ retval.tree = NULL;
-+ {
-+ // RSP.g:27:7: ( expr ( NEWLINE )? EOF -> expr )
-+ // RSP.g:27:9: expr ( NEWLINE )? EOF
-+ {
-+ FOLLOWPUSH(FOLLOW_expr_in_query42);
-+ expr1=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulequeryEx;
-+ }
-+
-+ CREATE_stream_expr; stream_expr->add(stream_expr, expr1.tree, NULL);
-+
-+ // RSP.g:27:14: ( NEWLINE )?
-+ {
-+ int alt1=2;
-+ switch ( LA(1) )
-+ {
-+ case NEWLINE:
-+ {
-+ alt1=1;
-+ }
-+ break;
-+ }
-+
-+ switch (alt1)
-+ {
-+ case 1:
-+ // RSP.g:27:14: NEWLINE
-+ {
-+ NEWLINE2 = (pANTLR3_COMMON_TOKEN) MATCHT(NEWLINE, &FOLLOW_NEWLINE_in_query44);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulequeryEx;
-+ }
-+
-+ CREATE_stream_NEWLINE; stream_NEWLINE->add(stream_NEWLINE, NEWLINE2, NULL);
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ EOF3 = (pANTLR3_COMMON_TOKEN) MATCHT(EOF, &FOLLOW_EOF_in_query47);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulequeryEx;
-+ }
-+
-+ CREATE_stream_EOF; stream_EOF->add(stream_EOF, EOF3, NULL);
-+
-+
-+
-+ /* AST REWRITE
-+ * elements : expr
-+ * token labels :
-+ * rule labels : retval
-+ * token list labels :
-+ * rule list labels :
-+ */
-+ {
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+ stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ retval.tree = root_0;
-+ // 27:28: -> expr
-+ {
-+ ADAPTOR->addChild(ADAPTOR, root_0, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
-+
-+ }
-+
-+ retval.tree = root_0; // set result root
-+ if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+ }
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto rulequeryEx; /* Prevent compiler warnings */
-+ rulequeryEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+ if (stream_NEWLINE != NULL) stream_NEWLINE->free(stream_NEWLINE);
-+ if (stream_EOF != NULL) stream_EOF->free(stream_EOF);
-+ if (stream_expr != NULL) stream_expr->free(stream_expr);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end query */
-+
-+/**
-+ * $ANTLR start expr
-+ * RSP.g:30:1: expr : aexpr ( OR aexpr )* ;
-+ */
-+static RSPParser_expr_return
-+expr(pRSPParser ctx)
-+{
-+ RSPParser_expr_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN OR5;
-+ RSPParser_aexpr_return aexpr4;
-+ #undef RETURN_TYPE_aexpr4
-+ #define RETURN_TYPE_aexpr4 RSPParser_aexpr_return
-+
-+ RSPParser_aexpr_return aexpr6;
-+ #undef RETURN_TYPE_aexpr6
-+ #define RETURN_TYPE_aexpr6 RSPParser_aexpr_return
-+
-+ pANTLR3_BASE_TREE OR5_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ OR5 = NULL;
-+ aexpr4.tree = NULL;
-+
-+ aexpr6.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ OR5_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ // RSP.g:30:6: ( aexpr ( OR aexpr )* )
-+ // RSP.g:30:8: aexpr ( OR aexpr )*
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_aexpr_in_expr63);
-+ aexpr4=aexpr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, aexpr4.tree);
-+
-+ // RSP.g:30:14: ( OR aexpr )*
-+
-+ for (;;)
-+ {
-+ int alt2=2;
-+ switch ( LA(1) )
-+ {
-+ case OR:
-+ {
-+ alt2=1;
-+ }
-+ break;
-+
-+ }
-+
-+ switch (alt2)
-+ {
-+ case 1:
-+ // RSP.g:30:15: OR aexpr
-+ {
-+ OR5 = (pANTLR3_COMMON_TOKEN) MATCHT(OR, &FOLLOW_OR_in_expr66);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ OR5_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, OR5));
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, OR5_tree, root_0));
-+
-+ FOLLOWPUSH(FOLLOW_aexpr_in_expr69);
-+ aexpr6=aexpr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexprEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, aexpr6.tree);
-+
-+ }
-+ break;
-+
-+ default:
-+ goto loop2; /* break out of the loop */
-+ break;
-+ }
-+ }
-+ loop2: ; /* Jump out to here if this rule does not match */
-+
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleexprEx; /* Prevent compiler warnings */
-+ ruleexprEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end expr */
-+
-+/**
-+ * $ANTLR start aexpr
-+ * RSP.g:33:1: aexpr : crit ( AND crit )* ;
-+ */
-+static RSPParser_aexpr_return
-+aexpr(pRSPParser ctx)
-+{
-+ RSPParser_aexpr_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN AND8;
-+ RSPParser_crit_return crit7;
-+ #undef RETURN_TYPE_crit7
-+ #define RETURN_TYPE_crit7 RSPParser_crit_return
-+
-+ RSPParser_crit_return crit9;
-+ #undef RETURN_TYPE_crit9
-+ #define RETURN_TYPE_crit9 RSPParser_crit_return
-+
-+ pANTLR3_BASE_TREE AND8_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ AND8 = NULL;
-+ crit7.tree = NULL;
-+
-+ crit9.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ AND8_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ // RSP.g:33:7: ( crit ( AND crit )* )
-+ // RSP.g:33:9: crit ( AND crit )*
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_crit_in_aexpr81);
-+ crit7=crit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleaexprEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, crit7.tree);
-+
-+ // RSP.g:33:14: ( AND crit )*
-+
-+ for (;;)
-+ {
-+ int alt3=2;
-+ switch ( LA(1) )
-+ {
-+ case AND:
-+ {
-+ alt3=1;
-+ }
-+ break;
-+
-+ }
-+
-+ switch (alt3)
-+ {
-+ case 1:
-+ // RSP.g:33:15: AND crit
-+ {
-+ AND8 = (pANTLR3_COMMON_TOKEN) MATCHT(AND, &FOLLOW_AND_in_aexpr84);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleaexprEx;
-+ }
-+
-+ AND8_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, AND8));
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, AND8_tree, root_0));
-+
-+ FOLLOWPUSH(FOLLOW_crit_in_aexpr87);
-+ crit9=crit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleaexprEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, crit9.tree);
-+
-+ }
-+ break;
-+
-+ default:
-+ goto loop3; /* break out of the loop */
-+ break;
-+ }
-+ }
-+ loop3: ; /* Jump out to here if this rule does not match */
-+
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleaexprEx; /* Prevent compiler warnings */
-+ ruleaexprEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end aexpr */
-+
-+/**
-+ * $ANTLR start crit
-+ * RSP.g:36:1: crit : ( LPAR expr RPAR -> expr | strcrit | intcrit | datecrit );
-+ */
-+static RSPParser_crit_return
-+crit(pRSPParser ctx)
-+{
-+ RSPParser_crit_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN LPAR10;
-+ pANTLR3_COMMON_TOKEN RPAR12;
-+ RSPParser_expr_return expr11;
-+ #undef RETURN_TYPE_expr11
-+ #define RETURN_TYPE_expr11 RSPParser_expr_return
-+
-+ RSPParser_strcrit_return strcrit13;
-+ #undef RETURN_TYPE_strcrit13
-+ #define RETURN_TYPE_strcrit13 RSPParser_strcrit_return
-+
-+ RSPParser_intcrit_return intcrit14;
-+ #undef RETURN_TYPE_intcrit14
-+ #define RETURN_TYPE_intcrit14 RSPParser_intcrit_return
-+
-+ RSPParser_datecrit_return datecrit15;
-+ #undef RETURN_TYPE_datecrit15
-+ #define RETURN_TYPE_datecrit15 RSPParser_datecrit_return
-+
-+ pANTLR3_BASE_TREE LPAR10_tree;
-+ pANTLR3_BASE_TREE RPAR12_tree;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_RPAR;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LPAR;
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expr;
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ LPAR10 = NULL;
-+ RPAR12 = NULL;
-+ expr11.tree = NULL;
-+
-+ strcrit13.tree = NULL;
-+
-+ intcrit14.tree = NULL;
-+
-+ datecrit15.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ LPAR10_tree = NULL;
-+ RPAR12_tree = NULL;
-+
-+ stream_RPAR = NULL;
-+ #define CREATE_stream_RPAR if (stream_RPAR == NULL) {stream_RPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token RPAR"); }
-+ stream_LPAR = NULL;
-+ #define CREATE_stream_LPAR if (stream_LPAR == NULL) {stream_LPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LPAR"); }
-+ stream_expr = NULL;
-+ #define CREATE_stream_expr if (stream_expr == NULL) {stream_expr = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expr"); }
-+
-+ retval.tree = NULL;
-+ {
-+ {
-+ // RSP.g:36:6: ( LPAR expr RPAR -> expr | strcrit | intcrit | datecrit )
-+
-+ ANTLR3_UINT32 alt4;
-+
-+ alt4=4;
-+
-+ switch ( LA(1) )
-+ {
-+ case LPAR:
-+ {
-+ alt4=1;
-+ }
-+ break;
-+ case FIELD:
-+ {
-+ switch ( LA(2) )
-+ {
-+ case NOT:
-+ {
-+ switch ( LA(3) )
-+ {
-+ case EQUAL:
-+ {
-+ switch ( LA(4) )
-+ {
-+ case STR:
-+ {
-+ alt4=2;
-+ }
-+ break;
-+ case INT:
-+ {
-+ alt4=3;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 8;
-+
-+
-+ goto rulecritEx;
-+ }
-+
-+ }
-+ break;
-+ case LESS:
-+ case GREATER:
-+ case LTE:
-+ case GTE:
-+ {
-+ alt4=3;
-+ }
-+ break;
-+ case INCLUDES:
-+ case STARTSW:
-+ case ENDSW:
-+ {
-+ alt4=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 3;
-+
-+
-+ goto rulecritEx;
-+ }
-+
-+ }
-+ break;
-+ case BEFORE:
-+ case AFTER:
-+ {
-+ alt4=4;
-+ }
-+ break;
-+ case EQUAL:
-+ {
-+ switch ( LA(3) )
-+ {
-+ case INT:
-+ {
-+ alt4=3;
-+ }
-+ break;
-+ case STR:
-+ {
-+ alt4=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 5;
-+
-+
-+ goto rulecritEx;
-+ }
-+
-+ }
-+ break;
-+ case LESS:
-+ case GREATER:
-+ case LTE:
-+ case GTE:
-+ {
-+ alt4=3;
-+ }
-+ break;
-+ case INCLUDES:
-+ case STARTSW:
-+ case ENDSW:
-+ {
-+ alt4=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 2;
-+
-+
-+ goto rulecritEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto rulecritEx;
-+ }
-+
-+ switch (alt4)
-+ {
-+ case 1:
-+ // RSP.g:36:8: LPAR expr RPAR
-+ {
-+ LPAR10 = (pANTLR3_COMMON_TOKEN) MATCHT(LPAR, &FOLLOW_LPAR_in_crit99);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ CREATE_stream_LPAR; stream_LPAR->add(stream_LPAR, LPAR10, NULL);
-+
-+ FOLLOWPUSH(FOLLOW_expr_in_crit101);
-+ expr11=expr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ CREATE_stream_expr; stream_expr->add(stream_expr, expr11.tree, NULL);
-+ RPAR12 = (pANTLR3_COMMON_TOKEN) MATCHT(RPAR, &FOLLOW_RPAR_in_crit103);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ CREATE_stream_RPAR; stream_RPAR->add(stream_RPAR, RPAR12, NULL);
-+
-+
-+
-+ /* AST REWRITE
-+ * elements : expr
-+ * token labels :
-+ * rule labels : retval
-+ * token list labels :
-+ * rule list labels :
-+ */
-+ {
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+ stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ retval.tree = root_0;
-+ // 36:25: -> expr
-+ {
-+ ADAPTOR->addChild(ADAPTOR, root_0, stream_expr == NULL ? NULL : stream_expr->nextTree(stream_expr));
-+
-+ }
-+
-+ retval.tree = root_0; // set result root
-+ if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+ }
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:37:4: strcrit
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_strcrit_in_crit114);
-+ strcrit13=strcrit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, strcrit13.tree);
-+
-+ }
-+ break;
-+ case 3:
-+ // RSP.g:38:4: intcrit
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_intcrit_in_crit119);
-+ intcrit14=intcrit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, intcrit14.tree);
-+
-+ }
-+ break;
-+ case 4:
-+ // RSP.g:39:4: datecrit
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_datecrit_in_crit124);
-+ datecrit15=datecrit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, datecrit15.tree);
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto rulecritEx; /* Prevent compiler warnings */
-+ rulecritEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+ if (stream_RPAR != NULL) stream_RPAR->free(stream_RPAR);
-+ if (stream_LPAR != NULL) stream_LPAR->free(stream_LPAR);
-+ if (stream_expr != NULL) stream_expr->free(stream_expr);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end crit */
-+
-+/**
-+ * $ANTLR start strcrit
-+ * RSP.g:42:1: strcrit : ( FIELD strop STR -> ^( strop FIELD STR ) | FIELD NOT strop STR -> ^( NOT ^( strop FIELD STR ) ) );
-+ */
-+static RSPParser_strcrit_return
-+strcrit(pRSPParser ctx)
-+{
-+ RSPParser_strcrit_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN FIELD16;
-+ pANTLR3_COMMON_TOKEN STR18;
-+ pANTLR3_COMMON_TOKEN FIELD19;
-+ pANTLR3_COMMON_TOKEN NOT20;
-+ pANTLR3_COMMON_TOKEN STR22;
-+ RSPParser_strop_return strop17;
-+ #undef RETURN_TYPE_strop17
-+ #define RETURN_TYPE_strop17 RSPParser_strop_return
-+
-+ RSPParser_strop_return strop21;
-+ #undef RETURN_TYPE_strop21
-+ #define RETURN_TYPE_strop21 RSPParser_strop_return
-+
-+ pANTLR3_BASE_TREE FIELD16_tree;
-+ pANTLR3_BASE_TREE STR18_tree;
-+ pANTLR3_BASE_TREE FIELD19_tree;
-+ pANTLR3_BASE_TREE NOT20_tree;
-+ pANTLR3_BASE_TREE STR22_tree;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_STR;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_FIELD;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_NOT;
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_strop;
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ FIELD16 = NULL;
-+ STR18 = NULL;
-+ FIELD19 = NULL;
-+ NOT20 = NULL;
-+ STR22 = NULL;
-+ strop17.tree = NULL;
-+
-+ strop21.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ FIELD16_tree = NULL;
-+ STR18_tree = NULL;
-+ FIELD19_tree = NULL;
-+ NOT20_tree = NULL;
-+ STR22_tree = NULL;
-+
-+ stream_STR = NULL;
-+ #define CREATE_stream_STR if (stream_STR == NULL) {stream_STR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token STR"); }
-+ stream_FIELD = NULL;
-+ #define CREATE_stream_FIELD if (stream_FIELD == NULL) {stream_FIELD = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token FIELD"); }
-+ stream_NOT = NULL;
-+ #define CREATE_stream_NOT if (stream_NOT == NULL) {stream_NOT = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token NOT"); }
-+ stream_strop = NULL;
-+ #define CREATE_stream_strop if (stream_strop == NULL) {stream_strop = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule strop"); }
-+
-+ retval.tree = NULL;
-+ {
-+ {
-+ // RSP.g:42:9: ( FIELD strop STR -> ^( strop FIELD STR ) | FIELD NOT strop STR -> ^( NOT ^( strop FIELD STR ) ) )
-+
-+ ANTLR3_UINT32 alt5;
-+
-+ alt5=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case FIELD:
-+ {
-+ switch ( LA(2) )
-+ {
-+ case NOT:
-+ {
-+ alt5=2;
-+ }
-+ break;
-+ case EQUAL:
-+ case INCLUDES:
-+ case STARTSW:
-+ case ENDSW:
-+ {
-+ alt5=1;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 5;
-+ EXCEPTION->state = 1;
-+
-+
-+ goto rulestrcritEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 5;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto rulestrcritEx;
-+ }
-+
-+ switch (alt5)
-+ {
-+ case 1:
-+ // RSP.g:42:11: FIELD strop STR
-+ {
-+ FIELD16 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_strcrit134);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestrcritEx;
-+ }
-+
-+ CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD16, NULL);
-+
-+ FOLLOWPUSH(FOLLOW_strop_in_strcrit136);
-+ strop17=strop(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestrcritEx;
-+ }
-+
-+ CREATE_stream_strop; stream_strop->add(stream_strop, strop17.tree, NULL);
-+ STR18 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_strcrit138);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestrcritEx;
-+ }
-+
-+ CREATE_stream_STR; stream_STR->add(stream_STR, STR18, NULL);
-+
-+
-+
-+ /* AST REWRITE
-+ * elements : FIELD, STR, strop
-+ * token labels :
-+ * rule labels : retval
-+ * token list labels :
-+ * rule list labels :
-+ */
-+ {
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+ stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ retval.tree = root_0;
-+ // 42:29: -> ^( strop FIELD STR )
-+ {
-+ // RSP.g:42:32: ^( strop FIELD STR )
-+ {
-+ pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_strop == NULL ? NULL : stream_strop->nextNode(stream_strop), root_1));
-+
-+ ADAPTOR->addChild(ADAPTOR, root_1, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
-+ ADAPTOR->addChild(ADAPTOR, root_1, stream_STR == NULL ? NULL : stream_STR->nextNode(stream_STR));
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, root_1);
-+ }
-+
-+ }
-+
-+ retval.tree = root_0; // set result root
-+ if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+ }
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:43:4: FIELD NOT strop STR
-+ {
-+ FIELD19 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_strcrit155);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestrcritEx;
-+ }
-+
-+ CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD19, NULL);
-+
-+ NOT20 = (pANTLR3_COMMON_TOKEN) MATCHT(NOT, &FOLLOW_NOT_in_strcrit157);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestrcritEx;
-+ }
-+
-+ CREATE_stream_NOT; stream_NOT->add(stream_NOT, NOT20, NULL);
-+
-+ FOLLOWPUSH(FOLLOW_strop_in_strcrit159);
-+ strop21=strop(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestrcritEx;
-+ }
-+
-+ CREATE_stream_strop; stream_strop->add(stream_strop, strop21.tree, NULL);
-+ STR22 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_strcrit161);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestrcritEx;
-+ }
-+
-+ CREATE_stream_STR; stream_STR->add(stream_STR, STR22, NULL);
-+
-+
-+
-+ /* AST REWRITE
-+ * elements : STR, FIELD, strop, NOT
-+ * token labels :
-+ * rule labels : retval
-+ * token list labels :
-+ * rule list labels :
-+ */
-+ {
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+ stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ retval.tree = root_0;
-+ // 43:25: -> ^( NOT ^( strop FIELD STR ) )
-+ {
-+ // RSP.g:43:28: ^( NOT ^( strop FIELD STR ) )
-+ {
-+ pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_NOT == NULL ? NULL : stream_NOT->nextNode(stream_NOT), root_1));
-+
-+ // RSP.g:43:34: ^( strop FIELD STR )
-+ {
-+ pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_strop == NULL ? NULL : stream_strop->nextNode(stream_strop), root_2));
-+
-+ ADAPTOR->addChild(ADAPTOR, root_2, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
-+ ADAPTOR->addChild(ADAPTOR, root_2, stream_STR == NULL ? NULL : stream_STR->nextNode(stream_STR));
-+
-+ ADAPTOR->addChild(ADAPTOR, root_1, root_2);
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, root_1);
-+ }
-+
-+ }
-+
-+ retval.tree = root_0; // set result root
-+ if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+ }
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto rulestrcritEx; /* Prevent compiler warnings */
-+ rulestrcritEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+ if (stream_STR != NULL) stream_STR->free(stream_STR);
-+ if (stream_FIELD != NULL) stream_FIELD->free(stream_FIELD);
-+ if (stream_NOT != NULL) stream_NOT->free(stream_NOT);
-+ if (stream_strop != NULL) stream_strop->free(stream_strop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end strcrit */
-+
-+/**
-+ * $ANTLR start strop
-+ * RSP.g:46:1: strop : (equal= EQUAL | includes= INCLUDES | startsw= STARTSW | endsw= ENDSW );
-+ */
-+static RSPParser_strop_return
-+strop(pRSPParser ctx)
-+{
-+ RSPParser_strop_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN equal;
-+ pANTLR3_COMMON_TOKEN includes;
-+ pANTLR3_COMMON_TOKEN startsw;
-+ pANTLR3_COMMON_TOKEN endsw;
-+
-+ pANTLR3_BASE_TREE equal_tree;
-+ pANTLR3_BASE_TREE includes_tree;
-+ pANTLR3_BASE_TREE startsw_tree;
-+ pANTLR3_BASE_TREE endsw_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ equal = NULL;
-+ includes = NULL;
-+ startsw = NULL;
-+ endsw = NULL;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ equal_tree = NULL;
-+ includes_tree = NULL;
-+ startsw_tree = NULL;
-+ endsw_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ {
-+ // RSP.g:46:7: (equal= EQUAL | includes= INCLUDES | startsw= STARTSW | endsw= ENDSW )
-+
-+ ANTLR3_UINT32 alt6;
-+
-+ alt6=4;
-+
-+ switch ( LA(1) )
-+ {
-+ case EQUAL:
-+ {
-+ alt6=1;
-+ }
-+ break;
-+ case INCLUDES:
-+ {
-+ alt6=2;
-+ }
-+ break;
-+ case STARTSW:
-+ {
-+ alt6=3;
-+ }
-+ break;
-+ case ENDSW:
-+ {
-+ alt6=4;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 6;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto rulestropEx;
-+ }
-+
-+ switch (alt6)
-+ {
-+ case 1:
-+ // RSP.g:46:9: equal= EQUAL
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ equal = (pANTLR3_COMMON_TOKEN) MATCHT(EQUAL, &FOLLOW_EQUAL_in_strop188);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestropEx;
-+ }
-+
-+ equal_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, equal));
-+ ADAPTOR->addChild(ADAPTOR, root_0, equal_tree);
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:47:4: includes= INCLUDES
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ includes = (pANTLR3_COMMON_TOKEN) MATCHT(INCLUDES, &FOLLOW_INCLUDES_in_strop195);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestropEx;
-+ }
-+
-+ includes_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, includes));
-+ ADAPTOR->addChild(ADAPTOR, root_0, includes_tree);
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // RSP.g:48:4: startsw= STARTSW
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ startsw = (pANTLR3_COMMON_TOKEN) MATCHT(STARTSW, &FOLLOW_STARTSW_in_strop202);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestropEx;
-+ }
-+
-+ startsw_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, startsw));
-+ ADAPTOR->addChild(ADAPTOR, root_0, startsw_tree);
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // RSP.g:49:4: endsw= ENDSW
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ endsw = (pANTLR3_COMMON_TOKEN) MATCHT(ENDSW, &FOLLOW_ENDSW_in_strop209);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulestropEx;
-+ }
-+
-+ endsw_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, endsw));
-+ ADAPTOR->addChild(ADAPTOR, root_0, endsw_tree);
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto rulestropEx; /* Prevent compiler warnings */
-+ rulestropEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end strop */
-+
-+/**
-+ * $ANTLR start intcrit
-+ * RSP.g:52:1: intcrit : ( FIELD intop INT -> ^( intop FIELD INT ) | FIELD NOT intop INT -> ^( NOT ^( intop FIELD INT ) ) );
-+ */
-+static RSPParser_intcrit_return
-+intcrit(pRSPParser ctx)
-+{
-+ RSPParser_intcrit_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN FIELD23;
-+ pANTLR3_COMMON_TOKEN INT25;
-+ pANTLR3_COMMON_TOKEN FIELD26;
-+ pANTLR3_COMMON_TOKEN NOT27;
-+ pANTLR3_COMMON_TOKEN INT29;
-+ RSPParser_intop_return intop24;
-+ #undef RETURN_TYPE_intop24
-+ #define RETURN_TYPE_intop24 RSPParser_intop_return
-+
-+ RSPParser_intop_return intop28;
-+ #undef RETURN_TYPE_intop28
-+ #define RETURN_TYPE_intop28 RSPParser_intop_return
-+
-+ pANTLR3_BASE_TREE FIELD23_tree;
-+ pANTLR3_BASE_TREE INT25_tree;
-+ pANTLR3_BASE_TREE FIELD26_tree;
-+ pANTLR3_BASE_TREE NOT27_tree;
-+ pANTLR3_BASE_TREE INT29_tree;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_FIELD;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_INT;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_NOT;
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_intop;
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ FIELD23 = NULL;
-+ INT25 = NULL;
-+ FIELD26 = NULL;
-+ NOT27 = NULL;
-+ INT29 = NULL;
-+ intop24.tree = NULL;
-+
-+ intop28.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ FIELD23_tree = NULL;
-+ INT25_tree = NULL;
-+ FIELD26_tree = NULL;
-+ NOT27_tree = NULL;
-+ INT29_tree = NULL;
-+
-+ stream_FIELD = NULL;
-+ #define CREATE_stream_FIELD if (stream_FIELD == NULL) {stream_FIELD = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token FIELD"); }
-+ stream_INT = NULL;
-+ #define CREATE_stream_INT if (stream_INT == NULL) {stream_INT = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token INT"); }
-+ stream_NOT = NULL;
-+ #define CREATE_stream_NOT if (stream_NOT == NULL) {stream_NOT = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token NOT"); }
-+ stream_intop = NULL;
-+ #define CREATE_stream_intop if (stream_intop == NULL) {stream_intop = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule intop"); }
-+
-+ retval.tree = NULL;
-+ {
-+ {
-+ // RSP.g:52:9: ( FIELD intop INT -> ^( intop FIELD INT ) | FIELD NOT intop INT -> ^( NOT ^( intop FIELD INT ) ) )
-+
-+ ANTLR3_UINT32 alt7;
-+
-+ alt7=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case FIELD:
-+ {
-+ switch ( LA(2) )
-+ {
-+ case NOT:
-+ {
-+ alt7=2;
-+ }
-+ break;
-+ case EQUAL:
-+ case LESS:
-+ case GREATER:
-+ case LTE:
-+ case GTE:
-+ {
-+ alt7=1;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 7;
-+ EXCEPTION->state = 1;
-+
-+
-+ goto ruleintcritEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 7;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleintcritEx;
-+ }
-+
-+ switch (alt7)
-+ {
-+ case 1:
-+ // RSP.g:52:11: FIELD intop INT
-+ {
-+ FIELD23 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_intcrit219);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintcritEx;
-+ }
-+
-+ CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD23, NULL);
-+
-+ FOLLOWPUSH(FOLLOW_intop_in_intcrit221);
-+ intop24=intop(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintcritEx;
-+ }
-+
-+ CREATE_stream_intop; stream_intop->add(stream_intop, intop24.tree, NULL);
-+ INT25 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_intcrit223);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintcritEx;
-+ }
-+
-+ CREATE_stream_INT; stream_INT->add(stream_INT, INT25, NULL);
-+
-+
-+
-+ /* AST REWRITE
-+ * elements : FIELD, INT, intop
-+ * token labels :
-+ * rule labels : retval
-+ * token list labels :
-+ * rule list labels :
-+ */
-+ {
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+ stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ retval.tree = root_0;
-+ // 52:29: -> ^( intop FIELD INT )
-+ {
-+ // RSP.g:52:32: ^( intop FIELD INT )
-+ {
-+ pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_intop == NULL ? NULL : stream_intop->nextNode(stream_intop), root_1));
-+
-+ ADAPTOR->addChild(ADAPTOR, root_1, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
-+ ADAPTOR->addChild(ADAPTOR, root_1, stream_INT == NULL ? NULL : stream_INT->nextNode(stream_INT));
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, root_1);
-+ }
-+
-+ }
-+
-+ retval.tree = root_0; // set result root
-+ if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+ }
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:53:4: FIELD NOT intop INT
-+ {
-+ FIELD26 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_intcrit240);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintcritEx;
-+ }
-+
-+ CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD26, NULL);
-+
-+ NOT27 = (pANTLR3_COMMON_TOKEN) MATCHT(NOT, &FOLLOW_NOT_in_intcrit242);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintcritEx;
-+ }
-+
-+ CREATE_stream_NOT; stream_NOT->add(stream_NOT, NOT27, NULL);
-+
-+ FOLLOWPUSH(FOLLOW_intop_in_intcrit244);
-+ intop28=intop(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintcritEx;
-+ }
-+
-+ CREATE_stream_intop; stream_intop->add(stream_intop, intop28.tree, NULL);
-+ INT29 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_intcrit246);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintcritEx;
-+ }
-+
-+ CREATE_stream_INT; stream_INT->add(stream_INT, INT29, NULL);
-+
-+
-+
-+ /* AST REWRITE
-+ * elements : intop, NOT, INT, FIELD
-+ * token labels :
-+ * rule labels : retval
-+ * token list labels :
-+ * rule list labels :
-+ */
-+ {
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+ stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ retval.tree = root_0;
-+ // 53:25: -> ^( NOT ^( intop FIELD INT ) )
-+ {
-+ // RSP.g:53:28: ^( NOT ^( intop FIELD INT ) )
-+ {
-+ pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_NOT == NULL ? NULL : stream_NOT->nextNode(stream_NOT), root_1));
-+
-+ // RSP.g:53:34: ^( intop FIELD INT )
-+ {
-+ pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_intop == NULL ? NULL : stream_intop->nextNode(stream_intop), root_2));
-+
-+ ADAPTOR->addChild(ADAPTOR, root_2, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
-+ ADAPTOR->addChild(ADAPTOR, root_2, stream_INT == NULL ? NULL : stream_INT->nextNode(stream_INT));
-+
-+ ADAPTOR->addChild(ADAPTOR, root_1, root_2);
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, root_1);
-+ }
-+
-+ }
-+
-+ retval.tree = root_0; // set result root
-+ if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+ }
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleintcritEx; /* Prevent compiler warnings */
-+ ruleintcritEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+ if (stream_FIELD != NULL) stream_FIELD->free(stream_FIELD);
-+ if (stream_INT != NULL) stream_INT->free(stream_INT);
-+ if (stream_NOT != NULL) stream_NOT->free(stream_NOT);
-+ if (stream_intop != NULL) stream_intop->free(stream_intop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end intcrit */
-+
-+/**
-+ * $ANTLR start intop
-+ * RSP.g:56:1: intop : (equal= EQUAL | less= LESS | greater= GREATER | lte= LTE | gte= GTE );
-+ */
-+static RSPParser_intop_return
-+intop(pRSPParser ctx)
-+{
-+ RSPParser_intop_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN equal;
-+ pANTLR3_COMMON_TOKEN less;
-+ pANTLR3_COMMON_TOKEN greater;
-+ pANTLR3_COMMON_TOKEN lte;
-+ pANTLR3_COMMON_TOKEN gte;
-+
-+ pANTLR3_BASE_TREE equal_tree;
-+ pANTLR3_BASE_TREE less_tree;
-+ pANTLR3_BASE_TREE greater_tree;
-+ pANTLR3_BASE_TREE lte_tree;
-+ pANTLR3_BASE_TREE gte_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ equal = NULL;
-+ less = NULL;
-+ greater = NULL;
-+ lte = NULL;
-+ gte = NULL;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ equal_tree = NULL;
-+ less_tree = NULL;
-+ greater_tree = NULL;
-+ lte_tree = NULL;
-+ gte_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ {
-+ // RSP.g:56:7: (equal= EQUAL | less= LESS | greater= GREATER | lte= LTE | gte= GTE )
-+
-+ ANTLR3_UINT32 alt8;
-+
-+ alt8=5;
-+
-+ switch ( LA(1) )
-+ {
-+ case EQUAL:
-+ {
-+ alt8=1;
-+ }
-+ break;
-+ case LESS:
-+ {
-+ alt8=2;
-+ }
-+ break;
-+ case GREATER:
-+ {
-+ alt8=3;
-+ }
-+ break;
-+ case LTE:
-+ {
-+ alt8=4;
-+ }
-+ break;
-+ case GTE:
-+ {
-+ alt8=5;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 8;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleintopEx;
-+ }
-+
-+ switch (alt8)
-+ {
-+ case 1:
-+ // RSP.g:56:9: equal= EQUAL
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ equal = (pANTLR3_COMMON_TOKEN) MATCHT(EQUAL, &FOLLOW_EQUAL_in_intop273);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintopEx;
-+ }
-+
-+ equal_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, equal));
-+ ADAPTOR->addChild(ADAPTOR, root_0, equal_tree);
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:57:4: less= LESS
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ less = (pANTLR3_COMMON_TOKEN) MATCHT(LESS, &FOLLOW_LESS_in_intop280);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintopEx;
-+ }
-+
-+ less_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, less));
-+ ADAPTOR->addChild(ADAPTOR, root_0, less_tree);
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // RSP.g:58:4: greater= GREATER
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ greater = (pANTLR3_COMMON_TOKEN) MATCHT(GREATER, &FOLLOW_GREATER_in_intop287);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintopEx;
-+ }
-+
-+ greater_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, greater));
-+ ADAPTOR->addChild(ADAPTOR, root_0, greater_tree);
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // RSP.g:59:4: lte= LTE
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ lte = (pANTLR3_COMMON_TOKEN) MATCHT(LTE, &FOLLOW_LTE_in_intop294);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintopEx;
-+ }
-+
-+ lte_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, lte));
-+ ADAPTOR->addChild(ADAPTOR, root_0, lte_tree);
-+
-+
-+ }
-+ break;
-+ case 5:
-+ // RSP.g:60:4: gte= GTE
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ gte = (pANTLR3_COMMON_TOKEN) MATCHT(GTE, &FOLLOW_GTE_in_intop301);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintopEx;
-+ }
-+
-+ gte_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, gte));
-+ ADAPTOR->addChild(ADAPTOR, root_0, gte_tree);
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleintopEx; /* Prevent compiler warnings */
-+ ruleintopEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end intop */
-+
-+/**
-+ * $ANTLR start datecrit
-+ * RSP.g:63:1: datecrit : FIELD dateop datespec -> ^( dateop FIELD datespec ) ;
-+ */
-+static RSPParser_datecrit_return
-+datecrit(pRSPParser ctx)
-+{
-+ RSPParser_datecrit_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN FIELD30;
-+ RSPParser_dateop_return dateop31;
-+ #undef RETURN_TYPE_dateop31
-+ #define RETURN_TYPE_dateop31 RSPParser_dateop_return
-+
-+ RSPParser_datespec_return datespec32;
-+ #undef RETURN_TYPE_datespec32
-+ #define RETURN_TYPE_datespec32 RSPParser_datespec_return
-+
-+ pANTLR3_BASE_TREE FIELD30_tree;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_FIELD;
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_datespec;
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_dateop;
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ FIELD30 = NULL;
-+ dateop31.tree = NULL;
-+
-+ datespec32.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ FIELD30_tree = NULL;
-+
-+ stream_FIELD = NULL;
-+ #define CREATE_stream_FIELD if (stream_FIELD == NULL) {stream_FIELD = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token FIELD"); }
-+ stream_datespec = NULL;
-+ #define CREATE_stream_datespec if (stream_datespec == NULL) {stream_datespec = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule datespec"); }
-+ stream_dateop = NULL;
-+ #define CREATE_stream_dateop if (stream_dateop == NULL) {stream_dateop = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule dateop"); }
-+
-+ retval.tree = NULL;
-+ {
-+ // RSP.g:63:9: ( FIELD dateop datespec -> ^( dateop FIELD datespec ) )
-+ // RSP.g:63:11: FIELD dateop datespec
-+ {
-+ FIELD30 = (pANTLR3_COMMON_TOKEN) MATCHT(FIELD, &FOLLOW_FIELD_in_datecrit310);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatecritEx;
-+ }
-+
-+ CREATE_stream_FIELD; stream_FIELD->add(stream_FIELD, FIELD30, NULL);
-+
-+ FOLLOWPUSH(FOLLOW_dateop_in_datecrit312);
-+ dateop31=dateop(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatecritEx;
-+ }
-+
-+ CREATE_stream_dateop; stream_dateop->add(stream_dateop, dateop31.tree, NULL);
-+ FOLLOWPUSH(FOLLOW_datespec_in_datecrit314);
-+ datespec32=datespec(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatecritEx;
-+ }
-+
-+ CREATE_stream_datespec; stream_datespec->add(stream_datespec, datespec32.tree, NULL);
-+
-+
-+ /* AST REWRITE
-+ * elements : FIELD, dateop, datespec
-+ * token labels :
-+ * rule labels : retval
-+ * token list labels :
-+ * rule list labels :
-+ */
-+ {
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+ stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ retval.tree = root_0;
-+ // 63:34: -> ^( dateop FIELD datespec )
-+ {
-+ // RSP.g:63:37: ^( dateop FIELD datespec )
-+ {
-+ pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_dateop == NULL ? NULL : stream_dateop->nextNode(stream_dateop), root_1));
-+
-+ ADAPTOR->addChild(ADAPTOR, root_1, stream_FIELD == NULL ? NULL : stream_FIELD->nextNode(stream_FIELD));
-+ ADAPTOR->addChild(ADAPTOR, root_1, stream_datespec == NULL ? NULL : stream_datespec->nextTree(stream_datespec));
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, root_1);
-+ }
-+
-+ }
-+
-+ retval.tree = root_0; // set result root
-+ if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+ }
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruledatecritEx; /* Prevent compiler warnings */
-+ ruledatecritEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+ if (stream_FIELD != NULL) stream_FIELD->free(stream_FIELD);
-+ if (stream_datespec != NULL) stream_datespec->free(stream_datespec);
-+ if (stream_dateop != NULL) stream_dateop->free(stream_dateop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end datecrit */
-+
-+/**
-+ * $ANTLR start dateop
-+ * RSP.g:66:1: dateop : (before= BEFORE | after= AFTER );
-+ */
-+static RSPParser_dateop_return
-+dateop(pRSPParser ctx)
-+{
-+ RSPParser_dateop_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN before;
-+ pANTLR3_COMMON_TOKEN after;
-+
-+ pANTLR3_BASE_TREE before_tree;
-+ pANTLR3_BASE_TREE after_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ before = NULL;
-+ after = NULL;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ before_tree = NULL;
-+ after_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ {
-+ // RSP.g:66:8: (before= BEFORE | after= AFTER )
-+
-+ ANTLR3_UINT32 alt9;
-+
-+ alt9=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case BEFORE:
-+ {
-+ alt9=1;
-+ }
-+ break;
-+ case AFTER:
-+ {
-+ alt9=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 9;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruledateopEx;
-+ }
-+
-+ switch (alt9)
-+ {
-+ case 1:
-+ // RSP.g:66:10: before= BEFORE
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ before = (pANTLR3_COMMON_TOKEN) MATCHT(BEFORE, &FOLLOW_BEFORE_in_dateop337);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledateopEx;
-+ }
-+
-+ before_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, before));
-+ ADAPTOR->addChild(ADAPTOR, root_0, before_tree);
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:67:4: after= AFTER
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ after = (pANTLR3_COMMON_TOKEN) MATCHT(AFTER, &FOLLOW_AFTER_in_dateop344);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledateopEx;
-+ }
-+
-+ after_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, after));
-+ ADAPTOR->addChild(ADAPTOR, root_0, after_tree);
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruledateopEx; /* Prevent compiler warnings */
-+ ruledateopEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end dateop */
-+
-+/**
-+ * $ANTLR start datespec
-+ * RSP.g:70:1: datespec : ( dateref | INT dateintval dateop dateref -> ^( dateop dateref INT dateintval ) );
-+ */
-+static RSPParser_datespec_return
-+datespec(pRSPParser ctx)
-+{
-+ RSPParser_datespec_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN INT34;
-+ RSPParser_dateref_return dateref33;
-+ #undef RETURN_TYPE_dateref33
-+ #define RETURN_TYPE_dateref33 RSPParser_dateref_return
-+
-+ RSPParser_dateintval_return dateintval35;
-+ #undef RETURN_TYPE_dateintval35
-+ #define RETURN_TYPE_dateintval35 RSPParser_dateintval_return
-+
-+ RSPParser_dateop_return dateop36;
-+ #undef RETURN_TYPE_dateop36
-+ #define RETURN_TYPE_dateop36 RSPParser_dateop_return
-+
-+ RSPParser_dateref_return dateref37;
-+ #undef RETURN_TYPE_dateref37
-+ #define RETURN_TYPE_dateref37 RSPParser_dateref_return
-+
-+ pANTLR3_BASE_TREE INT34_tree;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_INT;
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_dateintval;
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_dateref;
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_dateop;
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ INT34 = NULL;
-+ dateref33.tree = NULL;
-+
-+ dateintval35.tree = NULL;
-+
-+ dateop36.tree = NULL;
-+
-+ dateref37.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ INT34_tree = NULL;
-+
-+ stream_INT = NULL;
-+ #define CREATE_stream_INT if (stream_INT == NULL) {stream_INT = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token INT"); }
-+ stream_dateintval = NULL;
-+ #define CREATE_stream_dateintval if (stream_dateintval == NULL) {stream_dateintval = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule dateintval"); }
-+ stream_dateref = NULL;
-+ #define CREATE_stream_dateref if (stream_dateref == NULL) {stream_dateref = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule dateref"); }
-+ stream_dateop = NULL;
-+ #define CREATE_stream_dateop if (stream_dateop == NULL) {stream_dateop = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule dateop"); }
-+
-+ retval.tree = NULL;
-+ {
-+ {
-+ // RSP.g:70:9: ( dateref | INT dateintval dateop dateref -> ^( dateop dateref INT dateintval ) )
-+
-+ ANTLR3_UINT32 alt10;
-+
-+ alt10=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case DATE:
-+ case TODAY:
-+ {
-+ alt10=1;
-+ }
-+ break;
-+ case INT:
-+ {
-+ alt10=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 10;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruledatespecEx;
-+ }
-+
-+ switch (alt10)
-+ {
-+ case 1:
-+ // RSP.g:70:11: dateref
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_dateref_in_datespec353);
-+ dateref33=dateref(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatespecEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, dateref33.tree);
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:71:4: INT dateintval dateop dateref
-+ {
-+ INT34 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_datespec358);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatespecEx;
-+ }
-+
-+ CREATE_stream_INT; stream_INT->add(stream_INT, INT34, NULL);
-+
-+ FOLLOWPUSH(FOLLOW_dateintval_in_datespec360);
-+ dateintval35=dateintval(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatespecEx;
-+ }
-+
-+ CREATE_stream_dateintval; stream_dateintval->add(stream_dateintval, dateintval35.tree, NULL);
-+ FOLLOWPUSH(FOLLOW_dateop_in_datespec362);
-+ dateop36=dateop(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatespecEx;
-+ }
-+
-+ CREATE_stream_dateop; stream_dateop->add(stream_dateop, dateop36.tree, NULL);
-+ FOLLOWPUSH(FOLLOW_dateref_in_datespec364);
-+ dateref37=dateref(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatespecEx;
-+ }
-+
-+ CREATE_stream_dateref; stream_dateref->add(stream_dateref, dateref37.tree, NULL);
-+
-+
-+ /* AST REWRITE
-+ * elements : dateop, INT, dateintval, dateref
-+ * token labels :
-+ * rule labels : retval
-+ * token list labels :
-+ * rule list labels :
-+ */
-+ {
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+ stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ retval.tree = root_0;
-+ // 71:34: -> ^( dateop dateref INT dateintval )
-+ {
-+ // RSP.g:71:37: ^( dateop dateref INT dateintval )
-+ {
-+ pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_dateop == NULL ? NULL : stream_dateop->nextNode(stream_dateop), root_1));
-+
-+ ADAPTOR->addChild(ADAPTOR, root_1, stream_dateref == NULL ? NULL : stream_dateref->nextTree(stream_dateref));
-+ ADAPTOR->addChild(ADAPTOR, root_1, stream_INT == NULL ? NULL : stream_INT->nextNode(stream_INT));
-+ ADAPTOR->addChild(ADAPTOR, root_1, stream_dateintval == NULL ? NULL : stream_dateintval->nextTree(stream_dateintval));
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, root_1);
-+ }
-+
-+ }
-+
-+ retval.tree = root_0; // set result root
-+ if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+ }
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruledatespecEx; /* Prevent compiler warnings */
-+ ruledatespecEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+ if (stream_INT != NULL) stream_INT->free(stream_INT);
-+ if (stream_dateintval != NULL) stream_dateintval->free(stream_dateintval);
-+ if (stream_dateref != NULL) stream_dateref->free(stream_dateref);
-+ if (stream_dateop != NULL) stream_dateop->free(stream_dateop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end datespec */
-+
-+/**
-+ * $ANTLR start dateref
-+ * RSP.g:74:1: dateref : (date= DATE | today= TODAY );
-+ */
-+static RSPParser_dateref_return
-+dateref(pRSPParser ctx)
-+{
-+ RSPParser_dateref_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN date;
-+ pANTLR3_COMMON_TOKEN today;
-+
-+ pANTLR3_BASE_TREE date_tree;
-+ pANTLR3_BASE_TREE today_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ date = NULL;
-+ today = NULL;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ date_tree = NULL;
-+ today_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ {
-+ // RSP.g:74:9: (date= DATE | today= TODAY )
-+
-+ ANTLR3_UINT32 alt11;
-+
-+ alt11=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case DATE:
-+ {
-+ alt11=1;
-+ }
-+ break;
-+ case TODAY:
-+ {
-+ alt11=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 11;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruledaterefEx;
-+ }
-+
-+ switch (alt11)
-+ {
-+ case 1:
-+ // RSP.g:74:11: date= DATE
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ date = (pANTLR3_COMMON_TOKEN) MATCHT(DATE, &FOLLOW_DATE_in_dateref388);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledaterefEx;
-+ }
-+
-+ date_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, date));
-+ ADAPTOR->addChild(ADAPTOR, root_0, date_tree);
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:75:4: today= TODAY
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ today = (pANTLR3_COMMON_TOKEN) MATCHT(TODAY, &FOLLOW_TODAY_in_dateref395);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledaterefEx;
-+ }
-+
-+ today_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, today));
-+ ADAPTOR->addChild(ADAPTOR, root_0, today_tree);
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruledaterefEx; /* Prevent compiler warnings */
-+ ruledaterefEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end dateref */
-+
-+/**
-+ * $ANTLR start dateintval
-+ * RSP.g:78:1: dateintval : (day= DAY | week= WEEK | month= MONTH | year= YEAR );
-+ */
-+static RSPParser_dateintval_return
-+dateintval(pRSPParser ctx)
-+{
-+ RSPParser_dateintval_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN day;
-+ pANTLR3_COMMON_TOKEN week;
-+ pANTLR3_COMMON_TOKEN month;
-+ pANTLR3_COMMON_TOKEN year;
-+
-+ pANTLR3_BASE_TREE day_tree;
-+ pANTLR3_BASE_TREE week_tree;
-+ pANTLR3_BASE_TREE month_tree;
-+ pANTLR3_BASE_TREE year_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ day = NULL;
-+ week = NULL;
-+ month = NULL;
-+ year = NULL;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ day_tree = NULL;
-+ week_tree = NULL;
-+ month_tree = NULL;
-+ year_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ {
-+ // RSP.g:79:2: (day= DAY | week= WEEK | month= MONTH | year= YEAR )
-+
-+ ANTLR3_UINT32 alt12;
-+
-+ alt12=4;
-+
-+ switch ( LA(1) )
-+ {
-+ case DAY:
-+ {
-+ alt12=1;
-+ }
-+ break;
-+ case WEEK:
-+ {
-+ alt12=2;
-+ }
-+ break;
-+ case MONTH:
-+ {
-+ alt12=3;
-+ }
-+ break;
-+ case YEAR:
-+ {
-+ alt12=4;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 12;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruledateintvalEx;
-+ }
-+
-+ switch (alt12)
-+ {
-+ case 1:
-+ // RSP.g:79:4: day= DAY
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ day = (pANTLR3_COMMON_TOKEN) MATCHT(DAY, &FOLLOW_DAY_in_dateintval408);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledateintvalEx;
-+ }
-+
-+ day_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, day));
-+ ADAPTOR->addChild(ADAPTOR, root_0, day_tree);
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // RSP.g:80:4: week= WEEK
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ week = (pANTLR3_COMMON_TOKEN) MATCHT(WEEK, &FOLLOW_WEEK_in_dateintval415);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledateintvalEx;
-+ }
-+
-+ week_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, week));
-+ ADAPTOR->addChild(ADAPTOR, root_0, week_tree);
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // RSP.g:81:4: month= MONTH
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ month = (pANTLR3_COMMON_TOKEN) MATCHT(MONTH, &FOLLOW_MONTH_in_dateintval422);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledateintvalEx;
-+ }
-+
-+ month_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, month));
-+ ADAPTOR->addChild(ADAPTOR, root_0, month_tree);
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // RSP.g:82:4: year= YEAR
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ year = (pANTLR3_COMMON_TOKEN) MATCHT(YEAR, &FOLLOW_YEAR_in_dateintval429);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledateintvalEx;
-+ }
-+
-+ year_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, year));
-+ ADAPTOR->addChild(ADAPTOR, root_0, year_tree);
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruledateintvalEx; /* Prevent compiler warnings */
-+ ruledateintvalEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end dateintval */
-+/* End of parsing rules
-+ * ==============================================
-+ */
-+
-+/* ==============================================
-+ * Syntactic predicates
-+ */
-+/* End of syntactic predicates
-+ * ==============================================
-+ */
-+
-+
-+
-+
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/RSPParser.h b/src/pregen/RSPParser.h
-new file mode 100644
-index 0000000..1796c0a
---- /dev/null
-+++ b/src/pregen/RSPParser.h
-@@ -0,0 +1,365 @@
-+/** \file
-+ * This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : RSP.g
-+ * - On : 2016-01-01 12:23:42
-+ * - for the parser : RSPParserParser *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The parser RSPParser has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ *
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pRSPParser, which is returned from a call to RSPParserNew().
-+ *
-+ * The methods in pRSPParser are as follows:
-+ *
-+ * - RSPParser_query_return pRSPParser->query(pRSPParser)
-+ * - RSPParser_expr_return pRSPParser->expr(pRSPParser)
-+ * - RSPParser_aexpr_return pRSPParser->aexpr(pRSPParser)
-+ * - RSPParser_crit_return pRSPParser->crit(pRSPParser)
-+ * - RSPParser_strcrit_return pRSPParser->strcrit(pRSPParser)
-+ * - RSPParser_strop_return pRSPParser->strop(pRSPParser)
-+ * - RSPParser_intcrit_return pRSPParser->intcrit(pRSPParser)
-+ * - RSPParser_intop_return pRSPParser->intop(pRSPParser)
-+ * - RSPParser_datecrit_return pRSPParser->datecrit(pRSPParser)
-+ * - RSPParser_dateop_return pRSPParser->dateop(pRSPParser)
-+ * - RSPParser_datespec_return pRSPParser->datespec(pRSPParser)
-+ * - RSPParser_dateref_return pRSPParser->dateref(pRSPParser)
-+ * - RSPParser_dateintval_return pRSPParser->dateintval(pRSPParser)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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 _RSPParser_H
-+#define _RSPParser_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct RSPParser_Ctx_struct RSPParser, * pRSPParser;
-+
-+
-+
-+#ifdef ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter, - Rules with parameters that are not used
-+// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
-+// initialized but unused variable - tree rewrite variables declared but not needed
-+// Unreferenced local variable - lexer rule declares but does not always use _type
-+// potentially unitialized variable used - retval always returned from a rule
-+// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+typedef struct RSPParser_query_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ RSPParser_query_return;
-+
-+typedef struct RSPParser_expr_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ RSPParser_expr_return;
-+
-+typedef struct RSPParser_aexpr_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ RSPParser_aexpr_return;
-+
-+typedef struct RSPParser_crit_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ RSPParser_crit_return;
-+
-+typedef struct RSPParser_strcrit_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ RSPParser_strcrit_return;
-+
-+typedef struct RSPParser_strop_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ RSPParser_strop_return;
-+
-+typedef struct RSPParser_intcrit_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ RSPParser_intcrit_return;
-+
-+typedef struct RSPParser_intop_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ RSPParser_intop_return;
-+
-+typedef struct RSPParser_datecrit_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ RSPParser_datecrit_return;
-+
-+typedef struct RSPParser_dateop_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ RSPParser_dateop_return;
-+
-+typedef struct RSPParser_datespec_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ RSPParser_datespec_return;
-+
-+typedef struct RSPParser_dateref_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ RSPParser_dateref_return;
-+
-+typedef struct RSPParser_dateintval_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ RSPParser_dateintval_return;
-+
-+
-+
-+/** Context tracking structure for RSPParser
-+ */
-+struct RSPParser_Ctx_struct
-+{
-+ /** Built in ANTLR3 context tracker contains all the generic elements
-+ * required for context tracking.
-+ */
-+ pANTLR3_PARSER pParser;
-+
-+
-+ RSPParser_query_return (*query) (struct RSPParser_Ctx_struct * ctx);
-+ RSPParser_expr_return (*expr) (struct RSPParser_Ctx_struct * ctx);
-+ RSPParser_aexpr_return (*aexpr) (struct RSPParser_Ctx_struct * ctx);
-+ RSPParser_crit_return (*crit) (struct RSPParser_Ctx_struct * ctx);
-+ RSPParser_strcrit_return (*strcrit) (struct RSPParser_Ctx_struct * ctx);
-+ RSPParser_strop_return (*strop) (struct RSPParser_Ctx_struct * ctx);
-+ RSPParser_intcrit_return (*intcrit) (struct RSPParser_Ctx_struct * ctx);
-+ RSPParser_intop_return (*intop) (struct RSPParser_Ctx_struct * ctx);
-+ RSPParser_datecrit_return (*datecrit) (struct RSPParser_Ctx_struct * ctx);
-+ RSPParser_dateop_return (*dateop) (struct RSPParser_Ctx_struct * ctx);
-+ RSPParser_datespec_return (*datespec) (struct RSPParser_Ctx_struct * ctx);
-+ RSPParser_dateref_return (*dateref) (struct RSPParser_Ctx_struct * ctx);
-+ RSPParser_dateintval_return (*dateintval) (struct RSPParser_Ctx_struct * ctx);
-+ // Delegated rules
-+ const char * (*getGrammarFileName)();
-+ void (*free) (struct RSPParser_Ctx_struct * ctx);
-+ /* @headerFile.members() */
-+ pANTLR3_BASE_TREE_ADAPTOR adaptor;
-+ pANTLR3_VECTOR_FACTORY vectors;
-+ /* End @headerFile.members() */
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pRSPParser RSPParserNew (pANTLR3_COMMON_TOKEN_STREAM instream);
-+ANTLR3_API pRSPParser RSPParserNewSSD (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the parser will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef EOF
-+#undef EOF
-+#endif
-+#ifdef Tokens
-+#undef Tokens
-+#endif
-+#define STARTSW 14
-+#define WEEK 26
-+#define TODAY 24
-+#define YEAR 28
-+#define ENDSW 15
-+#define GTE 20
-+#define BEFORE 21
-+#define DAY 25
-+#define INT 16
-+#define NOT 11
-+#define AFTER 22
-+#define AND 6
-+#define EOF -1
-+#define LTE 19
-+#define MONTH 27
-+#define DIGIT19 31
-+#define INCLUDES 13
-+#define STR 10
-+#define QUOTE 29
-+#define WS 30
-+#define GREATER 18
-+#define NEWLINE 4
-+#define LPAR 7
-+#define EQUAL 12
-+#define OR 5
-+#define LESS 17
-+#define RPAR 8
-+#define FIELD 9
-+#define ESCAPED 33
-+#define DATE 23
-+#define DIGIT09 32
-+#ifdef EOF
-+#undef EOF
-+#define EOF ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for RSPParser
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/SMARTPL.u b/src/pregen/SMARTPL.u
-new file mode 100644
-index 0000000..2a66bf3
---- /dev/null
-+++ b/src/pregen/SMARTPL.u
-@@ -0,0 +1,6 @@
-+SMARTPLParser.c : SMARTPL.g
-+./SMARTPL.tokens : SMARTPL.g
-+SMARTPLParser.h : SMARTPL.g
-+SMARTPLLexer.c : SMARTPL.g
-+SMARTPLLexer.h : SMARTPL.g
-+ANTLR_PRODUCTS += SMARTPLParser.c ./SMARTPL.tokens SMARTPLParser.h SMARTPLLexer.c SMARTPLLexer.h
-\ No newline at end of file
-diff --git a/src/pregen/SMARTPL2SQL.c b/src/pregen/SMARTPL2SQL.c
-new file mode 100644
-index 0000000..bd93752
---- /dev/null
-+++ b/src/pregen/SMARTPL2SQL.c
-@@ -0,0 +1,1649 @@
-+/** \file
-+ * This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : SMARTPL2SQL.g
-+ * - On : 2016-01-01 12:23:44
-+ * - for the tree parser : SMARTPL2SQLTreeParser *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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.
-+
-+
-+/* =============================================================================
-+ * This is what the grammar programmer asked us to put at the top of every file.
-+ */
-+
-+ #include <stdio.h>
-+ #include <stdlib.h>
-+ #include <string.h>
-+ #include <limits.h>
-+ #include <errno.h>
-+ #include <time.h>
-+ #include <sqlite3.h>
-+
-+ #include "logger.h"
-+ #include "db.h"
-+
-+/* End of Header action.
-+ * =============================================================================
-+ */
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include "SMARTPL2SQL.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+
-+#define CTX ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef SCOPE_TYPE
-+#undef SCOPE_STACK
-+#undef SCOPE_TOP
-+#define SCOPE_TYPE(scope) pSMARTPL2SQL_##scope##_SCOPE
-+#define SCOPE_STACK(scope) pSMARTPL2SQL_##scope##Stack
-+#define SCOPE_TOP(scope) ctx->pSMARTPL2SQL_##scope##Top
-+#define SCOPE_SIZE(scope) ctx->pSMARTPL2SQL_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i) (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+/* Macros for accessing things in the parser
-+ */
-+
-+#undef PARSER
-+#undef RECOGNIZER
-+#undef HAVEPARSEDRULE
-+#undef INPUT
-+#undef STRSTREAM
-+#undef HASEXCEPTION
-+#undef EXCEPTION
-+#undef MATCHT
-+#undef MATCHANYT
-+#undef FOLLOWSTACK
-+#undef FOLLOWPUSH
-+#undef FOLLOWPOP
-+#undef PRECOVER
-+#undef PREPORTERROR
-+#undef LA
-+#undef LT
-+#undef CONSTRUCTEX
-+#undef CONSUME
-+#undef MARK
-+#undef REWIND
-+#undef REWINDLAST
-+#undef PERRORRECOVERY
-+#undef HASFAILED
-+#undef FAILEDFLAG
-+#undef RECOVERFROMMISMATCHEDSET
-+#undef RECOVERFROMMISMATCHEDELEMENT
-+#undef BACKTRACKING
-+#undef ADAPTOR
-+#undef RULEMEMO
-+#undef SEEK
-+#undef INDEX
-+#undef DBG
-+
-+#define PARSER ctx->pTreeParser
-+#define RECOGNIZER PARSER->rec
-+#define PSRSTATE RECOGNIZER->state
-+#define HAVEPARSEDRULE(r) RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define INPUT PARSER->ctnstream
-+#define ISTREAM INPUT->tnstream->istream
-+#define STRSTREAM INPUT->tnstream
-+#define HASEXCEPTION() (PSRSTATE->error == ANTLR3_TRUE)
-+#define EXCEPTION PSRSTATE->exception
-+#define MATCHT(t, fs) RECOGNIZER->match(RECOGNIZER, t, fs)
-+#define MATCHANYT() RECOGNIZER->matchAny(RECOGNIZER)
-+#define FOLLOWSTACK PSRSTATE->following
-+#define FOLLOWPUSH(x) FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
-+#define FOLLOWPOP() FOLLOWSTACK->pop(FOLLOWSTACK)
-+#define PRECOVER() RECOGNIZER->recover(RECOGNIZER)
-+#define PREPORTERROR() RECOGNIZER->reportError(RECOGNIZER)
-+#define LA(n) ISTREAM->_LA(ISTREAM, n)
-+#define LT(n) INPUT->tnstream->_LT(INPUT->tnstream, n)
-+#define CONSTRUCTEX() RECOGNIZER->exConstruct(RECOGNIZER)
-+#define CONSUME() ISTREAM->consume(ISTREAM)
-+#define MARK() ISTREAM->mark(ISTREAM)
-+#define REWIND(m) ISTREAM->rewind(ISTREAM, m)
-+#define REWINDLAST() ISTREAM->rewindLast(ISTREAM)
-+#define PERRORRECOVERY PSRSTATE->errorRecovery
-+#define FAILEDFLAG PSRSTATE->failed
-+#define HASFAILED() (FAILEDFLAG == ANTLR3_TRUE)
-+#define BACKTRACKING PSRSTATE->backtracking
-+#define RECOVERFROMMISMATCHEDSET(s) RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
-+#define RECOVERFROMMISMATCHEDELEMENT(e) RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
-+#define ADAPTOR INPUT->adaptor
-+#define RULEMEMO PSRSTATE->ruleMemo
-+#define SEEK(n) ISTREAM->seek(ISTREAM, n)
-+#define INDEX() ISTREAM->index(ISTREAM)
-+#define DBG RECOGNIZER->debugger
-+
-+
-+#define TOKTEXT(tok, txt) tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define UP ANTLR3_TOKEN_UP
-+#define DOWN ANTLR3_TOKEN_DOWN
-+#define EOR ANTLR3_TOKEN_EOR
-+#define INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+
-+/** \brief Table of all token names in symbolic order, mainly used for
-+ * error reporting.
-+ */
-+pANTLR3_UINT8 SMARTPL2SQLTokenNames[28+4]
-+ = {
-+ (pANTLR3_UINT8) "<invalid>", /* String to print to indicate an invalid token */
-+ (pANTLR3_UINT8) "<EOR>",
-+ (pANTLR3_UINT8) "<DOWN>",
-+ (pANTLR3_UINT8) "<UP>",
-+ (pANTLR3_UINT8) "STR",
-+ (pANTLR3_UINT8) "OR",
-+ (pANTLR3_UINT8) "AND",
-+ (pANTLR3_UINT8) "NOT",
-+ (pANTLR3_UINT8) "LPAR",
-+ (pANTLR3_UINT8) "RPAR",
-+ (pANTLR3_UINT8) "STRTAG",
-+ (pANTLR3_UINT8) "INCLUDES",
-+ (pANTLR3_UINT8) "IS",
-+ (pANTLR3_UINT8) "INTTAG",
-+ (pANTLR3_UINT8) "INTBOOL",
-+ (pANTLR3_UINT8) "INT",
-+ (pANTLR3_UINT8) "DATETAG",
-+ (pANTLR3_UINT8) "AFTER",
-+ (pANTLR3_UINT8) "BEFORE",
-+ (pANTLR3_UINT8) "ENUMTAG",
-+ (pANTLR3_UINT8) "ENUMVAL",
-+ (pANTLR3_UINT8) "DATE",
-+ (pANTLR3_UINT8) "AGO",
-+ (pANTLR3_UINT8) "DATINTERVAL",
-+ (pANTLR3_UINT8) "GREATER",
-+ (pANTLR3_UINT8) "GREATEREQUAL",
-+ (pANTLR3_UINT8) "LESS",
-+ (pANTLR3_UINT8) "LESSEQUAL",
-+ (pANTLR3_UINT8) "EQUAL",
-+ (pANTLR3_UINT8) "WHITESPACE",
-+ (pANTLR3_UINT8) "'{'",
-+ (pANTLR3_UINT8) "'}'"
-+ };
-+
-+
-+
-+// Forward declare the locally static matching functions we have generated.
-+//
-+static SMARTPL2SQL_playlist_return playlist (pSMARTPL2SQL ctx);
-+static pANTLR3_STRING expression (pSMARTPL2SQL ctx);
-+static int dateval (pSMARTPL2SQL ctx);
-+static int interval (pSMARTPL2SQL ctx);
-+static void SMARTPL2SQLFree(pSMARTPL2SQL ctx);
-+/* For use in tree output where we are accumulating rule labels via label += ruleRef
-+ * we need a function that knows how to free a return scope when the list is destroyed.
-+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
-+ */
-+static void ANTLR3_CDECL freeScope(void * scope)
-+{
-+ ANTLR3_FREE(scope);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "SMARTPL2SQL.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+ return fileName;
-+}
-+/** \brief Create a new SMARTPL2SQL parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pSMARTPL2SQL
-+SMARTPL2SQLNew (pANTLR3_COMMON_TREE_NODE_STREAM instream)
-+{
-+ // See if we can create a new parser with the standard constructor
-+ //
-+ return SMARTPL2SQLNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new SMARTPL2SQL parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pSMARTPL2SQL
-+SMARTPL2SQLNewSSD (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+ pSMARTPL2SQL ctx; /* Context structure we will build and return */
-+
-+ ctx = (pSMARTPL2SQL) ANTLR3_CALLOC(1, sizeof(SMARTPL2SQL));
-+
-+ if (ctx == NULL)
-+ {
-+ // Failed to allocate memory for parser context
-+ //
-+ return NULL;
-+ }
-+
-+ /* -------------------------------------------------------------------
-+ * Memory for basic structure is allocated, now to fill in
-+ * the base ANTLR3 structures. We initialize the function pointers
-+ * for the standard ANTLR3 parser function set, but upon return
-+ * from here, the programmer may set the pointers to provide custom
-+ * implementations of each function.
-+ *
-+ * We don't use the macros defined in SMARTPL2SQL.h here, in order that you can get a sense
-+ * of what goes where.
-+ */
-+
-+ /* Create a base Tree parser/recognizer, using the supplied tree node stream
-+ */
-+ ctx->pTreeParser = antlr3TreeParserNewStream(ANTLR3_SIZE_HINT, instream, state);
-+ /* Install the implementation of our SMARTPL2SQL interface
-+ */
-+ ctx->playlist = playlist;
-+ ctx->expression = expression;
-+ ctx->dateval = dateval;
-+ ctx->interval = interval;
-+ ctx->free = SMARTPL2SQLFree;
-+ ctx->getGrammarFileName = getGrammarFileName;
-+
-+ /* Install the scope pushing methods.
-+ */
-+
-+
-+
-+
-+
-+ /* Install the token table
-+ */
-+ PSRSTATE->tokenNames = SMARTPL2SQLTokenNames;
-+
-+
-+ /* Return the newly built parser to the caller
-+ */
-+ return ctx;
-+}
-+
-+/** Free the parser resources
-+ */
-+ static void
-+ SMARTPL2SQLFree(pSMARTPL2SQL ctx)
-+ {
-+ /* Free any scope memory
-+ */
-+
-+
-+ // Free this parser
-+ //
-+ ctx->pTreeParser->free(ctx->pTreeParser);
-+ ANTLR3_FREE(ctx);
-+
-+ /* Everything is released, so we can return
-+ */
-+ return;
-+ }
-+
-+/** Return token names used by this tree parser
-+ *
-+ * The returned pointer is used as an index into the token names table (using the token
-+ * number as the index).
-+ *
-+ * \return Pointer to first char * in the table.
-+ */
-+static pANTLR3_UINT8 *getTokenNames()
-+{
-+ return SMARTPL2SQLTokenNames;
-+}
-+
-+
-+
-+
-+/* Declare the bitsets
-+ */
-+
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_playlist66 */
-+static ANTLR3_BITWORD FOLLOW_STR_in_playlist66_bits[] = { ANTLR3_UINT64_LIT(0x0000000040000000) };
-+static ANTLR3_BITSET_LIST FOLLOW_STR_in_playlist66 = { FOLLOW_STR_in_playlist66_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_30_in_playlist68 */
-+static ANTLR3_BITWORD FOLLOW_30_in_playlist68_bits[] = { ANTLR3_UINT64_LIT(0x00000000000924E0) };
-+static ANTLR3_BITSET_LIST FOLLOW_30_in_playlist68 = { FOLLOW_30_in_playlist68_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_playlist74 */
-+static ANTLR3_BITWORD FOLLOW_expression_in_playlist74_bits[] = { ANTLR3_UINT64_LIT(0x0000000080000000) };
-+static ANTLR3_BITSET_LIST FOLLOW_expression_in_playlist74 = { FOLLOW_expression_in_playlist74_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_31_in_playlist76 */
-+static ANTLR3_BITWORD FOLLOW_31_in_playlist76_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_31_in_playlist76 = { FOLLOW_31_in_playlist76_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_expression101 */
-+static ANTLR3_BITWORD FOLLOW_NOT_in_expression101_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static ANTLR3_BITSET_LIST FOLLOW_NOT_in_expression101 = { FOLLOW_NOT_in_expression101_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression107 */
-+static ANTLR3_BITWORD FOLLOW_expression_in_expression107_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression107 = { FOLLOW_expression_in_expression107_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AND_in_expression118 */
-+static ANTLR3_BITWORD FOLLOW_AND_in_expression118_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static ANTLR3_BITSET_LIST FOLLOW_AND_in_expression118 = { FOLLOW_AND_in_expression118_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression124 */
-+static ANTLR3_BITWORD FOLLOW_expression_in_expression124_bits[] = { ANTLR3_UINT64_LIT(0x00000000000924E0) };
-+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression124 = { FOLLOW_expression_in_expression124_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression130 */
-+static ANTLR3_BITWORD FOLLOW_expression_in_expression130_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression130 = { FOLLOW_expression_in_expression130_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OR_in_expression141 */
-+static ANTLR3_BITWORD FOLLOW_OR_in_expression141_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000004) };
-+static ANTLR3_BITSET_LIST FOLLOW_OR_in_expression141 = { FOLLOW_OR_in_expression141_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression147 */
-+static ANTLR3_BITWORD FOLLOW_expression_in_expression147_bits[] = { ANTLR3_UINT64_LIT(0x00000000000924E0) };
-+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression147 = { FOLLOW_expression_in_expression147_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_expression153 */
-+static ANTLR3_BITWORD FOLLOW_expression_in_expression153_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000008) };
-+static ANTLR3_BITSET_LIST FOLLOW_expression_in_expression153 = { FOLLOW_expression_in_expression153_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRTAG_in_expression163 */
-+static ANTLR3_BITWORD FOLLOW_STRTAG_in_expression163_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000800) };
-+static ANTLR3_BITSET_LIST FOLLOW_STRTAG_in_expression163 = { FOLLOW_STRTAG_in_expression163_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCLUDES_in_expression165 */
-+static ANTLR3_BITWORD FOLLOW_INCLUDES_in_expression165_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010) };
-+static ANTLR3_BITSET_LIST FOLLOW_INCLUDES_in_expression165 = { FOLLOW_INCLUDES_in_expression165_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_expression167 */
-+static ANTLR3_BITWORD FOLLOW_STR_in_expression167_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_STR_in_expression167 = { FOLLOW_STR_in_expression167_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRTAG_in_expression176 */
-+static ANTLR3_BITWORD FOLLOW_STRTAG_in_expression176_bits[] = { ANTLR3_UINT64_LIT(0x0000000000001000) };
-+static ANTLR3_BITSET_LIST FOLLOW_STRTAG_in_expression176 = { FOLLOW_STRTAG_in_expression176_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_IS_in_expression178 */
-+static ANTLR3_BITWORD FOLLOW_IS_in_expression178_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010) };
-+static ANTLR3_BITSET_LIST FOLLOW_IS_in_expression178 = { FOLLOW_IS_in_expression178_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_expression180 */
-+static ANTLR3_BITWORD FOLLOW_STR_in_expression180_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_STR_in_expression180 = { FOLLOW_STR_in_expression180_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTTAG_in_expression189 */
-+static ANTLR3_BITWORD FOLLOW_INTTAG_in_expression189_bits[] = { ANTLR3_UINT64_LIT(0x0000000000004000) };
-+static ANTLR3_BITSET_LIST FOLLOW_INTTAG_in_expression189 = { FOLLOW_INTTAG_in_expression189_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTBOOL_in_expression191 */
-+static ANTLR3_BITWORD FOLLOW_INTBOOL_in_expression191_bits[] = { ANTLR3_UINT64_LIT(0x0000000000008000) };
-+static ANTLR3_BITSET_LIST FOLLOW_INTBOOL_in_expression191 = { FOLLOW_INTBOOL_in_expression191_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_expression193 */
-+static ANTLR3_BITWORD FOLLOW_INT_in_expression193_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_INT_in_expression193 = { FOLLOW_INT_in_expression193_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATETAG_in_expression202 */
-+static ANTLR3_BITWORD FOLLOW_DATETAG_in_expression202_bits[] = { ANTLR3_UINT64_LIT(0x0000000000020000) };
-+static ANTLR3_BITSET_LIST FOLLOW_DATETAG_in_expression202 = { FOLLOW_DATETAG_in_expression202_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_expression204 */
-+static ANTLR3_BITWORD FOLLOW_AFTER_in_expression204_bits[] = { ANTLR3_UINT64_LIT(0x0000000000208000) };
-+static ANTLR3_BITSET_LIST FOLLOW_AFTER_in_expression204 = { FOLLOW_AFTER_in_expression204_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateval_in_expression206 */
-+static ANTLR3_BITWORD FOLLOW_dateval_in_expression206_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_dateval_in_expression206 = { FOLLOW_dateval_in_expression206_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATETAG_in_expression215 */
-+static ANTLR3_BITWORD FOLLOW_DATETAG_in_expression215_bits[] = { ANTLR3_UINT64_LIT(0x0000000000040000) };
-+static ANTLR3_BITSET_LIST FOLLOW_DATETAG_in_expression215 = { FOLLOW_DATETAG_in_expression215_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_expression217 */
-+static ANTLR3_BITWORD FOLLOW_BEFORE_in_expression217_bits[] = { ANTLR3_UINT64_LIT(0x0000000000208000) };
-+static ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_expression217 = { FOLLOW_BEFORE_in_expression217_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateval_in_expression219 */
-+static ANTLR3_BITWORD FOLLOW_dateval_in_expression219_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_dateval_in_expression219 = { FOLLOW_dateval_in_expression219_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENUMTAG_in_expression228 */
-+static ANTLR3_BITWORD FOLLOW_ENUMTAG_in_expression228_bits[] = { ANTLR3_UINT64_LIT(0x0000000000001000) };
-+static ANTLR3_BITSET_LIST FOLLOW_ENUMTAG_in_expression228 = { FOLLOW_ENUMTAG_in_expression228_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_IS_in_expression230 */
-+static ANTLR3_BITWORD FOLLOW_IS_in_expression230_bits[] = { ANTLR3_UINT64_LIT(0x0000000000100000) };
-+static ANTLR3_BITSET_LIST FOLLOW_IS_in_expression230 = { FOLLOW_IS_in_expression230_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENUMVAL_in_expression232 */
-+static ANTLR3_BITWORD FOLLOW_ENUMVAL_in_expression232_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_ENUMVAL_in_expression232 = { FOLLOW_ENUMVAL_in_expression232_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval257 */
-+static ANTLR3_BITWORD FOLLOW_DATE_in_dateval257_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval257 = { FOLLOW_DATE_in_dateval257_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval266 */
-+static ANTLR3_BITWORD FOLLOW_interval_in_dateval266_bits[] = { ANTLR3_UINT64_LIT(0x0000000000040000) };
-+static ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval266 = { FOLLOW_interval_in_dateval266_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_dateval268 */
-+static ANTLR3_BITWORD FOLLOW_BEFORE_in_dateval268_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
-+static ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_dateval268 = { FOLLOW_BEFORE_in_dateval268_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval270 */
-+static ANTLR3_BITWORD FOLLOW_DATE_in_dateval270_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval270 = { FOLLOW_DATE_in_dateval270_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval279 */
-+static ANTLR3_BITWORD FOLLOW_interval_in_dateval279_bits[] = { ANTLR3_UINT64_LIT(0x0000000000020000) };
-+static ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval279 = { FOLLOW_interval_in_dateval279_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_dateval281 */
-+static ANTLR3_BITWORD FOLLOW_AFTER_in_dateval281_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
-+static ANTLR3_BITSET_LIST FOLLOW_AFTER_in_dateval281 = { FOLLOW_AFTER_in_dateval281_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval283 */
-+static ANTLR3_BITWORD FOLLOW_DATE_in_dateval283_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval283 = { FOLLOW_DATE_in_dateval283_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval292 */
-+static ANTLR3_BITWORD FOLLOW_interval_in_dateval292_bits[] = { ANTLR3_UINT64_LIT(0x0000000000400000) };
-+static ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval292 = { FOLLOW_interval_in_dateval292_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AGO_in_dateval294 */
-+static ANTLR3_BITWORD FOLLOW_AGO_in_dateval294_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_AGO_in_dateval294 = { FOLLOW_AGO_in_dateval294_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_interval318 */
-+static ANTLR3_BITWORD FOLLOW_INT_in_interval318_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000) };
-+static ANTLR3_BITSET_LIST FOLLOW_INT_in_interval318 = { FOLLOW_INT_in_interval318_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATINTERVAL_in_interval320 */
-+static ANTLR3_BITWORD FOLLOW_DATINTERVAL_in_interval320_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_DATINTERVAL_in_interval320 = { FOLLOW_DATINTERVAL_in_interval320_bits, 1 };
-+
-+
-+
-+
-+/* ==============================================
-+ * Parsing rules
-+ */
-+/**
-+ * $ANTLR start playlist
-+ * SMARTPL2SQL.g:43:1: playlist returns [ pANTLR3_STRING title, pANTLR3_STRING query ] : STR '{' e= expression '}' ;
-+ */
-+static SMARTPL2SQL_playlist_return
-+playlist(pSMARTPL2SQL ctx)
-+{
-+ SMARTPL2SQL_playlist_return retval;
-+
-+ pANTLR3_BASE_TREE STR1;
-+ pANTLR3_STRING e;
-+ #undef RETURN_TYPE_e
-+ #define RETURN_TYPE_e pANTLR3_STRING
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ retval.title= NULL; retval.query= NULL;
-+ STR1 = NULL;
-+ e = NULL;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ {
-+ // SMARTPL2SQL.g:45:2: ( STR '{' e= expression '}' )
-+ // SMARTPL2SQL.g:45:4: STR '{' e= expression '}'
-+ {
-+ STR1 = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_playlist66);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleplaylistEx;
-+ }
-+
-+ MATCHT(30, &FOLLOW_30_in_playlist68);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleplaylistEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expression_in_playlist74);
-+ e=expression(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleplaylistEx;
-+ }
-+
-+ MATCHT(31, &FOLLOW_31_in_playlist76);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleplaylistEx;
-+ }
-+
-+ {
-+
-+ pANTLR3_UINT8 val;
-+ val = (STR1->getText(STR1))->toUTF8((STR1->getText(STR1)))->chars;
-+ val++;
-+ val[strlen((const char *)val) - 1] = '\0';
-+
-+ retval.title= (STR1->getText(STR1))->factory->newRaw((STR1->getText(STR1))->factory);
-+ retval.title->append8(retval.title, (const char *)val);
-+
-+ retval.query= e->factory->newRaw(e->factory);
-+ retval.query->append8(retval.query, "(");
-+ retval.query->appendS(retval.query, e);
-+ retval.query->append8(retval.query, ")");
-+
-+ }
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleplaylistEx; /* Prevent compiler warnings */
-+ ruleplaylistEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end playlist */
-+
-+/**
-+ * $ANTLR start expression
-+ * SMARTPL2SQL.g:62:1: expression returns [ pANTLR3_STRING result ] : ( ^( NOT a= expression ) | ^( AND a= expression b= expression ) | ^( OR a= expression b= expression ) | STRTAG INCLUDES STR | STRTAG IS STR | INTTAG INTBOOL INT | DATETAG AFTER dateval | DATETAG BEFORE dateval | ENUMTAG IS ENUMVAL );
-+ */
-+static pANTLR3_STRING
-+expression(pSMARTPL2SQL ctx)
-+{
-+ pANTLR3_STRING result = NULL;
-+
-+ pANTLR3_BASE_TREE STR2;
-+ pANTLR3_BASE_TREE STRTAG3;
-+ pANTLR3_BASE_TREE STR4;
-+ pANTLR3_BASE_TREE STRTAG5;
-+ pANTLR3_BASE_TREE INTTAG6;
-+ pANTLR3_BASE_TREE INTBOOL7;
-+ pANTLR3_BASE_TREE INT8;
-+ pANTLR3_BASE_TREE DATETAG10;
-+ pANTLR3_BASE_TREE DATETAG12;
-+ pANTLR3_BASE_TREE ENUMTAG13;
-+ pANTLR3_BASE_TREE ENUMVAL14;
-+ pANTLR3_STRING a;
-+ #undef RETURN_TYPE_a
-+ #define RETURN_TYPE_a pANTLR3_STRING
-+
-+ pANTLR3_STRING b;
-+ #undef RETURN_TYPE_b
-+ #define RETURN_TYPE_b pANTLR3_STRING
-+
-+ int dateval9;
-+ #undef RETURN_TYPE_dateval9
-+ #define RETURN_TYPE_dateval9 int
-+
-+ int dateval11;
-+ #undef RETURN_TYPE_dateval11
-+ #define RETURN_TYPE_dateval11 int
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ result= NULL;
-+ STR2 = NULL;
-+ STRTAG3 = NULL;
-+ STR4 = NULL;
-+ STRTAG5 = NULL;
-+ INTTAG6 = NULL;
-+ INTBOOL7 = NULL;
-+ INT8 = NULL;
-+ DATETAG10 = NULL;
-+ DATETAG12 = NULL;
-+ ENUMTAG13 = NULL;
-+ ENUMVAL14 = NULL;
-+ a = NULL;
-+ b = NULL;
-+ dateval9 = 0;
-+ dateval11 = 0;
-+
-+ {
-+ {
-+ // SMARTPL2SQL.g:64:2: ( ^( NOT a= expression ) | ^( AND a= expression b= expression ) | ^( OR a= expression b= expression ) | STRTAG INCLUDES STR | STRTAG IS STR | INTTAG INTBOOL INT | DATETAG AFTER dateval | DATETAG BEFORE dateval | ENUMTAG IS ENUMVAL )
-+
-+ ANTLR3_UINT32 alt1;
-+
-+ alt1=9;
-+
-+ switch ( LA(1) )
-+ {
-+ case NOT:
-+ {
-+ alt1=1;
-+ }
-+ break;
-+ case AND:
-+ {
-+ alt1=2;
-+ }
-+ break;
-+ case OR:
-+ {
-+ alt1=3;
-+ }
-+ break;
-+ case STRTAG:
-+ {
-+ switch ( LA(2) )
-+ {
-+ case INCLUDES:
-+ {
-+ alt1=4;
-+ }
-+ break;
-+ case IS:
-+ {
-+ alt1=5;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 4;
-+
-+
-+ goto ruleexpressionEx;
-+ }
-+
-+ }
-+ break;
-+ case INTTAG:
-+ {
-+ alt1=6;
-+ }
-+ break;
-+ case DATETAG:
-+ {
-+ switch ( LA(2) )
-+ {
-+ case AFTER:
-+ {
-+ alt1=7;
-+ }
-+ break;
-+ case BEFORE:
-+ {
-+ alt1=8;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 6;
-+
-+
-+ goto ruleexpressionEx;
-+ }
-+
-+ }
-+ break;
-+ case ENUMTAG:
-+ {
-+ alt1=9;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleexpressionEx;
-+ }
-+
-+ switch (alt1)
-+ {
-+ case 1:
-+ // SMARTPL2SQL.g:64:4: ^( NOT a= expression )
-+ {
-+ MATCHT(NOT, &FOLLOW_NOT_in_expression101);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_DOWN, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expression_in_expression107);
-+ a=expression(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_UP, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ {
-+
-+ result= a->factory->newRaw(a->factory);
-+ result->append8(result, "NOT(");
-+ result->appendS(result, a);
-+ result->append8(result, ")");
-+
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL2SQL.g:71:4: ^( AND a= expression b= expression )
-+ {
-+ MATCHT(AND, &FOLLOW_AND_in_expression118);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_DOWN, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expression_in_expression124);
-+ a=expression(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expression_in_expression130);
-+ b=expression(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_UP, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ {
-+
-+ result= a->factory->newRaw(a->factory);
-+ result->append8(result, "(");
-+ result->appendS(result, a);
-+ result->append8(result, " AND ");
-+ result->appendS(result, b);
-+ result->append8(result, ")");
-+
-+ }
-+
-+ }
-+ break;
-+ case 3:
-+ // SMARTPL2SQL.g:80:4: ^( OR a= expression b= expression )
-+ {
-+ MATCHT(OR, &FOLLOW_OR_in_expression141);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_DOWN, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expression_in_expression147);
-+ a=expression(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_expression_in_expression153);
-+ b=expression(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+
-+ MATCHT(ANTLR3_TOKEN_UP, NULL);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ {
-+
-+ result= a->factory->newRaw(a->factory);
-+ result->append8(result, "(");
-+ result->appendS(result, a);
-+ result->append8(result, " OR ");
-+ result->appendS(result, b);
-+ result->append8(result, ")");
-+
-+ }
-+
-+ }
-+ break;
-+ case 4:
-+ // SMARTPL2SQL.g:89:4: STRTAG INCLUDES STR
-+ {
-+ STRTAG3 = (pANTLR3_BASE_TREE) MATCHT(STRTAG, &FOLLOW_STRTAG_in_expression163);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ MATCHT(INCLUDES, &FOLLOW_INCLUDES_in_expression165);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ STR2 = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_expression167);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ {
-+
-+ pANTLR3_UINT8 val;
-+ val = (STR2->getText(STR2))->toUTF8((STR2->getText(STR2)))->chars;
-+ val++;
-+ val[strlen((const char *)val) - 1] = '\0';
-+
-+ result= (STR2->getText(STR2))->factory->newRaw((STR2->getText(STR2))->factory);
-+ result->append8(result, "f.");
-+ result->appendS(result, (STRTAG3->getText(STRTAG3))->toUTF8((STRTAG3->getText(STRTAG3))));
-+ result->append8(result, " LIKE '%");
-+ result->append8(result, sqlite3_mprintf("%q", (const char *)val));
-+ result->append8(result, "%'");
-+
-+ }
-+
-+ }
-+ break;
-+ case 5:
-+ // SMARTPL2SQL.g:103:4: STRTAG IS STR
-+ {
-+ STRTAG5 = (pANTLR3_BASE_TREE) MATCHT(STRTAG, &FOLLOW_STRTAG_in_expression176);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ MATCHT(IS, &FOLLOW_IS_in_expression178);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ STR4 = (pANTLR3_BASE_TREE) MATCHT(STR, &FOLLOW_STR_in_expression180);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ {
-+
-+ pANTLR3_UINT8 val;
-+ val = (STR4->getText(STR4))->toUTF8((STR4->getText(STR4)))->chars;
-+ val++;
-+ val[strlen((const char *)val) - 1] = '\0';
-+
-+ result= (STR4->getText(STR4))->factory->newRaw((STR4->getText(STR4))->factory);
-+ result->append8(result, "f.");
-+ result->appendS(result, (STRTAG5->getText(STRTAG5))->toUTF8((STRTAG5->getText(STRTAG5))));
-+ result->append8(result, " LIKE '");
-+ result->append8(result, sqlite3_mprintf("%q", (const char *)val));
-+ result->append8(result, "'");
-+
-+ }
-+
-+ }
-+ break;
-+ case 6:
-+ // SMARTPL2SQL.g:117:4: INTTAG INTBOOL INT
-+ {
-+ INTTAG6 = (pANTLR3_BASE_TREE) MATCHT(INTTAG, &FOLLOW_INTTAG_in_expression189);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ INTBOOL7 = (pANTLR3_BASE_TREE) MATCHT(INTBOOL, &FOLLOW_INTBOOL_in_expression191);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ INT8 = (pANTLR3_BASE_TREE) MATCHT(INT, &FOLLOW_INT_in_expression193);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ {
-+
-+ result= (INTTAG6->getText(INTTAG6))->factory->newRaw((INTTAG6->getText(INTTAG6))->factory);
-+ result->append8(result, "f.");
-+ result->appendS(result, (INTTAG6->getText(INTTAG6))->toUTF8((INTTAG6->getText(INTTAG6))));
-+ result->append8(result, " ");
-+ result->appendS(result, (INTBOOL7->getText(INTBOOL7))->toUTF8((INTBOOL7->getText(INTBOOL7))));
-+ result->append8(result, " ");
-+ result->appendS(result, (INT8->getText(INT8))->toUTF8((INT8->getText(INT8))));
-+
-+ }
-+
-+ }
-+ break;
-+ case 7:
-+ // SMARTPL2SQL.g:127:4: DATETAG AFTER dateval
-+ {
-+ DATETAG10 = (pANTLR3_BASE_TREE) MATCHT(DATETAG, &FOLLOW_DATETAG_in_expression202);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ MATCHT(AFTER, &FOLLOW_AFTER_in_expression204);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_dateval_in_expression206);
-+ dateval9=dateval(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ {
-+
-+ char str[15];
-+ sprintf(str, "%d", dateval9);
-+
-+ result= (DATETAG10->getText(DATETAG10))->factory->newRaw((DATETAG10->getText(DATETAG10))->factory);
-+ result->append8(result, "f.");
-+ result->appendS(result, (DATETAG10->getText(DATETAG10))->toUTF8((DATETAG10->getText(DATETAG10))));
-+ result->append8(result, " > ");
-+ result->append8(result, str);
-+
-+ }
-+
-+ }
-+ break;
-+ case 8:
-+ // SMARTPL2SQL.g:138:4: DATETAG BEFORE dateval
-+ {
-+ DATETAG12 = (pANTLR3_BASE_TREE) MATCHT(DATETAG, &FOLLOW_DATETAG_in_expression215);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ MATCHT(BEFORE, &FOLLOW_BEFORE_in_expression217);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_dateval_in_expression219);
-+ dateval11=dateval(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ {
-+
-+ char str[15];
-+ sprintf(str, "%d", dateval11);
-+
-+ result= (DATETAG12->getText(DATETAG12))->factory->newRaw((DATETAG12->getText(DATETAG12))->factory);
-+ result->append8(result, "f.");
-+ result->appendS(result, (DATETAG12->getText(DATETAG12))->toUTF8((DATETAG12->getText(DATETAG12))));
-+ result->append8(result, " > ");
-+ result->append8(result, str);
-+
-+ }
-+
-+ }
-+ break;
-+ case 9:
-+ // SMARTPL2SQL.g:149:4: ENUMTAG IS ENUMVAL
-+ {
-+ ENUMTAG13 = (pANTLR3_BASE_TREE) MATCHT(ENUMTAG, &FOLLOW_ENUMTAG_in_expression228);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ MATCHT(IS, &FOLLOW_IS_in_expression230);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ ENUMVAL14 = (pANTLR3_BASE_TREE) MATCHT(ENUMVAL, &FOLLOW_ENUMVAL_in_expression232);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ {
-+
-+ pANTLR3_UINT8 tag;
-+ pANTLR3_UINT8 val;
-+ char str[20];
-+
-+ sprintf(str, "1=1");
-+
-+ tag = (ENUMTAG13->getText(ENUMTAG13))->chars;
-+ val = (ENUMVAL14->getText(ENUMVAL14))->chars;
-+ if (strcmp((char *)tag, "media_kind") == 0)
-+ {
-+ if (strcmp((char *)val, "music") == 0)
-+ {
-+ sprintf(str, "f.media_kind = %d", MEDIA_KIND_MUSIC);
-+ }
-+ else if (strcmp((char *)val, "movie") == 0)
-+ {
-+ sprintf(str, "f.media_kind = %d", MEDIA_KIND_MOVIE);
-+ }
-+ else if (strcmp((char *)val, "podcast") == 0)
-+ {
-+ sprintf(str, "f.media_kind = %d", MEDIA_KIND_PODCAST);
-+ }
-+ else if (strcmp((char *)val, "audiobook") == 0)
-+ {
-+ sprintf(str, "f.media_kind = %d", MEDIA_KIND_AUDIOBOOK);
-+ }
-+ else if (strcmp((char *)val, "tvshow") == 0)
-+ {
-+ sprintf(str, "f.media_kind = %d", MEDIA_KIND_TVSHOW);
-+ }
-+ }
-+ else if (strcmp((char *)tag, "data_kind") == 0)
-+ {
-+ if (strcmp((char *)val, "file") == 0)
-+ {
-+ sprintf(str, "f.data_kind = %d", DATA_KIND_FILE);
-+ }
-+ else if (strcmp((char *)val, "url") == 0)
-+ {
-+ sprintf(str, "f.data_kind = %d", DATA_KIND_HTTP);
-+ }
-+ else if (strcmp((char *)val, "spotify") == 0)
-+ {
-+ sprintf(str, "f.data_kind = %d", DATA_KIND_SPOTIFY);
-+ }
-+ else if (strcmp((char *)val, "pipe") == 0)
-+ {
-+ sprintf(str, "f.data_kind = %d", DATA_KIND_PIPE);
-+ }
-+ }
-+
-+ result= (ENUMTAG13->getText(ENUMTAG13))->factory->newRaw((ENUMTAG13->getText(ENUMTAG13))->factory);
-+ result->append8(result, str);
-+
-+ }
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleexpressionEx; /* Prevent compiler warnings */
-+ ruleexpressionEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return result;
-+}
-+/* $ANTLR end expression */
-+
-+/**
-+ * $ANTLR start dateval
-+ * SMARTPL2SQL.g:207:1: dateval returns [ int result ] : ( DATE | interval BEFORE DATE | interval AFTER DATE | interval AGO );
-+ */
-+static int
-+dateval(pSMARTPL2SQL ctx)
-+{
-+ int result = 0;
-+
-+ pANTLR3_BASE_TREE DATE15;
-+ pANTLR3_BASE_TREE DATE16;
-+ pANTLR3_BASE_TREE DATE18;
-+ int interval17;
-+ #undef RETURN_TYPE_interval17
-+ #define RETURN_TYPE_interval17 int
-+
-+ int interval19;
-+ #undef RETURN_TYPE_interval19
-+ #define RETURN_TYPE_interval19 int
-+
-+ int interval20;
-+ #undef RETURN_TYPE_interval20
-+ #define RETURN_TYPE_interval20 int
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ result= 0;
-+ DATE15 = NULL;
-+ DATE16 = NULL;
-+ DATE18 = NULL;
-+ interval17 = 0;
-+ interval19 = 0;
-+ interval20 = 0;
-+
-+ {
-+ {
-+ // SMARTPL2SQL.g:209:2: ( DATE | interval BEFORE DATE | interval AFTER DATE | interval AGO )
-+
-+ ANTLR3_UINT32 alt2;
-+
-+ alt2=4;
-+
-+ switch ( LA(1) )
-+ {
-+ case DATE:
-+ {
-+ alt2=1;
-+ }
-+ break;
-+ case INT:
-+ {
-+ switch ( LA(2) )
-+ {
-+ case DATINTERVAL:
-+ {
-+ switch ( LA(3) )
-+ {
-+ case AGO:
-+ {
-+ alt2=4;
-+ }
-+ break;
-+ case BEFORE:
-+ {
-+ alt2=2;
-+ }
-+ break;
-+ case AFTER:
-+ {
-+ alt2=3;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 2;
-+ EXCEPTION->state = 3;
-+
-+
-+ goto ruledatevalEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 2;
-+ EXCEPTION->state = 2;
-+
-+
-+ goto ruledatevalEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 2;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruledatevalEx;
-+ }
-+
-+ switch (alt2)
-+ {
-+ case 1:
-+ // SMARTPL2SQL.g:209:4: DATE
-+ {
-+ DATE15 = (pANTLR3_BASE_TREE) MATCHT(DATE, &FOLLOW_DATE_in_dateval257);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ {
-+
-+ pANTLR3_UINT8 datval;
-+
-+ datval = (DATE15->getText(DATE15))->chars;
-+
-+ if (strcmp((char *)datval, "today") == 0)
-+ {
-+ result= time(NULL);
-+ }
-+ else if (strcmp((char *)datval, "yesterday") == 0)
-+ {
-+ result= time(NULL) - 24 * 3600;
-+ }
-+ else if (strcmp((char *)datval, "last week") == 0)
-+ {
-+ result= time(NULL) - 24 * 3600 * 7;
-+ }
-+ else if (strcmp((char *)datval, "last month") == 0)
-+ {
-+ result= time(NULL) - 24 * 3600 * 30;
-+ }
-+ else if (strcmp((char *)datval, "last year") == 0)
-+ {
-+ result= time(NULL) - 24 * 3600 * 365;
-+ }
-+ else
-+ {
-+ struct tm tm;
-+ char year[5];
-+ char month[3];
-+ char day[3];
-+
-+ memset((void*)&tm,0,sizeof(tm));
-+ memset(year, 0, sizeof(year));
-+ memset(month, 0, sizeof(month));
-+ memset(day, 0, sizeof(day));
-+
-+ strncpy(year, (const char *)datval, 4);
-+ strncpy(month, (const char *)datval + 5, 2);
-+ strncpy(day, (const char *)datval + 8, 2);
-+
-+ tm.tm_year = atoi(year) - 1900;
-+ tm.tm_mon = atoi(month) - 1;
-+ tm.tm_mday = atoi(day);
-+
-+ result= mktime(&tm);
-+ }
-+
-+ }
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL2SQL.g:258:4: interval BEFORE DATE
-+ {
-+ FOLLOWPUSH(FOLLOW_interval_in_dateval266);
-+ interval17=interval(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ MATCHT(BEFORE, &FOLLOW_BEFORE_in_dateval268);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ DATE16 = (pANTLR3_BASE_TREE) MATCHT(DATE, &FOLLOW_DATE_in_dateval270);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ {
-+
-+ pANTLR3_UINT8 datval;
-+
-+ datval = (DATE16->getText(DATE16))->chars;
-+
-+ if (strcmp((char *)datval, "yesterday") == 0)
-+ {
-+ result= time(NULL) - 24 * 3600;
-+ }
-+ else if (strcmp((char *)datval, "last week") == 0)
-+ {
-+ result= time(NULL) - 24 * 3600 * 7;
-+ }
-+ else if (strcmp((char *)datval, "last month") == 0)
-+ {
-+ result= time(NULL) - 24 * 3600 * 30;
-+ }
-+ else if (strcmp((char *)datval, "last year") == 0)
-+ {
-+ result= time(NULL) - 24 * 3600 * 365;
-+ }
-+ else
-+ {
-+ result= time(NULL);
-+ }
-+
-+ result= result - interval17;
-+
-+ }
-+
-+ }
-+ break;
-+ case 3:
-+ // SMARTPL2SQL.g:287:4: interval AFTER DATE
-+ {
-+ FOLLOWPUSH(FOLLOW_interval_in_dateval279);
-+ interval19=interval(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ MATCHT(AFTER, &FOLLOW_AFTER_in_dateval281);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ DATE18 = (pANTLR3_BASE_TREE) MATCHT(DATE, &FOLLOW_DATE_in_dateval283);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ {
-+
-+ pANTLR3_UINT8 datval;
-+
-+ datval = (DATE18->getText(DATE18))->chars;
-+
-+ if (strcmp((char *)datval, "yesterday") == 0)
-+ {
-+ result= time(NULL) - 24 * 3600;
-+ }
-+ else if (strcmp((char *)datval, "last week") == 0)
-+ {
-+ result= time(NULL) - 24 * 3600 * 7;
-+ }
-+ else if (strcmp((char *)datval, "last month") == 0)
-+ {
-+ result= time(NULL) - 24 * 3600 * 30;
-+ }
-+ else if (strcmp((char *)datval, "last year") == 0)
-+ {
-+ result= time(NULL) - 24 * 3600 * 365;
-+ }
-+ else
-+ {
-+ result= time(NULL);
-+ }
-+
-+ result= result + interval19;
-+
-+ }
-+
-+ }
-+ break;
-+ case 4:
-+ // SMARTPL2SQL.g:316:4: interval AGO
-+ {
-+ FOLLOWPUSH(FOLLOW_interval_in_dateval292);
-+ interval20=interval(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ MATCHT(AGO, &FOLLOW_AGO_in_dateval294);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ {
-+
-+ result= time(NULL) - interval20;
-+
-+ }
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruledatevalEx; /* Prevent compiler warnings */
-+ ruledatevalEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return result;
-+}
-+/* $ANTLR end dateval */
-+
-+/**
-+ * $ANTLR start interval
-+ * SMARTPL2SQL.g:322:1: interval returns [ int result ] : INT DATINTERVAL ;
-+ */
-+static int
-+interval(pSMARTPL2SQL ctx)
-+{
-+ int result = 0;
-+
-+ pANTLR3_BASE_TREE INT21;
-+ pANTLR3_BASE_TREE DATINTERVAL22;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ result= 0;
-+ INT21 = NULL;
-+ DATINTERVAL22 = NULL;
-+
-+ {
-+ // SMARTPL2SQL.g:324:2: ( INT DATINTERVAL )
-+ // SMARTPL2SQL.g:324:4: INT DATINTERVAL
-+ {
-+ INT21 = (pANTLR3_BASE_TREE) MATCHT(INT, &FOLLOW_INT_in_interval318);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintervalEx;
-+ }
-+
-+ DATINTERVAL22 = (pANTLR3_BASE_TREE) MATCHT(DATINTERVAL, &FOLLOW_DATINTERVAL_in_interval320);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintervalEx;
-+ }
-+
-+ {
-+
-+ pANTLR3_UINT8 interval;
-+
-+ result= atoi((const char *)(INT21->getText(INT21))->chars);
-+ interval = (DATINTERVAL22->getText(DATINTERVAL22))->chars;
-+
-+ if (strcmp((char *)interval, "days") == 0)
-+ {
-+ result= result * 24 * 3600;
-+ }
-+ else if (strcmp((char *)interval, "weeks") == 0)
-+ {
-+ result= result * 24 * 3600 * 7;
-+ }
-+ else if (strcmp((char *)interval, "months") == 0)
-+ {
-+ result= result * 24 * 3600 * 30;
-+ }
-+ else if (strcmp((char *)interval, "weeks") == 0)
-+ {
-+ result= result * 24 * 3600 * 365;
-+ }
-+ else
-+ {
-+ result= 0;
-+ }
-+
-+ }
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleintervalEx; /* Prevent compiler warnings */
-+ ruleintervalEx: ;
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ }
-+
-+
-+ return result;
-+}
-+/* $ANTLR end interval */
-+/* End of parsing rules
-+ * ==============================================
-+ */
-+
-+/* ==============================================
-+ * Syntactic predicates
-+ */
-+/* End of syntactic predicates
-+ * ==============================================
-+ */
-+
-+
-+
-+
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/SMARTPL2SQL.h b/src/pregen/SMARTPL2SQL.h
-new file mode 100644
-index 0000000..8e06de7
---- /dev/null
-+++ b/src/pregen/SMARTPL2SQL.h
-@@ -0,0 +1,220 @@
-+/** \file
-+ * This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : SMARTPL2SQL.g
-+ * - On : 2016-01-01 12:23:44
-+ * - for the tree parser : SMARTPL2SQLTreeParser *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The tree parser SMARTPL2SQL has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ *
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pSMARTPL2SQL, which is returned from a call to SMARTPL2SQLNew().
-+ *
-+ * The methods in pSMARTPL2SQL are as follows:
-+ *
-+ * - SMARTPL2SQL_playlist_return pSMARTPL2SQL->playlist(pSMARTPL2SQL)
-+ * - pANTLR3_STRING pSMARTPL2SQL->expression(pSMARTPL2SQL)
-+ * - int pSMARTPL2SQL->dateval(pSMARTPL2SQL)
-+ * - int pSMARTPL2SQL->interval(pSMARTPL2SQL)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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 _SMARTPL2SQL_H
-+#define _SMARTPL2SQL_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct SMARTPL2SQL_Ctx_struct SMARTPL2SQL, * pSMARTPL2SQL;
-+
-+
-+
-+ #include <stdio.h>
-+ #include <stdlib.h>
-+ #include <string.h>
-+ #include <limits.h>
-+ #include <errno.h>
-+ #include <time.h>
-+ #include <sqlite3.h>
-+
-+ #include "logger.h"
-+ #include "db.h"
-+
-+
-+#ifdef ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter, - Rules with parameters that are not used
-+// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
-+// initialized but unused variable - tree rewrite variables declared but not needed
-+// Unreferenced local variable - lexer rule declares but does not always use _type
-+// potentially unitialized variable used - retval always returned from a rule
-+// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+typedef struct SMARTPL2SQL_playlist_return_struct
-+{
-+ pANTLR3_BASE_TREE start;
-+ pANTLR3_BASE_TREE stop;
-+ pANTLR3_STRING title;
-+ pANTLR3_STRING query;
-+}
-+ SMARTPL2SQL_playlist_return;
-+
-+
-+
-+/** Context tracking structure for SMARTPL2SQL
-+ */
-+struct SMARTPL2SQL_Ctx_struct
-+{
-+ /** Built in ANTLR3 context tracker contains all the generic elements
-+ * required for context tracking.
-+ */
-+ pANTLR3_TREE_PARSER pTreeParser;
-+
-+
-+ SMARTPL2SQL_playlist_return (*playlist) (struct SMARTPL2SQL_Ctx_struct * ctx);
-+ pANTLR3_STRING (*expression) (struct SMARTPL2SQL_Ctx_struct * ctx);
-+ int (*dateval) (struct SMARTPL2SQL_Ctx_struct * ctx);
-+ int (*interval) (struct SMARTPL2SQL_Ctx_struct * ctx);
-+ // Delegated rules
-+ const char * (*getGrammarFileName)();
-+ void (*free) (struct SMARTPL2SQL_Ctx_struct * ctx);
-+
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pSMARTPL2SQL SMARTPL2SQLNew (pANTLR3_COMMON_TREE_NODE_STREAM instream);
-+ANTLR3_API pSMARTPL2SQL SMARTPL2SQLNewSSD (pANTLR3_COMMON_TREE_NODE_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the tree parser will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef EOF
-+#undef EOF
-+#endif
-+#ifdef Tokens
-+#undef Tokens
-+#endif
-+#define INTBOOL 14
-+#define STRTAG 10
-+#define AGO 22
-+#define WHITESPACE 29
-+#define GREATEREQUAL 25
-+#define BEFORE 18
-+#define DATETAG 16
-+#define INT 15
-+#define NOT 7
-+#define AFTER 17
-+#define AND 6
-+#define EOF -1
-+#define INCLUDES 11
-+#define STR 4
-+#define T__30 30
-+#define T__31 31
-+#define GREATER 24
-+#define LPAR 8
-+#define ENUMTAG 19
-+#define IS 12
-+#define ENUMVAL 20
-+#define EQUAL 28
-+#define OR 5
-+#define LESS 26
-+#define RPAR 9
-+#define DATE 21
-+#define LESSEQUAL 27
-+#define INTTAG 13
-+#define DATINTERVAL 23
-+#ifdef EOF
-+#undef EOF
-+#define EOF ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for SMARTPL2SQL
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/SMARTPL2SQL.u b/src/pregen/SMARTPL2SQL.u
-new file mode 100644
-index 0000000..85567d1
---- /dev/null
-+++ b/src/pregen/SMARTPL2SQL.u
-@@ -0,0 +1,5 @@
-+SMARTPL2SQL.g: SMARTPL.tokens
-+SMARTPL2SQL.c : SMARTPL2SQL.g
-+./SMARTPL2SQL.tokens : SMARTPL2SQL.g
-+SMARTPL2SQL.h : SMARTPL2SQL.g
-+ANTLR_PRODUCTS += SMARTPL2SQL.c ./SMARTPL2SQL.tokens SMARTPL2SQL.h
-\ No newline at end of file
-diff --git a/src/pregen/SMARTPLLexer.c b/src/pregen/SMARTPLLexer.c
-new file mode 100644
-index 0000000..91d6e99
---- /dev/null
-+++ b/src/pregen/SMARTPLLexer.c
-@@ -0,0 +1,4168 @@
-+/** \file
-+ * This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : SMARTPL.g
-+ * - On : 2016-01-01 12:23:40
-+ * - for the lexer : SMARTPLLexerLexer *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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.
-+
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include "SMARTPLLexer.h"
-+/* ----------------------------------------- */
-+
-+
-+/** String literals used by SMARTPLLexer that we must do things like MATCHS() with.
-+ * C will normally just lay down 8 bit characters, and you can use L"xxx" to
-+ * get wchar_t, but wchar_t is 16 bits on Windows, which is not UTF32 and so
-+ * we perform this little trick of defining the literals as arrays of UINT32
-+ * and passing in the address of these.
-+ */
-+static ANTLR3_UCHAR lit_1[] = { 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_2[] = { 0x61, 0x6C, 0x62, 0x75, 0x6D, 0x5F, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_3[] = { 0x61, 0x6C, 0x62, 0x75, 0x6D, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_4[] = { 0x74, 0x69, 0x74, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_5[] = { 0x67, 0x65, 0x6E, 0x72, 0x65, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_6[] = { 0x63, 0x6F, 0x6D, 0x70, 0x6F, 0x73, 0x65, 0x72, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_7[] = { 0x70, 0x61, 0x74, 0x68, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_8[] = { 0x74, 0x79, 0x70, 0x65, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_9[] = { 0x67, 0x72, 0x6F, 0x75, 0x70, 0x69, 0x6E, 0x67, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_10[] = { 0x70, 0x6C, 0x61, 0x79, 0x5F, 0x63, 0x6F, 0x75, 0x6E, 0x74, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_11[] = { 0x72, 0x61, 0x74, 0x69, 0x6E, 0x67, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_12[] = { 0x79, 0x65, 0x61, 0x72, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_13[] = { 0x63, 0x6F, 0x6D, 0x70, 0x69, 0x6C, 0x61, 0x74, 0x69, 0x6F, 0x6E, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_14[] = { 0x74, 0x69, 0x6D, 0x65, 0x5F, 0x61, 0x64, 0x64, 0x65, 0x64, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_15[] = { 0x74, 0x69, 0x6D, 0x65, 0x5F, 0x70, 0x6C, 0x61, 0x79, 0x65, 0x64, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_16[] = { 0x64, 0x61, 0x74, 0x61, 0x5F, 0x6B, 0x69, 0x6E, 0x64, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_17[] = { 0x6D, 0x65, 0x64, 0x69, 0x61, 0x5F, 0x6B, 0x69, 0x6E, 0x64, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_18[] = { 0x69, 0x6E, 0x63, 0x6C, 0x75, 0x64, 0x65, 0x73, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_19[] = { 0x69, 0x73, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_20[] = { 0x3E, 0x3D, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_21[] = { 0x3C, 0x3D, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_22[] = { 0x61, 0x66, 0x74, 0x65, 0x72, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_23[] = { 0x62, 0x65, 0x66, 0x6F, 0x72, 0x65, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_24[] = { 0x61, 0x67, 0x6F, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_25[] = { 0x41, 0x4E, 0x44, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_26[] = { 0x61, 0x6E, 0x64, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_27[] = { 0x4F, 0x52, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_28[] = { 0x6F, 0x72, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_29[] = { 0x4E, 0x4F, 0x54, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_30[] = { 0x6E, 0x6F, 0x74, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_31[] = { 0x74, 0x6F, 0x64, 0x61, 0x79, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_32[] = { 0x79, 0x65, 0x73, 0x74, 0x65, 0x72, 0x64, 0x61, 0x79, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_33[] = { 0x6C, 0x61, 0x73, 0x74, 0x20, 0x77, 0x65, 0x65, 0x6B, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_34[] = { 0x6C, 0x61, 0x73, 0x74, 0x20, 0x6D, 0x6F, 0x6E, 0x74, 0x68, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_35[] = { 0x6C, 0x61, 0x73, 0x74, 0x20, 0x79, 0x65, 0x61, 0x72, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_36[] = { 0x64, 0x61, 0x79, 0x73, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_37[] = { 0x77, 0x65, 0x65, 0x6B, 0x73, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_38[] = { 0x6D, 0x6F, 0x6E, 0x74, 0x68, 0x73, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_39[] = { 0x79, 0x65, 0x61, 0x72, 0x73, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_40[] = { 0x6D, 0x75, 0x73, 0x69, 0x63, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_41[] = { 0x6D, 0x6F, 0x76, 0x69, 0x65, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_42[] = { 0x70, 0x6F, 0x64, 0x63, 0x61, 0x73, 0x74, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_43[] = { 0x61, 0x75, 0x64, 0x69, 0x6F, 0x62, 0x6F, 0x6F, 0x6B, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_44[] = { 0x74, 0x76, 0x73, 0x68, 0x6F, 0x77, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_45[] = { 0x66, 0x69, 0x6C, 0x65, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_46[] = { 0x75, 0x72, 0x6C, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_47[] = { 0x73, 0x70, 0x6F, 0x74, 0x69, 0x66, 0x79, ANTLR3_STRING_TERMINATOR};
-+static ANTLR3_UCHAR lit_48[] = { 0x70, 0x69, 0x70, 0x65, ANTLR3_STRING_TERMINATOR};
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+
-+#define CTX ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef SCOPE_TYPE
-+#undef SCOPE_STACK
-+#undef SCOPE_TOP
-+#define SCOPE_TYPE(scope) pSMARTPLLexer_##scope##_SCOPE
-+#define SCOPE_STACK(scope) pSMARTPLLexer_##scope##Stack
-+#define SCOPE_TOP(scope) ctx->pSMARTPLLexer_##scope##Top
-+#define SCOPE_SIZE(scope) ctx->pSMARTPLLexer_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i) (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+
-+/* Macros for accessing things in a lexer
-+ */
-+#undef LEXER
-+#undef RECOGNIZER
-+#undef RULEMEMO
-+#undef GETCHARINDEX
-+#undef GETLINE
-+#undef GETCHARPOSITIONINLINE
-+#undef EMIT
-+#undef EMITNEW
-+#undef MATCHC
-+#undef MATCHS
-+#undef MATCHRANGE
-+#undef LTOKEN
-+#undef HASFAILED
-+#undef FAILEDFLAG
-+#undef INPUT
-+#undef STRSTREAM
-+#undef LA
-+#undef HASEXCEPTION
-+#undef EXCEPTION
-+#undef CONSTRUCTEX
-+#undef CONSUME
-+#undef LRECOVER
-+#undef MARK
-+#undef REWIND
-+#undef REWINDLAST
-+#undef BACKTRACKING
-+#undef MATCHANY
-+#undef MEMOIZE
-+#undef HAVEPARSEDRULE
-+#undef GETTEXT
-+#undef INDEX
-+#undef SEEK
-+#undef PUSHSTREAM
-+#undef POPSTREAM
-+#undef SETTEXT
-+#undef SETTEXT8
-+
-+#define LEXER ctx->pLexer
-+#define RECOGNIZER LEXER->rec
-+#define LEXSTATE RECOGNIZER->state
-+#define TOKSOURCE LEXSTATE->tokSource
-+#define GETCHARINDEX() LEXER->getCharIndex(LEXER)
-+#define GETLINE() LEXER->getLine(LEXER)
-+#define GETTEXT() LEXER->getText(LEXER)
-+#define GETCHARPOSITIONINLINE() LEXER->getCharPositionInLine(LEXER)
-+#define EMIT() LEXSTATE->type = _type; LEXER->emit(LEXER)
-+#define EMITNEW(t) LEXER->emitNew(LEXER, t)
-+#define MATCHC(c) LEXER->matchc(LEXER, c)
-+#define MATCHS(s) LEXER->matchs(LEXER, s)
-+#define MATCHRANGE(c1,c2) LEXER->matchRange(LEXER, c1, c2)
-+#define MATCHANY() LEXER->matchAny(LEXER)
-+#define LTOKEN LEXSTATE->token
-+#define HASFAILED() (LEXSTATE->failed == ANTLR3_TRUE)
-+#define BACKTRACKING LEXSTATE->backtracking
-+#define FAILEDFLAG LEXSTATE->failed
-+#define INPUT LEXER->input
-+#define STRSTREAM INPUT
-+#define ISTREAM INPUT->istream
-+#define INDEX() ISTREAM->index(ISTREAM)
-+#define SEEK(n) ISTREAM->seek(ISTREAM, n)
-+#define EOF_TOKEN &(LEXSTATE->tokSource->eofToken)
-+#define HASEXCEPTION() (LEXSTATE->error == ANTLR3_TRUE)
-+#define EXCEPTION LEXSTATE->exception
-+#define CONSTRUCTEX() RECOGNIZER->exConstruct(RECOGNIZER)
-+#define LRECOVER() LEXER->recover(LEXER)
-+#define MARK() ISTREAM->mark(ISTREAM)
-+#define REWIND(m) ISTREAM->rewind(ISTREAM, m)
-+#define REWINDLAST() ISTREAM->rewindLast(ISTREAM)
-+#define MEMOIZE(ri,si) RECOGNIZER->memoize(RECOGNIZER, ri, si)
-+#define HAVEPARSEDRULE(r) RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define PUSHSTREAM(str) LEXER->pushCharStream(LEXER, str)
-+#define POPSTREAM() LEXER->popCharStream(LEXER)
-+#define SETTEXT(str) LEXSTATE->text = str
-+#define SKIP() LEXSTATE->token = &(TOKSOURCE->skipToken)
-+#define USER1 LEXSTATE->user1
-+#define USER2 LEXSTATE->user2
-+#define USER3 LEXSTATE->user3
-+#define CUSTOM LEXSTATE->custom
-+#define RULEMEMO LEXSTATE->ruleMemo
-+#define DBG RECOGNIZER->debugger
-+
-+/* If we have been told we can rely on the standard 8 bit or 16 bit input
-+ * stream, then we can define our macros to use the direct pointers
-+ * in the input object, which is much faster than indirect calls. This
-+ * is really only significant to lexers with a lot of fragment rules (which
-+ * do not place LA(1) in a temporary at the moment) and even then
-+ * only if there is a lot of input (order of say 1M or so).
-+ */
-+#if defined(ANTLR3_INLINE_INPUT_ASCII) || defined(ANTLR3_INLINE_INPUT_UTF16)
-+
-+# ifdef ANTLR3_INLINE_INPUT_ASCII
-+
-+/* 8 bit "ASCII" (actually any 8 bit character set) */
-+
-+# define NEXTCHAR ((pANTLR3_UINT8)(INPUT->nextChar))
-+# define DATAP ((pANTLR3_UINT8)(INPUT->data))
-+
-+# else
-+
-+# define NEXTCHAR ((pANTLR3_UINT16)(INPUT->nextChar))
-+# define DATAP ((pANTLR3_UINT16)(INPUT->data))
-+
-+# endif
-+
-+# define LA(n) ((NEXTCHAR + n) > (DATAP + INPUT->sizeBuf) ? ANTLR3_CHARSTREAM_EOF : (ANTLR3_UCHAR)(*(NEXTCHAR + n - 1)))
-+# define CONSUME() \
-+{ \
-+ if (NEXTCHAR < (DATAP + INPUT->sizeBuf)) \
-+ { \
-+ INPUT->charPositionInLine++; \
-+ if ((ANTLR3_UCHAR)(*NEXTCHAR) == INPUT->newlineChar) \
-+ { \
-+ INPUT->line++; \
-+ INPUT->charPositionInLine = 0; \
-+ INPUT->currentLine = (void *)(NEXTCHAR + 1); \
-+ } \
-+ INPUT->nextChar = (void *)(NEXTCHAR + 1); \
-+ } \
-+}
-+
-+#else
-+
-+// Pick up the input character by calling the input stream implementation.
-+//
-+#define CONSUME() INPUT->istream->consume(INPUT->istream)
-+#define LA(n) INPUT->istream->_LA(INPUT->istream, n)
-+
-+#endif
-+#define TOKTEXT(tok, txt) tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define UP ANTLR3_TOKEN_UP
-+#define DOWN ANTLR3_TOKEN_DOWN
-+#define EOR ANTLR3_TOKEN_EOR
-+#define INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+/* Forward declare the locally static matching functions we have generated and any predicate functions.
-+ */
-+static ANTLR3_INLINE void mT__30 (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mT__31 (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mSTRTAG (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mINTTAG (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mDATETAG (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mENUMTAG (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mINCLUDES (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mIS (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mINTBOOL (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mGREATER (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mGREATEREQUAL (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mLESS (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mLESSEQUAL (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mEQUAL (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mAFTER (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mBEFORE (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mAGO (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mAND (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mOR (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mNOT (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mLPAR (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mRPAR (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mDATE (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mDATINTERVAL (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mENUMVAL (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mSTR (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mINT (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mWHITESPACE (pSMARTPLLexer ctx);
-+static ANTLR3_INLINE void mTokens (pSMARTPLLexer ctx);
-+static void SMARTPLLexerFree(pSMARTPLLexer ctx);
-+
-+/* =========================================================================
-+ * Lexer matching rules end.
-+ * =========================================================================
-+ */
-+
-+
-+
-+static void
-+SMARTPLLexerFree (pSMARTPLLexer ctx)
-+{
-+ LEXER->free(LEXER);
-+
-+ ANTLR3_FREE(ctx);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "SMARTPL.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+ return fileName;
-+}
-+
-+/** \brief Create a new lexer called SMARTPLLexer
-+ *
-+ * \param[in] instream Pointer to an initialized input stream
-+ * \return
-+ * - Success pSMARTPLLexer initialized for the lex start
-+ * - Fail NULL
-+ */
-+ANTLR3_API pSMARTPLLexer SMARTPLLexerNew
-+(pANTLR3_INPUT_STREAM instream)
-+{
-+ // See if we can create a new lexer with the standard constructor
-+ //
-+ return SMARTPLLexerNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new lexer called SMARTPLLexer
-+ *
-+ * \param[in] instream Pointer to an initialized input stream
-+ * \param[state] state Previously created shared recognizer stat
-+ * \return
-+ * - Success pSMARTPLLexer initialized for the lex start
-+ * - Fail NULL
-+ */
-+ANTLR3_API pSMARTPLLexer SMARTPLLexerNewSSD
-+(pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+ pSMARTPLLexer ctx; // Context structure we will build and return
-+
-+ ctx = (pSMARTPLLexer) ANTLR3_CALLOC(1, sizeof(SMARTPLLexer));
-+
-+ if (ctx == NULL)
-+ {
-+ // Failed to allocate memory for lexer context
-+ return NULL;
-+ }
-+
-+ /* -------------------------------------------------------------------
-+ * Memory for basic structure is allocated, now to fill in
-+ * in base ANTLR3 structures. We initialize the function pointers
-+ * for the standard ANTLR3 lexer function set, but upon return
-+ * from here, the programmer may set the pointers to provide custom
-+ * implementations of each function.
-+ *
-+ * We don't use the macros defined in SMARTPLLexer.h here so you can get a sense
-+ * of what goes where.
-+ */
-+
-+ /* Create a base lexer, using the supplied input stream
-+ */
-+ ctx->pLexer = antlr3LexerNewStream(ANTLR3_SIZE_HINT, instream, state);
-+
-+ /* Check that we allocated the memory correctly
-+ */
-+ if (ctx->pLexer == NULL)
-+ {
-+ ANTLR3_FREE(ctx);
-+ return NULL;
-+ }
-+ /* Install the implementation of our SMARTPLLexer interface
-+ */
-+ ctx->mT__30 = mT__30;
-+ ctx->mT__31 = mT__31;
-+ ctx->mSTRTAG = mSTRTAG;
-+ ctx->mINTTAG = mINTTAG;
-+ ctx->mDATETAG = mDATETAG;
-+ ctx->mENUMTAG = mENUMTAG;
-+ ctx->mINCLUDES = mINCLUDES;
-+ ctx->mIS = mIS;
-+ ctx->mINTBOOL = mINTBOOL;
-+ ctx->mGREATER = mGREATER;
-+ ctx->mGREATEREQUAL = mGREATEREQUAL;
-+ ctx->mLESS = mLESS;
-+ ctx->mLESSEQUAL = mLESSEQUAL;
-+ ctx->mEQUAL = mEQUAL;
-+ ctx->mAFTER = mAFTER;
-+ ctx->mBEFORE = mBEFORE;
-+ ctx->mAGO = mAGO;
-+ ctx->mAND = mAND;
-+ ctx->mOR = mOR;
-+ ctx->mNOT = mNOT;
-+ ctx->mLPAR = mLPAR;
-+ ctx->mRPAR = mRPAR;
-+ ctx->mDATE = mDATE;
-+ ctx->mDATINTERVAL = mDATINTERVAL;
-+ ctx->mENUMVAL = mENUMVAL;
-+ ctx->mSTR = mSTR;
-+ ctx->mINT = mINT;
-+ ctx->mWHITESPACE = mWHITESPACE;
-+ ctx->mTokens = mTokens;
-+
-+ /** When the nextToken() call is made to this lexer's pANTLR3_TOKEN_SOURCE
-+ * it will call mTokens() in this generated code, and will pass it the ctx
-+ * pointer of this lexer, not the context of the base lexer, so store that now.
-+ */
-+ ctx->pLexer->ctx = ctx;
-+
-+ /**Install the token matching function
-+ */
-+ ctx->pLexer->mTokens = (void (*) (void *))(mTokens);
-+
-+ ctx->getGrammarFileName = getGrammarFileName;
-+ ctx->free = SMARTPLLexerFree;
-+
-+
-+
-+
-+
-+ /* Return the newly built lexer to the caller
-+ */
-+ return ctx;
-+}
-+
-+
-+/* =========================================================================
-+ * Functions to match the lexer grammar defined tokens from the input stream
-+ */
-+
-+// Comes from: 7:7: ( '{' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start T__30
-+ *
-+ * Looks to match the characters the constitute the token T__30
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mT__30(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = T__30;
-+
-+
-+ // SMARTPL.g:7:7: ( '{' )
-+ // SMARTPL.g:7:9: '{'
-+ {
-+ MATCHC('{');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleT__30Ex;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleT__30Ex; /* Prevent compiler warnings */
-+ ruleT__30Ex: ;
-+
-+}
-+// $ANTLR end T__30
-+
-+// Comes from: 8:7: ( '}' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start T__31
-+ *
-+ * Looks to match the characters the constitute the token T__31
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mT__31(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = T__31;
-+
-+
-+ // SMARTPL.g:8:7: ( '}' )
-+ // SMARTPL.g:8:9: '}'
-+ {
-+ MATCHC('}');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleT__31Ex;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleT__31Ex; /* Prevent compiler warnings */
-+ ruleT__31Ex: ;
-+
-+}
-+// $ANTLR end T__31
-+
-+// Comes from: 56:9: ( 'artist' | 'album_artist' | 'album' | 'title' | 'genre' | 'composer' | 'path' | 'type' | 'grouping' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start STRTAG
-+ *
-+ * Looks to match the characters the constitute the token STRTAG
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mSTRTAG(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = STRTAG;
-+
-+
-+ {
-+ // SMARTPL.g:56:9: ( 'artist' | 'album_artist' | 'album' | 'title' | 'genre' | 'composer' | 'path' | 'type' | 'grouping' )
-+
-+ ANTLR3_UINT32 alt1;
-+
-+ alt1=9;
-+
-+ switch ( LA(1) )
-+ {
-+ case 'a':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'r':
-+ {
-+ alt1=1;
-+ }
-+ break;
-+ case 'l':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'b':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 'u':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 'm':
-+ {
-+ switch ( LA(6) )
-+ {
-+ case '_':
-+ {
-+ alt1=2;
-+ }
-+ break;
-+
-+ default:
-+ alt1=3;}
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 13;
-+
-+
-+ goto ruleSTRTAGEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 12;
-+
-+
-+ goto ruleSTRTAGEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 7;
-+
-+
-+ goto ruleSTRTAGEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 1;
-+
-+
-+ goto ruleSTRTAGEx;
-+ }
-+
-+ }
-+ break;
-+ case 't':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'i':
-+ {
-+ alt1=4;
-+ }
-+ break;
-+ case 'y':
-+ {
-+ alt1=8;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 2;
-+
-+
-+ goto ruleSTRTAGEx;
-+ }
-+
-+ }
-+ break;
-+ case 'g':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'e':
-+ {
-+ alt1=5;
-+ }
-+ break;
-+ case 'r':
-+ {
-+ alt1=9;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 3;
-+
-+
-+ goto ruleSTRTAGEx;
-+ }
-+
-+ }
-+ break;
-+ case 'c':
-+ {
-+ alt1=6;
-+ }
-+ break;
-+ case 'p':
-+ {
-+ alt1=7;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 1;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleSTRTAGEx;
-+ }
-+
-+ switch (alt1)
-+ {
-+ case 1:
-+ // SMARTPL.g:56:11: 'artist'
-+ {
-+ MATCHS(lit_1);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTRTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:57:6: 'album_artist'
-+ {
-+ MATCHS(lit_2);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTRTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // SMARTPL.g:58:6: 'album'
-+ {
-+ MATCHS(lit_3);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTRTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // SMARTPL.g:59:6: 'title'
-+ {
-+ MATCHS(lit_4);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTRTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 5:
-+ // SMARTPL.g:60:6: 'genre'
-+ {
-+ MATCHS(lit_5);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTRTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 6:
-+ // SMARTPL.g:61:6: 'composer'
-+ {
-+ MATCHS(lit_6);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTRTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 7:
-+ // SMARTPL.g:62:6: 'path'
-+ {
-+ MATCHS(lit_7);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTRTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 8:
-+ // SMARTPL.g:63:6: 'type'
-+ {
-+ MATCHS(lit_8);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTRTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 9:
-+ // SMARTPL.g:64:6: 'grouping'
-+ {
-+ MATCHS(lit_9);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTRTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleSTRTAGEx; /* Prevent compiler warnings */
-+ ruleSTRTAGEx: ;
-+
-+}
-+// $ANTLR end STRTAG
-+
-+// Comes from: 67:9: ( 'play_count' | 'rating' | 'year' | 'compilation' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start INTTAG
-+ *
-+ * Looks to match the characters the constitute the token INTTAG
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mINTTAG(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = INTTAG;
-+
-+
-+ {
-+ // SMARTPL.g:67:9: ( 'play_count' | 'rating' | 'year' | 'compilation' )
-+
-+ ANTLR3_UINT32 alt2;
-+
-+ alt2=4;
-+
-+ switch ( LA(1) )
-+ {
-+ case 'p':
-+ {
-+ alt2=1;
-+ }
-+ break;
-+ case 'r':
-+ {
-+ alt2=2;
-+ }
-+ break;
-+ case 'y':
-+ {
-+ alt2=3;
-+ }
-+ break;
-+ case 'c':
-+ {
-+ alt2=4;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 2;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleINTTAGEx;
-+ }
-+
-+ switch (alt2)
-+ {
-+ case 1:
-+ // SMARTPL.g:67:11: 'play_count'
-+ {
-+ MATCHS(lit_10);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINTTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:68:6: 'rating'
-+ {
-+ MATCHS(lit_11);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINTTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // SMARTPL.g:69:6: 'year'
-+ {
-+ MATCHS(lit_12);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINTTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // SMARTPL.g:70:6: 'compilation'
-+ {
-+ MATCHS(lit_13);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINTTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleINTTAGEx; /* Prevent compiler warnings */
-+ ruleINTTAGEx: ;
-+
-+}
-+// $ANTLR end INTTAG
-+
-+// Comes from: 73:10: ( 'time_added' | 'time_played' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DATETAG
-+ *
-+ * Looks to match the characters the constitute the token DATETAG
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDATETAG(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = DATETAG;
-+
-+
-+ {
-+ // SMARTPL.g:73:10: ( 'time_added' | 'time_played' )
-+
-+ ANTLR3_UINT32 alt3;
-+
-+ alt3=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case 't':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'i':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'm':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 'e':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case '_':
-+ {
-+ switch ( LA(6) )
-+ {
-+ case 'a':
-+ {
-+ alt3=1;
-+ }
-+ break;
-+ case 'p':
-+ {
-+ alt3=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 5;
-+
-+
-+ goto ruleDATETAGEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 4;
-+
-+
-+ goto ruleDATETAGEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 3;
-+
-+
-+ goto ruleDATETAGEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 2;
-+
-+
-+ goto ruleDATETAGEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 1;
-+
-+
-+ goto ruleDATETAGEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleDATETAGEx;
-+ }
-+
-+ switch (alt3)
-+ {
-+ case 1:
-+ // SMARTPL.g:73:12: 'time_added'
-+ {
-+ MATCHS(lit_14);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATETAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:74:6: 'time_played'
-+ {
-+ MATCHS(lit_15);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATETAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleDATETAGEx; /* Prevent compiler warnings */
-+ ruleDATETAGEx: ;
-+
-+}
-+// $ANTLR end DATETAG
-+
-+// Comes from: 77:10: ( 'data_kind' | 'media_kind' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start ENUMTAG
-+ *
-+ * Looks to match the characters the constitute the token ENUMTAG
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mENUMTAG(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = ENUMTAG;
-+
-+
-+ {
-+ // SMARTPL.g:77:10: ( 'data_kind' | 'media_kind' )
-+
-+ ANTLR3_UINT32 alt4;
-+
-+ alt4=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case 'd':
-+ {
-+ alt4=1;
-+ }
-+ break;
-+ case 'm':
-+ {
-+ alt4=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleENUMTAGEx;
-+ }
-+
-+ switch (alt4)
-+ {
-+ case 1:
-+ // SMARTPL.g:77:12: 'data_kind'
-+ {
-+ MATCHS(lit_16);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleENUMTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:78:6: 'media_kind'
-+ {
-+ MATCHS(lit_17);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleENUMTAGEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleENUMTAGEx; /* Prevent compiler warnings */
-+ ruleENUMTAGEx: ;
-+
-+}
-+// $ANTLR end ENUMTAG
-+
-+// Comes from: 81:10: ( 'includes' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start INCLUDES
-+ *
-+ * Looks to match the characters the constitute the token INCLUDES
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mINCLUDES(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = INCLUDES;
-+
-+
-+ // SMARTPL.g:81:10: ( 'includes' )
-+ // SMARTPL.g:81:12: 'includes'
-+ {
-+ MATCHS(lit_18);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINCLUDESEx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleINCLUDESEx; /* Prevent compiler warnings */
-+ ruleINCLUDESEx: ;
-+
-+}
-+// $ANTLR end INCLUDES
-+
-+// Comes from: 84:6: ( 'is' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start IS
-+ *
-+ * Looks to match the characters the constitute the token IS
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mIS(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = IS;
-+
-+
-+ // SMARTPL.g:84:6: ( 'is' )
-+ // SMARTPL.g:84:8: 'is'
-+ {
-+ MATCHS(lit_19);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleISEx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleISEx; /* Prevent compiler warnings */
-+ ruleISEx: ;
-+
-+}
-+// $ANTLR end IS
-+
-+// Comes from: 87:10: ( ( GREATER | GREATEREQUAL | LESS | LESSEQUAL | EQUAL ) )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start INTBOOL
-+ *
-+ * Looks to match the characters the constitute the token INTBOOL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mINTBOOL(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = INTBOOL;
-+
-+
-+ // SMARTPL.g:87:10: ( ( GREATER | GREATEREQUAL | LESS | LESSEQUAL | EQUAL ) )
-+ // SMARTPL.g:87:12: ( GREATER | GREATEREQUAL | LESS | LESSEQUAL | EQUAL )
-+ {
-+
-+ // SMARTPL.g:87:12: ( GREATER | GREATEREQUAL | LESS | LESSEQUAL | EQUAL )
-+ {
-+ int alt5=5;
-+ switch ( LA(1) )
-+ {
-+ case '>':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case '=':
-+ {
-+ alt5=2;
-+ }
-+ break;
-+
-+ default:
-+ alt5=1;}
-+
-+ }
-+ break;
-+ case '<':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case '=':
-+ {
-+ alt5=4;
-+ }
-+ break;
-+
-+ default:
-+ alt5=3;}
-+
-+ }
-+ break;
-+ case '=':
-+ {
-+ alt5=5;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 5;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleINTBOOLEx;
-+ }
-+
-+ switch (alt5)
-+ {
-+ case 1:
-+ // SMARTPL.g:87:13: GREATER
-+ {
-+ /* 87:13: GREATER */
-+ mGREATER(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINTBOOLEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:87:21: GREATEREQUAL
-+ {
-+ /* 87:21: GREATEREQUAL */
-+ mGREATEREQUAL(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINTBOOLEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // SMARTPL.g:87:34: LESS
-+ {
-+ /* 87:34: LESS */
-+ mLESS(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINTBOOLEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // SMARTPL.g:87:39: LESSEQUAL
-+ {
-+ /* 87:39: LESSEQUAL */
-+ mLESSEQUAL(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINTBOOLEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 5:
-+ // SMARTPL.g:87:49: EQUAL
-+ {
-+ /* 87:49: EQUAL */
-+ mEQUAL(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINTBOOLEx;
-+ }
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleINTBOOLEx; /* Prevent compiler warnings */
-+ ruleINTBOOLEx: ;
-+
-+}
-+// $ANTLR end INTBOOL
-+
-+// Comes from: 91:10: ( '>' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start GREATER
-+ *
-+ * Looks to match the characters the constitute the token GREATER
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mGREATER(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+
-+ // SMARTPL.g:91:10: ( '>' )
-+ // SMARTPL.g:91:12: '>'
-+ {
-+ MATCHC('>');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleGREATEREx;
-+ }
-+
-+
-+ }
-+
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleGREATEREx; /* Prevent compiler warnings */
-+ ruleGREATEREx: ;
-+
-+}
-+// $ANTLR end GREATER
-+
-+// Comes from: 95:13: ( '>=' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start GREATEREQUAL
-+ *
-+ * Looks to match the characters the constitute the token GREATEREQUAL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mGREATEREQUAL(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+
-+ // SMARTPL.g:95:13: ( '>=' )
-+ // SMARTPL.g:95:15: '>='
-+ {
-+ MATCHS(lit_20);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleGREATEREQUALEx;
-+ }
-+
-+
-+
-+ }
-+
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleGREATEREQUALEx; /* Prevent compiler warnings */
-+ ruleGREATEREQUALEx: ;
-+
-+}
-+// $ANTLR end GREATEREQUAL
-+
-+// Comes from: 99:7: ( '<' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LESS
-+ *
-+ * Looks to match the characters the constitute the token LESS
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLESS(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+
-+ // SMARTPL.g:99:7: ( '<' )
-+ // SMARTPL.g:99:9: '<'
-+ {
-+ MATCHC('<');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleLESSEx;
-+ }
-+
-+
-+ }
-+
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleLESSEx; /* Prevent compiler warnings */
-+ ruleLESSEx: ;
-+
-+}
-+// $ANTLR end LESS
-+
-+// Comes from: 103:11: ( '<=' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LESSEQUAL
-+ *
-+ * Looks to match the characters the constitute the token LESSEQUAL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLESSEQUAL(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+
-+ // SMARTPL.g:103:11: ( '<=' )
-+ // SMARTPL.g:103:13: '<='
-+ {
-+ MATCHS(lit_21);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleLESSEQUALEx;
-+ }
-+
-+
-+
-+ }
-+
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleLESSEQUALEx; /* Prevent compiler warnings */
-+ ruleLESSEQUALEx: ;
-+
-+}
-+// $ANTLR end LESSEQUAL
-+
-+// Comes from: 107:8: ( '=' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start EQUAL
-+ *
-+ * Looks to match the characters the constitute the token EQUAL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mEQUAL(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+
-+ // SMARTPL.g:107:8: ( '=' )
-+ // SMARTPL.g:107:10: '='
-+ {
-+ MATCHC('=');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleEQUALEx;
-+ }
-+
-+
-+ }
-+
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleEQUALEx; /* Prevent compiler warnings */
-+ ruleEQUALEx: ;
-+
-+}
-+// $ANTLR end EQUAL
-+
-+// Comes from: 110:8: ( 'after' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start AFTER
-+ *
-+ * Looks to match the characters the constitute the token AFTER
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mAFTER(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = AFTER;
-+
-+
-+ // SMARTPL.g:110:8: ( 'after' )
-+ // SMARTPL.g:110:10: 'after'
-+ {
-+ MATCHS(lit_22);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleAFTEREx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleAFTEREx; /* Prevent compiler warnings */
-+ ruleAFTEREx: ;
-+
-+}
-+// $ANTLR end AFTER
-+
-+// Comes from: 113:9: ( 'before' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start BEFORE
-+ *
-+ * Looks to match the characters the constitute the token BEFORE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mBEFORE(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = BEFORE;
-+
-+
-+ // SMARTPL.g:113:9: ( 'before' )
-+ // SMARTPL.g:113:11: 'before'
-+ {
-+ MATCHS(lit_23);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleBEFOREEx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleBEFOREEx; /* Prevent compiler warnings */
-+ ruleBEFOREEx: ;
-+
-+}
-+// $ANTLR end BEFORE
-+
-+// Comes from: 116:7: ( 'ago' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start AGO
-+ *
-+ * Looks to match the characters the constitute the token AGO
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mAGO(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = AGO;
-+
-+
-+ // SMARTPL.g:116:7: ( 'ago' )
-+ // SMARTPL.g:116:9: 'ago'
-+ {
-+ MATCHS(lit_24);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleAGOEx;
-+ }
-+
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleAGOEx; /* Prevent compiler warnings */
-+ ruleAGOEx: ;
-+
-+}
-+// $ANTLR end AGO
-+
-+// Comes from: 119:7: ( 'AND' | 'and' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start AND
-+ *
-+ * Looks to match the characters the constitute the token AND
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mAND(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = AND;
-+
-+
-+ {
-+ // SMARTPL.g:119:7: ( 'AND' | 'and' )
-+
-+ ANTLR3_UINT32 alt6;
-+
-+ alt6=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case 'A':
-+ {
-+ alt6=1;
-+ }
-+ break;
-+ case 'a':
-+ {
-+ alt6=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 6;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleANDEx;
-+ }
-+
-+ switch (alt6)
-+ {
-+ case 1:
-+ // SMARTPL.g:119:9: 'AND'
-+ {
-+ MATCHS(lit_25);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleANDEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:120:6: 'and'
-+ {
-+ MATCHS(lit_26);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleANDEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleANDEx; /* Prevent compiler warnings */
-+ ruleANDEx: ;
-+
-+}
-+// $ANTLR end AND
-+
-+// Comes from: 123:6: ( 'OR' | 'or' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start OR
-+ *
-+ * Looks to match the characters the constitute the token OR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mOR(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = OR;
-+
-+
-+ {
-+ // SMARTPL.g:123:6: ( 'OR' | 'or' )
-+
-+ ANTLR3_UINT32 alt7;
-+
-+ alt7=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case 'O':
-+ {
-+ alt7=1;
-+ }
-+ break;
-+ case 'o':
-+ {
-+ alt7=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 7;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleOREx;
-+ }
-+
-+ switch (alt7)
-+ {
-+ case 1:
-+ // SMARTPL.g:123:8: 'OR'
-+ {
-+ MATCHS(lit_27);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleOREx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:124:6: 'or'
-+ {
-+ MATCHS(lit_28);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleOREx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleOREx; /* Prevent compiler warnings */
-+ ruleOREx: ;
-+
-+}
-+// $ANTLR end OR
-+
-+// Comes from: 127:7: ( 'NOT' | 'not' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start NOT
-+ *
-+ * Looks to match the characters the constitute the token NOT
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mNOT(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = NOT;
-+
-+
-+ {
-+ // SMARTPL.g:127:7: ( 'NOT' | 'not' )
-+
-+ ANTLR3_UINT32 alt8;
-+
-+ alt8=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case 'N':
-+ {
-+ alt8=1;
-+ }
-+ break;
-+ case 'n':
-+ {
-+ alt8=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 8;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleNOTEx;
-+ }
-+
-+ switch (alt8)
-+ {
-+ case 1:
-+ // SMARTPL.g:127:9: 'NOT'
-+ {
-+ MATCHS(lit_29);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleNOTEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:128:6: 'not'
-+ {
-+ MATCHS(lit_30);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleNOTEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleNOTEx; /* Prevent compiler warnings */
-+ ruleNOTEx: ;
-+
-+}
-+// $ANTLR end NOT
-+
-+// Comes from: 131:7: ( '(' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start LPAR
-+ *
-+ * Looks to match the characters the constitute the token LPAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mLPAR(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = LPAR;
-+
-+
-+ // SMARTPL.g:131:7: ( '(' )
-+ // SMARTPL.g:131:9: '('
-+ {
-+ MATCHC('(');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleLPAREx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleLPAREx; /* Prevent compiler warnings */
-+ ruleLPAREx: ;
-+
-+}
-+// $ANTLR end LPAR
-+
-+// Comes from: 134:7: ( ')' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start RPAR
-+ *
-+ * Looks to match the characters the constitute the token RPAR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mRPAR(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = RPAR;
-+
-+
-+ // SMARTPL.g:134:7: ( ')' )
-+ // SMARTPL.g:134:9: ')'
-+ {
-+ MATCHC(')');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleRPAREx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleRPAREx; /* Prevent compiler warnings */
-+ ruleRPAREx: ;
-+
-+}
-+// $ANTLR end RPAR
-+
-+// Comes from: 137:7: ( ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) '-' ( '0' .. '1' ) ( '0' .. '9' ) '-' ( '0' .. '3' ) ( '0' .. '9' ) | 'today' | 'yesterday' | 'last week' | 'last month' | 'last year' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DATE
-+ *
-+ * Looks to match the characters the constitute the token DATE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDATE(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = DATE;
-+
-+
-+ {
-+ // SMARTPL.g:137:7: ( ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) '-' ( '0' .. '1' ) ( '0' .. '9' ) '-' ( '0' .. '3' ) ( '0' .. '9' ) | 'today' | 'yesterday' | 'last week' | 'last month' | 'last year' )
-+
-+ ANTLR3_UINT32 alt9;
-+
-+ alt9=6;
-+
-+ switch ( LA(1) )
-+ {
-+ case '0':
-+ case '1':
-+ case '2':
-+ case '3':
-+ case '4':
-+ case '5':
-+ case '6':
-+ case '7':
-+ case '8':
-+ case '9':
-+ {
-+ alt9=1;
-+ }
-+ break;
-+ case 't':
-+ {
-+ alt9=2;
-+ }
-+ break;
-+ case 'y':
-+ {
-+ alt9=3;
-+ }
-+ break;
-+ case 'l':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'a':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 's':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 't':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case ' ':
-+ {
-+ switch ( LA(6) )
-+ {
-+ case 'w':
-+ {
-+ alt9=4;
-+ }
-+ break;
-+ case 'm':
-+ {
-+ alt9=5;
-+ }
-+ break;
-+ case 'y':
-+ {
-+ alt9=6;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 9;
-+ EXCEPTION->state = 8;
-+
-+
-+ goto ruleDATEEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 9;
-+ EXCEPTION->state = 7;
-+
-+
-+ goto ruleDATEEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 9;
-+ EXCEPTION->state = 6;
-+
-+
-+ goto ruleDATEEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 9;
-+ EXCEPTION->state = 5;
-+
-+
-+ goto ruleDATEEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 9;
-+ EXCEPTION->state = 4;
-+
-+
-+ goto ruleDATEEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 9;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleDATEEx;
-+ }
-+
-+ switch (alt9)
-+ {
-+ case 1:
-+ // SMARTPL.g:137:9: ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) ( '0' .. '9' ) '-' ( '0' .. '1' ) ( '0' .. '9' ) '-' ( '0' .. '3' ) ( '0' .. '9' )
-+ {
-+ // SMARTPL.g:137:9: ( '0' .. '9' )
-+ // SMARTPL.g:137:10: '0' .. '9'
-+ {
-+ MATCHRANGE('0', '9');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ }
-+
-+ // SMARTPL.g:137:19: ( '0' .. '9' )
-+ // SMARTPL.g:137:20: '0' .. '9'
-+ {
-+ MATCHRANGE('0', '9');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ }
-+
-+ // SMARTPL.g:137:29: ( '0' .. '9' )
-+ // SMARTPL.g:137:30: '0' .. '9'
-+ {
-+ MATCHRANGE('0', '9');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ }
-+
-+ // SMARTPL.g:137:39: ( '0' .. '9' )
-+ // SMARTPL.g:137:40: '0' .. '9'
-+ {
-+ MATCHRANGE('0', '9');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ }
-+
-+ MATCHC('-');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+ // SMARTPL.g:137:52: ( '0' .. '1' )
-+ // SMARTPL.g:137:53: '0' .. '1'
-+ {
-+ MATCHRANGE('0', '1');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ }
-+
-+ // SMARTPL.g:137:62: ( '0' .. '9' )
-+ // SMARTPL.g:137:63: '0' .. '9'
-+ {
-+ MATCHRANGE('0', '9');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ }
-+
-+ MATCHC('-');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+ // SMARTPL.g:137:75: ( '0' .. '3' )
-+ // SMARTPL.g:137:76: '0' .. '3'
-+ {
-+ MATCHRANGE('0', '3');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ }
-+
-+ // SMARTPL.g:137:85: ( '0' .. '9' )
-+ // SMARTPL.g:137:86: '0' .. '9'
-+ {
-+ MATCHRANGE('0', '9');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+ }
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:138:6: 'today'
-+ {
-+ MATCHS(lit_31);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // SMARTPL.g:139:6: 'yesterday'
-+ {
-+ MATCHS(lit_32);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // SMARTPL.g:140:6: 'last week'
-+ {
-+ MATCHS(lit_33);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 5:
-+ // SMARTPL.g:141:6: 'last month'
-+ {
-+ MATCHS(lit_34);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 6:
-+ // SMARTPL.g:142:6: 'last year'
-+ {
-+ MATCHS(lit_35);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATEEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleDATEEx; /* Prevent compiler warnings */
-+ ruleDATEEx: ;
-+
-+}
-+// $ANTLR end DATE
-+
-+// Comes from: 145:13: ( 'days' | 'weeks' | 'months' | 'years' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start DATINTERVAL
-+ *
-+ * Looks to match the characters the constitute the token DATINTERVAL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mDATINTERVAL(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = DATINTERVAL;
-+
-+
-+ {
-+ // SMARTPL.g:145:13: ( 'days' | 'weeks' | 'months' | 'years' )
-+
-+ ANTLR3_UINT32 alt10;
-+
-+ alt10=4;
-+
-+ switch ( LA(1) )
-+ {
-+ case 'd':
-+ {
-+ alt10=1;
-+ }
-+ break;
-+ case 'w':
-+ {
-+ alt10=2;
-+ }
-+ break;
-+ case 'm':
-+ {
-+ alt10=3;
-+ }
-+ break;
-+ case 'y':
-+ {
-+ alt10=4;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 10;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleDATINTERVALEx;
-+ }
-+
-+ switch (alt10)
-+ {
-+ case 1:
-+ // SMARTPL.g:145:15: 'days'
-+ {
-+ MATCHS(lit_36);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATINTERVALEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:146:6: 'weeks'
-+ {
-+ MATCHS(lit_37);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATINTERVALEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // SMARTPL.g:147:6: 'months'
-+ {
-+ MATCHS(lit_38);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATINTERVALEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // SMARTPL.g:148:6: 'years'
-+ {
-+ MATCHS(lit_39);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleDATINTERVALEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleDATINTERVALEx; /* Prevent compiler warnings */
-+ ruleDATINTERVALEx: ;
-+
-+}
-+// $ANTLR end DATINTERVAL
-+
-+// Comes from: 151:10: ( 'music' | 'movie' | 'podcast' | 'audiobook' | 'tvshow' | 'file' | 'url' | 'spotify' | 'pipe' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start ENUMVAL
-+ *
-+ * Looks to match the characters the constitute the token ENUMVAL
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mENUMVAL(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = ENUMVAL;
-+
-+
-+ {
-+ // SMARTPL.g:151:10: ( 'music' | 'movie' | 'podcast' | 'audiobook' | 'tvshow' | 'file' | 'url' | 'spotify' | 'pipe' )
-+
-+ ANTLR3_UINT32 alt11;
-+
-+ alt11=9;
-+
-+ switch ( LA(1) )
-+ {
-+ case 'm':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'u':
-+ {
-+ alt11=1;
-+ }
-+ break;
-+ case 'o':
-+ {
-+ alt11=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 11;
-+ EXCEPTION->state = 1;
-+
-+
-+ goto ruleENUMVALEx;
-+ }
-+
-+ }
-+ break;
-+ case 'p':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'o':
-+ {
-+ alt11=3;
-+ }
-+ break;
-+ case 'i':
-+ {
-+ alt11=9;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 11;
-+ EXCEPTION->state = 2;
-+
-+
-+ goto ruleENUMVALEx;
-+ }
-+
-+ }
-+ break;
-+ case 'a':
-+ {
-+ alt11=4;
-+ }
-+ break;
-+ case 't':
-+ {
-+ alt11=5;
-+ }
-+ break;
-+ case 'f':
-+ {
-+ alt11=6;
-+ }
-+ break;
-+ case 'u':
-+ {
-+ alt11=7;
-+ }
-+ break;
-+ case 's':
-+ {
-+ alt11=8;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 11;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleENUMVALEx;
-+ }
-+
-+ switch (alt11)
-+ {
-+ case 1:
-+ // SMARTPL.g:151:12: 'music'
-+ {
-+ MATCHS(lit_40);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleENUMVALEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:152:6: 'movie'
-+ {
-+ MATCHS(lit_41);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleENUMVALEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // SMARTPL.g:153:6: 'podcast'
-+ {
-+ MATCHS(lit_42);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleENUMVALEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // SMARTPL.g:154:6: 'audiobook'
-+ {
-+ MATCHS(lit_43);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleENUMVALEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 5:
-+ // SMARTPL.g:155:6: 'tvshow'
-+ {
-+ MATCHS(lit_44);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleENUMVALEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 6:
-+ // SMARTPL.g:156:6: 'file'
-+ {
-+ MATCHS(lit_45);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleENUMVALEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 7:
-+ // SMARTPL.g:157:6: 'url'
-+ {
-+ MATCHS(lit_46);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleENUMVALEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 8:
-+ // SMARTPL.g:158:6: 'spotify'
-+ {
-+ MATCHS(lit_47);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleENUMVALEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+ case 9:
-+ // SMARTPL.g:159:6: 'pipe'
-+ {
-+ MATCHS(lit_48);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleENUMVALEx;
-+ }
-+
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleENUMVALEx; /* Prevent compiler warnings */
-+ ruleENUMVALEx: ;
-+
-+}
-+// $ANTLR end ENUMVAL
-+
-+// Comes from: 162:7: ( '\"' (~ ( '\"' ) )+ '\"' )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start STR
-+ *
-+ * Looks to match the characters the constitute the token STR
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mSTR(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = STR;
-+
-+
-+ // SMARTPL.g:162:7: ( '\"' (~ ( '\"' ) )+ '\"' )
-+ // SMARTPL.g:162:9: '\"' (~ ( '\"' ) )+ '\"'
-+ {
-+ MATCHC('"');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTREx;
-+ }
-+
-+ // SMARTPL.g:162:13: (~ ( '\"' ) )+
-+ {
-+ int cnt12=0;
-+
-+ for (;;)
-+ {
-+ int alt12=2;
-+ {
-+ /* dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
-+ */
-+ int LA12_0 = LA(1);
-+ if ( (((LA12_0 >= 0x0000) && (LA12_0 <= '!')) || ((LA12_0 >= '#') && (LA12_0 <= 0xFFFF))) )
-+ {
-+ alt12=1;
-+ }
-+
-+ }
-+ switch (alt12)
-+ {
-+ case 1:
-+ // SMARTPL.g:162:13: ~ ( '\"' )
-+ {
-+ if ( ((LA(1) >= 0x0000) && (LA(1) <= '!')) || ((LA(1) >= '#') && (LA(1) <= 0xFFFF)) )
-+ {
-+ CONSUME();
-+
-+ }
-+ else
-+ {
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+ LRECOVER(); goto ruleSTREx;
-+ }
-+
-+
-+ }
-+ break;
-+
-+ default:
-+
-+ if ( cnt12 >= 1 )
-+ {
-+ goto loop12;
-+ }
-+ /* mismatchedSetEx()
-+ */
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
-+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
-+
-+
-+ goto ruleSTREx;
-+ }
-+ cnt12++;
-+ }
-+ loop12: ; /* Jump to here if this rule does not match */
-+ }
-+ MATCHC('"');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleSTREx;
-+ }
-+
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleSTREx; /* Prevent compiler warnings */
-+ ruleSTREx: ;
-+
-+}
-+// $ANTLR end STR
-+
-+// Comes from: 165:7: ( ( '0' .. '9' )+ )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start INT
-+ *
-+ * Looks to match the characters the constitute the token INT
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mINT(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = INT;
-+
-+
-+ // SMARTPL.g:165:7: ( ( '0' .. '9' )+ )
-+ // SMARTPL.g:165:9: ( '0' .. '9' )+
-+ {
-+ // SMARTPL.g:165:9: ( '0' .. '9' )+
-+ {
-+ int cnt13=0;
-+
-+ for (;;)
-+ {
-+ int alt13=2;
-+ switch ( LA(1) )
-+ {
-+ case '0':
-+ case '1':
-+ case '2':
-+ case '3':
-+ case '4':
-+ case '5':
-+ case '6':
-+ case '7':
-+ case '8':
-+ case '9':
-+ {
-+ alt13=1;
-+ }
-+ break;
-+
-+ }
-+
-+ switch (alt13)
-+ {
-+ case 1:
-+ // SMARTPL.g:165:10: '0' .. '9'
-+ {
-+ MATCHRANGE('0', '9');
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleINTEx;
-+ }
-+
-+
-+ }
-+ break;
-+
-+ default:
-+
-+ if ( cnt13 >= 1 )
-+ {
-+ goto loop13;
-+ }
-+ /* mismatchedSetEx()
-+ */
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
-+ EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
-+
-+
-+ goto ruleINTEx;
-+ }
-+ cnt13++;
-+ }
-+ loop13: ; /* Jump to here if this rule does not match */
-+ }
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleINTEx; /* Prevent compiler warnings */
-+ ruleINTEx: ;
-+
-+}
-+// $ANTLR end INT
-+
-+// Comes from: 168:12: ( ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' ) )
-+/** \brief Lexer rule generated by ANTLR3
-+ *
-+ * $ANTLR start WHITESPACE
-+ *
-+ * Looks to match the characters the constitute the token WHITESPACE
-+ * from the attached input stream.
-+ *
-+ *
-+ * \remark
-+ * - lexer->error == ANTLR3_TRUE if an exception was thrown.
-+ */
-+static ANTLR3_INLINE
-+void mWHITESPACE(pSMARTPLLexer ctx)
-+{
-+ ANTLR3_UINT32 _type;
-+
-+ _type = WHITESPACE;
-+
-+
-+ // SMARTPL.g:168:12: ( ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' ) )
-+ // SMARTPL.g:168:14: ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' )
-+ {
-+ if ( ((LA(1) >= '\t') && (LA(1) <= '\n')) || ((LA(1) >= '\f') && (LA(1) <= '\r')) || LA(1) == ' ' )
-+ {
-+ CONSUME();
-+
-+ }
-+ else
-+ {
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+
-+ LRECOVER(); goto ruleWHITESPACEEx;
-+ }
-+
-+ {
-+ LEXSTATE->channel = HIDDEN;
-+ }
-+
-+ }
-+
-+ LEXSTATE->type = _type;
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleWHITESPACEEx; /* Prevent compiler warnings */
-+ ruleWHITESPACEEx: ;
-+
-+}
-+// $ANTLR end WHITESPACE
-+
-+/** This is the entry point in to the lexer from an object that
-+ * wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
-+ */
-+static void
-+mTokens(pSMARTPLLexer ctx)
-+{
-+ {
-+ // SMARTPL.g:1:8: ( T__30 | T__31 | STRTAG | INTTAG | DATETAG | ENUMTAG | INCLUDES | IS | INTBOOL | AFTER | BEFORE | AGO | AND | OR | NOT | LPAR | RPAR | DATE | DATINTERVAL | ENUMVAL | STR | INT | WHITESPACE )
-+
-+ ANTLR3_UINT32 alt14;
-+
-+ alt14=23;
-+
-+ switch ( LA(1) )
-+ {
-+ case '{':
-+ {
-+ alt14=1;
-+ }
-+ break;
-+ case '}':
-+ {
-+ alt14=2;
-+ }
-+ break;
-+ case 'a':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'l':
-+ case 'r':
-+ {
-+ alt14=3;
-+ }
-+ break;
-+ case 'f':
-+ {
-+ alt14=10;
-+ }
-+ break;
-+ case 'g':
-+ {
-+ alt14=12;
-+ }
-+ break;
-+ case 'n':
-+ {
-+ alt14=13;
-+ }
-+ break;
-+ case 'u':
-+ {
-+ alt14=20;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 3;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 't':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'i':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 't':
-+ {
-+ alt14=3;
-+ }
-+ break;
-+ case 'm':
-+ {
-+ alt14=5;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 28;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'y':
-+ {
-+ alt14=3;
-+ }
-+ break;
-+ case 'o':
-+ {
-+ alt14=18;
-+ }
-+ break;
-+ case 'v':
-+ {
-+ alt14=20;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 4;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'g':
-+ {
-+ alt14=3;
-+ }
-+ break;
-+ case 'c':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'o':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'm':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 'p':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 'o':
-+ {
-+ alt14=3;
-+ }
-+ break;
-+ case 'i':
-+ {
-+ alt14=4;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 42;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 39;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 29;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 6;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'p':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'a':
-+ {
-+ alt14=3;
-+ }
-+ break;
-+ case 'l':
-+ {
-+ alt14=4;
-+ }
-+ break;
-+ case 'i':
-+ case 'o':
-+ {
-+ alt14=20;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 7;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'r':
-+ {
-+ alt14=4;
-+ }
-+ break;
-+ case 'y':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'e':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'a':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case 'r':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case 's':
-+ {
-+ alt14=19;
-+ }
-+ break;
-+
-+ default:
-+ alt14=4;}
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 40;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 's':
-+ {
-+ alt14=18;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 30;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 9;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'd':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'a':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 't':
-+ {
-+ alt14=6;
-+ }
-+ break;
-+ case 'y':
-+ {
-+ alt14=19;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 31;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 10;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'm':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'e':
-+ {
-+ alt14=6;
-+ }
-+ break;
-+ case 'o':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case 'n':
-+ {
-+ alt14=19;
-+ }
-+ break;
-+ case 'v':
-+ {
-+ alt14=20;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 33;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'u':
-+ {
-+ alt14=20;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 11;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case 'i':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case 'n':
-+ {
-+ alt14=7;
-+ }
-+ break;
-+ case 's':
-+ {
-+ alt14=8;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 12;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ }
-+ break;
-+ case '<':
-+ case '=':
-+ case '>':
-+ {
-+ alt14=9;
-+ }
-+ break;
-+ case 'b':
-+ {
-+ alt14=11;
-+ }
-+ break;
-+ case 'A':
-+ {
-+ alt14=13;
-+ }
-+ break;
-+ case 'O':
-+ case 'o':
-+ {
-+ alt14=14;
-+ }
-+ break;
-+ case 'N':
-+ case 'n':
-+ {
-+ alt14=15;
-+ }
-+ break;
-+ case '(':
-+ {
-+ alt14=16;
-+ }
-+ break;
-+ case ')':
-+ {
-+ alt14=17;
-+ }
-+ break;
-+ case '0':
-+ case '1':
-+ case '2':
-+ case '3':
-+ case '4':
-+ case '5':
-+ case '6':
-+ case '7':
-+ case '8':
-+ case '9':
-+ {
-+ switch ( LA(2) )
-+ {
-+ case '0':
-+ case '1':
-+ case '2':
-+ case '3':
-+ case '4':
-+ case '5':
-+ case '6':
-+ case '7':
-+ case '8':
-+ case '9':
-+ {
-+ switch ( LA(3) )
-+ {
-+ case '0':
-+ case '1':
-+ case '2':
-+ case '3':
-+ case '4':
-+ case '5':
-+ case '6':
-+ case '7':
-+ case '8':
-+ case '9':
-+ {
-+ switch ( LA(4) )
-+ {
-+ case '0':
-+ case '1':
-+ case '2':
-+ case '3':
-+ case '4':
-+ case '5':
-+ case '6':
-+ case '7':
-+ case '8':
-+ case '9':
-+ {
-+ switch ( LA(5) )
-+ {
-+ case '-':
-+ {
-+ alt14=18;
-+ }
-+ break;
-+
-+ default:
-+ alt14=22;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt14=22;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt14=22;}
-+
-+ }
-+ break;
-+
-+ default:
-+ alt14=22;}
-+
-+ }
-+ break;
-+ case 'l':
-+ {
-+ alt14=18;
-+ }
-+ break;
-+ case 'w':
-+ {
-+ alt14=19;
-+ }
-+ break;
-+ case 'f':
-+ case 's':
-+ case 'u':
-+ {
-+ alt14=20;
-+ }
-+ break;
-+ case '"':
-+ {
-+ alt14=21;
-+ }
-+ break;
-+ case '\t':
-+ case '\n':
-+ case '\f':
-+ case '\r':
-+ case ' ':
-+ {
-+ alt14=23;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 14;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruleTokensEx;
-+ }
-+
-+ switch (alt14)
-+ {
-+ case 1:
-+ // SMARTPL.g:1:10: T__30
-+ {
-+ /* 1:10: T__30 */
-+ mT__30(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:1:16: T__31
-+ {
-+ /* 1:16: T__31 */
-+ mT__31(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // SMARTPL.g:1:22: STRTAG
-+ {
-+ /* 1:22: STRTAG */
-+ mSTRTAG(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // SMARTPL.g:1:29: INTTAG
-+ {
-+ /* 1:29: INTTAG */
-+ mINTTAG(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 5:
-+ // SMARTPL.g:1:36: DATETAG
-+ {
-+ /* 1:36: DATETAG */
-+ mDATETAG(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 6:
-+ // SMARTPL.g:1:44: ENUMTAG
-+ {
-+ /* 1:44: ENUMTAG */
-+ mENUMTAG(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 7:
-+ // SMARTPL.g:1:52: INCLUDES
-+ {
-+ /* 1:52: INCLUDES */
-+ mINCLUDES(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 8:
-+ // SMARTPL.g:1:61: IS
-+ {
-+ /* 1:61: IS */
-+ mIS(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 9:
-+ // SMARTPL.g:1:64: INTBOOL
-+ {
-+ /* 1:64: INTBOOL */
-+ mINTBOOL(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 10:
-+ // SMARTPL.g:1:72: AFTER
-+ {
-+ /* 1:72: AFTER */
-+ mAFTER(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 11:
-+ // SMARTPL.g:1:78: BEFORE
-+ {
-+ /* 1:78: BEFORE */
-+ mBEFORE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 12:
-+ // SMARTPL.g:1:85: AGO
-+ {
-+ /* 1:85: AGO */
-+ mAGO(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 13:
-+ // SMARTPL.g:1:89: AND
-+ {
-+ /* 1:89: AND */
-+ mAND(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 14:
-+ // SMARTPL.g:1:93: OR
-+ {
-+ /* 1:93: OR */
-+ mOR(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 15:
-+ // SMARTPL.g:1:96: NOT
-+ {
-+ /* 1:96: NOT */
-+ mNOT(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 16:
-+ // SMARTPL.g:1:100: LPAR
-+ {
-+ /* 1:100: LPAR */
-+ mLPAR(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 17:
-+ // SMARTPL.g:1:105: RPAR
-+ {
-+ /* 1:105: RPAR */
-+ mRPAR(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 18:
-+ // SMARTPL.g:1:110: DATE
-+ {
-+ /* 1:110: DATE */
-+ mDATE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 19:
-+ // SMARTPL.g:1:115: DATINTERVAL
-+ {
-+ /* 1:115: DATINTERVAL */
-+ mDATINTERVAL(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 20:
-+ // SMARTPL.g:1:127: ENUMVAL
-+ {
-+ /* 1:127: ENUMVAL */
-+ mENUMVAL(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 21:
-+ // SMARTPL.g:1:135: STR
-+ {
-+ /* 1:135: STR */
-+ mSTR(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 22:
-+ // SMARTPL.g:1:139: INT
-+ {
-+ /* 1:139: INT */
-+ mINT(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+ case 23:
-+ // SMARTPL.g:1:143: WHITESPACE
-+ {
-+ /* 1:143: WHITESPACE */
-+ mWHITESPACE(ctx );
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleTokensEx;
-+ }
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+
-+
-+ goto ruleTokensEx; /* Prevent compiler warnings */
-+ruleTokensEx: ;
-+}
-+
-+/* =========================================================================
-+ * Lexer matching rules end.
-+ * =========================================================================
-+ */
-+/* End of Lexer code
-+ * ================================================
-+ * ================================================
-+ */
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/SMARTPLLexer.h b/src/pregen/SMARTPLLexer.h
-new file mode 100644
-index 0000000..87e8c7e
---- /dev/null
-+++ b/src/pregen/SMARTPLLexer.h
-@@ -0,0 +1,248 @@
-+/** \file
-+ * This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : SMARTPL.g
-+ * - On : 2016-01-01 12:23:40
-+ * - for the lexer : SMARTPLLexerLexer *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The lexer SMARTPLLexer has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ *
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pSMARTPLLexer, which is returned from a call to SMARTPLLexerNew().
-+ *
-+ * As this is a generated lexer, it is unlikely you will call it 'manually'. However
-+ * the methods are provided anyway.
-+ * * The methods in pSMARTPLLexer are as follows:
-+ *
-+ * - void pSMARTPLLexer->T__30(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->T__31(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->STRTAG(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->INTTAG(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->DATETAG(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->ENUMTAG(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->INCLUDES(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->IS(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->INTBOOL(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->GREATER(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->GREATEREQUAL(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->LESS(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->LESSEQUAL(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->EQUAL(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->AFTER(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->BEFORE(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->AGO(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->AND(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->OR(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->NOT(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->LPAR(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->RPAR(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->DATE(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->DATINTERVAL(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->ENUMVAL(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->STR(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->INT(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->WHITESPACE(pSMARTPLLexer)
-+ * - void pSMARTPLLexer->Tokens(pSMARTPLLexer)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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 _SMARTPLLexer_H
-+#define _SMARTPLLexer_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct SMARTPLLexer_Ctx_struct SMARTPLLexer, * pSMARTPLLexer;
-+
-+
-+
-+#ifdef ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter, - Rules with parameters that are not used
-+// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
-+// initialized but unused variable - tree rewrite variables declared but not needed
-+// Unreferenced local variable - lexer rule declares but does not always use _type
-+// potentially unitialized variable used - retval always returned from a rule
-+// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+
-+/** Context tracking structure for SMARTPLLexer
-+ */
-+struct SMARTPLLexer_Ctx_struct
-+{
-+ /** Built in ANTLR3 context tracker contains all the generic elements
-+ * required for context tracking.
-+ */
-+ pANTLR3_LEXER pLexer;
-+
-+
-+ void (*mT__30) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mT__31) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mSTRTAG) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mINTTAG) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mDATETAG) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mENUMTAG) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mINCLUDES) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mIS) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mINTBOOL) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mGREATER) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mGREATEREQUAL) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mLESS) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mLESSEQUAL) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mEQUAL) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mAFTER) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mBEFORE) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mAGO) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mAND) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mOR) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mNOT) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mLPAR) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mRPAR) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mDATE) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mDATINTERVAL) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mENUMVAL) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mSTR) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mINT) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mWHITESPACE) (struct SMARTPLLexer_Ctx_struct * ctx);
-+ void (*mTokens) (struct SMARTPLLexer_Ctx_struct * ctx); const char * (*getGrammarFileName)();
-+ void (*free) (struct SMARTPLLexer_Ctx_struct * ctx);
-+
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pSMARTPLLexer SMARTPLLexerNew (pANTLR3_INPUT_STREAM instream);
-+ANTLR3_API pSMARTPLLexer SMARTPLLexerNewSSD (pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the lexer will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef EOF
-+#undef EOF
-+#endif
-+#ifdef Tokens
-+#undef Tokens
-+#endif
-+#define INTBOOL 14
-+#define STRTAG 10
-+#define AGO 22
-+#define WHITESPACE 29
-+#define GREATEREQUAL 25
-+#define BEFORE 18
-+#define DATETAG 16
-+#define INT 15
-+#define NOT 7
-+#define AFTER 17
-+#define AND 6
-+#define EOF -1
-+#define INCLUDES 11
-+#define STR 4
-+#define T__30 30
-+#define T__31 31
-+#define GREATER 24
-+#define LPAR 8
-+#define ENUMTAG 19
-+#define IS 12
-+#define ENUMVAL 20
-+#define EQUAL 28
-+#define OR 5
-+#define LESS 26
-+#define RPAR 9
-+#define DATE 21
-+#define LESSEQUAL 27
-+#define INTTAG 13
-+#define DATINTERVAL 23
-+#ifdef EOF
-+#undef EOF
-+#define EOF ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for SMARTPLLexer
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
-diff --git a/src/pregen/SMARTPLParser.c b/src/pregen/SMARTPLParser.c
-new file mode 100644
-index 0000000..f39e5ae
---- /dev/null
-+++ b/src/pregen/SMARTPLParser.c
-@@ -0,0 +1,1812 @@
-+/** \file
-+ * This C source file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : SMARTPL.g
-+ * - On : 2016-01-01 12:23:40
-+ * - for the parser : SMARTPLParserParser *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+*/
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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.
-+
-+/* -----------------------------------------
-+ * Include the ANTLR3 generated header file.
-+ */
-+#include "SMARTPLParser.h"
-+/* ----------------------------------------- */
-+
-+
-+
-+
-+
-+/* MACROS that hide the C interface implementations from the
-+ * generated code, which makes it a little more understandable to the human eye.
-+ * I am very much against using C pre-processor macros for function calls and bits
-+ * of code as you cannot see what is happening when single stepping in debuggers
-+ * and so on. The exception (in my book at least) is for generated code, where you are
-+ * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
-+ * hides some indirect calls, but is always referring to the input stream. This is
-+ * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
-+ * the runtime interfaces without changing the generated code too often, without
-+ * confusing the reader of the generated output, who may not wish to know the gory
-+ * details of the interface inheritance.
-+ */
-+
-+#define CTX ctx
-+
-+/* Aids in accessing scopes for grammar programmers
-+ */
-+#undef SCOPE_TYPE
-+#undef SCOPE_STACK
-+#undef SCOPE_TOP
-+#define SCOPE_TYPE(scope) pSMARTPLParser_##scope##_SCOPE
-+#define SCOPE_STACK(scope) pSMARTPLParser_##scope##Stack
-+#define SCOPE_TOP(scope) ctx->pSMARTPLParser_##scope##Top
-+#define SCOPE_SIZE(scope) ctx->pSMARTPLParser_##scope##Stack_limit
-+#define SCOPE_INSTANCE(scope, i) (ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
-+
-+/* Macros for accessing things in the parser
-+ */
-+
-+#undef PARSER
-+#undef RECOGNIZER
-+#undef HAVEPARSEDRULE
-+#undef MEMOIZE
-+#undef INPUT
-+#undef STRSTREAM
-+#undef HASEXCEPTION
-+#undef EXCEPTION
-+#undef MATCHT
-+#undef MATCHANYT
-+#undef FOLLOWSTACK
-+#undef FOLLOWPUSH
-+#undef FOLLOWPOP
-+#undef PRECOVER
-+#undef PREPORTERROR
-+#undef LA
-+#undef LT
-+#undef CONSTRUCTEX
-+#undef CONSUME
-+#undef MARK
-+#undef REWIND
-+#undef REWINDLAST
-+#undef PERRORRECOVERY
-+#undef HASFAILED
-+#undef FAILEDFLAG
-+#undef RECOVERFROMMISMATCHEDSET
-+#undef RECOVERFROMMISMATCHEDELEMENT
-+#undef INDEX
-+#undef ADAPTOR
-+#undef SEEK
-+#undef RULEMEMO
-+#undef DBG
-+
-+#define PARSER ctx->pParser
-+#define RECOGNIZER PARSER->rec
-+#define PSRSTATE RECOGNIZER->state
-+#define HAVEPARSEDRULE(r) RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
-+#define MEMOIZE(ri,si) RECOGNIZER->memoize(RECOGNIZER, ri, si)
-+#define INPUT PARSER->tstream
-+#define STRSTREAM INPUT
-+#define ISTREAM INPUT->istream
-+#define INDEX() ISTREAM->index(INPUT->istream)
-+#define HASEXCEPTION() (PSRSTATE->error == ANTLR3_TRUE)
-+#define EXCEPTION PSRSTATE->exception
-+#define MATCHT(t, fs) RECOGNIZER->match(RECOGNIZER, t, fs)
-+#define MATCHANYT() RECOGNIZER->matchAny(RECOGNIZER)
-+#define FOLLOWSTACK PSRSTATE->following
-+#define FOLLOWPUSH(x) FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
-+#define FOLLOWPOP() FOLLOWSTACK->pop(FOLLOWSTACK)
-+#define PRECOVER() RECOGNIZER->recover(RECOGNIZER)
-+#define PREPORTERROR() RECOGNIZER->reportError(RECOGNIZER)
-+#define LA(n) INPUT->istream->_LA(ISTREAM, n)
-+#define LT(n) INPUT->_LT(INPUT, n)
-+#define CONSTRUCTEX() RECOGNIZER->exConstruct(RECOGNIZER)
-+#define CONSUME() ISTREAM->consume(ISTREAM)
-+#define MARK() ISTREAM->mark(ISTREAM)
-+#define REWIND(m) ISTREAM->rewind(ISTREAM, m)
-+#define REWINDLAST() ISTREAM->rewindLast(ISTREAM)
-+#define SEEK(n) ISTREAM->seek(ISTREAM, n)
-+#define PERRORRECOVERY PSRSTATE->errorRecovery
-+#define FAILEDFLAG PSRSTATE->failed
-+#define HASFAILED() (FAILEDFLAG == ANTLR3_TRUE)
-+#define BACKTRACKING PSRSTATE->backtracking
-+#define RECOVERFROMMISMATCHEDSET(s) RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
-+#define RECOVERFROMMISMATCHEDELEMENT(e) RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
-+#define ADAPTOR ctx->adaptor
-+#define RULEMEMO PSRSTATE->ruleMemo
-+#define DBG RECOGNIZER->debugger
-+
-+#define TOKTEXT(tok, txt) tok, (pANTLR3_UINT8)txt
-+
-+/* The 4 tokens defined below may well clash with your own #defines or token types. If so
-+ * then for the present you must use different names for your defines as these are hard coded
-+ * in the code generator. It would be better not to use such names internally, and maybe
-+ * we can change this in a forthcoming release. I deliberately do not #undef these
-+ * here as this will at least give you a redefined error somewhere if they clash.
-+ */
-+#define UP ANTLR3_TOKEN_UP
-+#define DOWN ANTLR3_TOKEN_DOWN
-+#define EOR ANTLR3_TOKEN_EOR
-+#define INVALID ANTLR3_TOKEN_INVALID
-+
-+
-+/* =============================================================================
-+ * Functions to create and destroy scopes. First come the rule scopes, followed
-+ * by the global declared scopes.
-+ */
-+
-+
-+
-+/* ============================================================================= */
-+
-+/* =============================================================================
-+ * Start of recognizer
-+ */
-+
-+
-+
-+/** \brief Table of all token names in symbolic order, mainly used for
-+ * error reporting.
-+ */
-+pANTLR3_UINT8 SMARTPLParserTokenNames[28+4]
-+ = {
-+ (pANTLR3_UINT8) "<invalid>", /* String to print to indicate an invalid token */
-+ (pANTLR3_UINT8) "<EOR>",
-+ (pANTLR3_UINT8) "<DOWN>",
-+ (pANTLR3_UINT8) "<UP>",
-+ (pANTLR3_UINT8) "STR",
-+ (pANTLR3_UINT8) "OR",
-+ (pANTLR3_UINT8) "AND",
-+ (pANTLR3_UINT8) "NOT",
-+ (pANTLR3_UINT8) "LPAR",
-+ (pANTLR3_UINT8) "RPAR",
-+ (pANTLR3_UINT8) "STRTAG",
-+ (pANTLR3_UINT8) "INCLUDES",
-+ (pANTLR3_UINT8) "IS",
-+ (pANTLR3_UINT8) "INTTAG",
-+ (pANTLR3_UINT8) "INTBOOL",
-+ (pANTLR3_UINT8) "INT",
-+ (pANTLR3_UINT8) "DATETAG",
-+ (pANTLR3_UINT8) "AFTER",
-+ (pANTLR3_UINT8) "BEFORE",
-+ (pANTLR3_UINT8) "ENUMTAG",
-+ (pANTLR3_UINT8) "ENUMVAL",
-+ (pANTLR3_UINT8) "DATE",
-+ (pANTLR3_UINT8) "AGO",
-+ (pANTLR3_UINT8) "DATINTERVAL",
-+ (pANTLR3_UINT8) "GREATER",
-+ (pANTLR3_UINT8) "GREATEREQUAL",
-+ (pANTLR3_UINT8) "LESS",
-+ (pANTLR3_UINT8) "LESSEQUAL",
-+ (pANTLR3_UINT8) "EQUAL",
-+ (pANTLR3_UINT8) "WHITESPACE",
-+ (pANTLR3_UINT8) "'{'",
-+ (pANTLR3_UINT8) "'}'"
-+ };
-+
-+
-+
-+// Forward declare the locally static matching functions we have generated.
-+//
-+static SMARTPLParser_playlist_return playlist (pSMARTPLParser ctx);
-+static SMARTPLParser_expression_return expression (pSMARTPLParser ctx);
-+static SMARTPLParser_aexpr_return aexpr (pSMARTPLParser ctx);
-+static SMARTPLParser_nexpr_return nexpr (pSMARTPLParser ctx);
-+static SMARTPLParser_crit_return crit (pSMARTPLParser ctx);
-+static SMARTPLParser_dateval_return dateval (pSMARTPLParser ctx);
-+static SMARTPLParser_interval_return interval (pSMARTPLParser ctx);
-+static void SMARTPLParserFree(pSMARTPLParser ctx);
-+/* For use in tree output where we are accumulating rule labels via label += ruleRef
-+ * we need a function that knows how to free a return scope when the list is destroyed.
-+ * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
-+ */
-+static void ANTLR3_CDECL freeScope(void * scope)
-+{
-+ ANTLR3_FREE(scope);
-+}
-+
-+/** \brief Name of the grammar file that generated this code
-+ */
-+static const char fileName[] = "SMARTPL.g";
-+
-+/** \brief Return the name of the grammar file that generated this code.
-+ */
-+static const char * getGrammarFileName()
-+{
-+ return fileName;
-+}
-+/** \brief Create a new SMARTPLParser parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pSMARTPLParser
-+SMARTPLParserNew (pANTLR3_COMMON_TOKEN_STREAM instream)
-+{
-+ // See if we can create a new parser with the standard constructor
-+ //
-+ return SMARTPLParserNewSSD(instream, NULL);
-+}
-+
-+/** \brief Create a new SMARTPLParser parser and return a context for it.
-+ *
-+ * \param[in] instream Pointer to an input stream interface.
-+ *
-+ * \return Pointer to new parser context upon success.
-+ */
-+ANTLR3_API pSMARTPLParser
-+SMARTPLParserNewSSD (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
-+{
-+ pSMARTPLParser ctx; /* Context structure we will build and return */
-+
-+ ctx = (pSMARTPLParser) ANTLR3_CALLOC(1, sizeof(SMARTPLParser));
-+
-+ if (ctx == NULL)
-+ {
-+ // Failed to allocate memory for parser context
-+ //
-+ return NULL;
-+ }
-+
-+ /* -------------------------------------------------------------------
-+ * Memory for basic structure is allocated, now to fill in
-+ * the base ANTLR3 structures. We initialize the function pointers
-+ * for the standard ANTLR3 parser function set, but upon return
-+ * from here, the programmer may set the pointers to provide custom
-+ * implementations of each function.
-+ *
-+ * We don't use the macros defined in SMARTPLParser.h here, in order that you can get a sense
-+ * of what goes where.
-+ */
-+
-+ /* Create a base parser/recognizer, using the supplied token stream
-+ */
-+ ctx->pParser = antlr3ParserNewStream(ANTLR3_SIZE_HINT, instream->tstream, state);
-+ /* Install the implementation of our SMARTPLParser interface
-+ */
-+ ctx->playlist = playlist;
-+ ctx->expression = expression;
-+ ctx->aexpr = aexpr;
-+ ctx->nexpr = nexpr;
-+ ctx->crit = crit;
-+ ctx->dateval = dateval;
-+ ctx->interval = interval;
-+ ctx->free = SMARTPLParserFree;
-+ ctx->getGrammarFileName = getGrammarFileName;
-+
-+ /* Install the scope pushing methods.
-+ */
-+ ADAPTOR = ANTLR3_TREE_ADAPTORNew(instream->tstream->tokenSource->strFactory);
-+ ctx->vectors = antlr3VectorFactoryNew(0);
-+
-+
-+
-+ /* Install the token table
-+ */
-+ PSRSTATE->tokenNames = SMARTPLParserTokenNames;
-+
-+
-+ /* Return the newly built parser to the caller
-+ */
-+ return ctx;
-+}
-+
-+/** Free the parser resources
-+ */
-+ static void
-+ SMARTPLParserFree(pSMARTPLParser ctx)
-+ {
-+ /* Free any scope memory
-+ */
-+
-+ ctx->vectors->close(ctx->vectors);
-+ /* We created the adaptor so we must free it
-+ */
-+ ADAPTOR->free(ADAPTOR);
-+ // Free this parser
-+ //
-+ ctx->pParser->free(ctx->pParser);
-+ ANTLR3_FREE(ctx);
-+
-+ /* Everything is released, so we can return
-+ */
-+ return;
-+ }
-+
-+/** Return token names used by this parser
-+ *
-+ * The returned pointer is used as an index into the token names table (using the token
-+ * number as the index).
-+ *
-+ * \return Pointer to first char * in the table.
-+ */
-+static pANTLR3_UINT8 *getTokenNames()
-+{
-+ return SMARTPLParserTokenNames;
-+}
-+
-+
-+/* Declare the bitsets
-+ */
-+
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_playlist42 */
-+static ANTLR3_BITWORD FOLLOW_STR_in_playlist42_bits[] = { ANTLR3_UINT64_LIT(0x0000000040000000) };
-+static ANTLR3_BITSET_LIST FOLLOW_STR_in_playlist42 = { FOLLOW_STR_in_playlist42_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_30_in_playlist44 */
-+static ANTLR3_BITWORD FOLLOW_30_in_playlist44_bits[] = { ANTLR3_UINT64_LIT(0x0000000000092580) };
-+static ANTLR3_BITSET_LIST FOLLOW_30_in_playlist44 = { FOLLOW_30_in_playlist44_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_playlist46 */
-+static ANTLR3_BITWORD FOLLOW_expression_in_playlist46_bits[] = { ANTLR3_UINT64_LIT(0x0000000080000000) };
-+static ANTLR3_BITSET_LIST FOLLOW_expression_in_playlist46 = { FOLLOW_expression_in_playlist46_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_31_in_playlist48 */
-+static ANTLR3_BITWORD FOLLOW_31_in_playlist48_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000000) };
-+static ANTLR3_BITSET_LIST FOLLOW_31_in_playlist48 = { FOLLOW_31_in_playlist48_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_playlist50 */
-+static ANTLR3_BITWORD FOLLOW_EOF_in_playlist50_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_EOF_in_playlist50 = { FOLLOW_EOF_in_playlist50_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expression62 */
-+static ANTLR3_BITWORD FOLLOW_aexpr_in_expression62_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000022) };
-+static ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expression62 = { FOLLOW_aexpr_in_expression62_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_OR_in_expression65 */
-+static ANTLR3_BITWORD FOLLOW_OR_in_expression65_bits[] = { ANTLR3_UINT64_LIT(0x0000000000092580) };
-+static ANTLR3_BITSET_LIST FOLLOW_OR_in_expression65 = { FOLLOW_OR_in_expression65_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_aexpr_in_expression68 */
-+static ANTLR3_BITWORD FOLLOW_aexpr_in_expression68_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000022) };
-+static ANTLR3_BITSET_LIST FOLLOW_aexpr_in_expression68 = { FOLLOW_aexpr_in_expression68_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_nexpr_in_aexpr83 */
-+static ANTLR3_BITWORD FOLLOW_nexpr_in_aexpr83_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000042) };
-+static ANTLR3_BITSET_LIST FOLLOW_nexpr_in_aexpr83 = { FOLLOW_nexpr_in_aexpr83_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AND_in_aexpr86 */
-+static ANTLR3_BITWORD FOLLOW_AND_in_aexpr86_bits[] = { ANTLR3_UINT64_LIT(0x0000000000092580) };
-+static ANTLR3_BITSET_LIST FOLLOW_AND_in_aexpr86 = { FOLLOW_AND_in_aexpr86_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_nexpr_in_aexpr89 */
-+static ANTLR3_BITWORD FOLLOW_nexpr_in_aexpr89_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000042) };
-+static ANTLR3_BITSET_LIST FOLLOW_nexpr_in_aexpr89 = { FOLLOW_nexpr_in_aexpr89_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_NOT_in_nexpr104 */
-+static ANTLR3_BITWORD FOLLOW_NOT_in_nexpr104_bits[] = { ANTLR3_UINT64_LIT(0x0000000000092580) };
-+static ANTLR3_BITSET_LIST FOLLOW_NOT_in_nexpr104 = { FOLLOW_NOT_in_nexpr104_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_nexpr107 */
-+static ANTLR3_BITWORD FOLLOW_crit_in_nexpr107_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_crit_in_nexpr107 = { FOLLOW_crit_in_nexpr107_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_crit_in_nexpr114 */
-+static ANTLR3_BITWORD FOLLOW_crit_in_nexpr114_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_crit_in_nexpr114 = { FOLLOW_crit_in_nexpr114_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAR_in_crit127 */
-+static ANTLR3_BITWORD FOLLOW_LPAR_in_crit127_bits[] = { ANTLR3_UINT64_LIT(0x0000000000092580) };
-+static ANTLR3_BITSET_LIST FOLLOW_LPAR_in_crit127 = { FOLLOW_LPAR_in_crit127_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_expression_in_crit129 */
-+static ANTLR3_BITWORD FOLLOW_expression_in_crit129_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000200) };
-+static ANTLR3_BITSET_LIST FOLLOW_expression_in_crit129 = { FOLLOW_expression_in_crit129_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAR_in_crit131 */
-+static ANTLR3_BITWORD FOLLOW_RPAR_in_crit131_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_RPAR_in_crit131 = { FOLLOW_RPAR_in_crit131_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRTAG_in_crit142 */
-+static ANTLR3_BITWORD FOLLOW_STRTAG_in_crit142_bits[] = { ANTLR3_UINT64_LIT(0x0000000000001800) };
-+static ANTLR3_BITSET_LIST FOLLOW_STRTAG_in_crit142 = { FOLLOW_STRTAG_in_crit142_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_crit144 */
-+static ANTLR3_BITWORD FOLLOW_set_in_crit144_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000010) };
-+static ANTLR3_BITSET_LIST FOLLOW_set_in_crit144 = { FOLLOW_set_in_crit144_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_STR_in_crit150 */
-+static ANTLR3_BITWORD FOLLOW_STR_in_crit150_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_STR_in_crit150 = { FOLLOW_STR_in_crit150_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTTAG_in_crit157 */
-+static ANTLR3_BITWORD FOLLOW_INTTAG_in_crit157_bits[] = { ANTLR3_UINT64_LIT(0x0000000000004000) };
-+static ANTLR3_BITSET_LIST FOLLOW_INTTAG_in_crit157 = { FOLLOW_INTTAG_in_crit157_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTBOOL_in_crit159 */
-+static ANTLR3_BITWORD FOLLOW_INTBOOL_in_crit159_bits[] = { ANTLR3_UINT64_LIT(0x0000000000008000) };
-+static ANTLR3_BITSET_LIST FOLLOW_INTBOOL_in_crit159 = { FOLLOW_INTBOOL_in_crit159_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_crit161 */
-+static ANTLR3_BITWORD FOLLOW_INT_in_crit161_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_INT_in_crit161 = { FOLLOW_INT_in_crit161_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATETAG_in_crit168 */
-+static ANTLR3_BITWORD FOLLOW_DATETAG_in_crit168_bits[] = { ANTLR3_UINT64_LIT(0x0000000000060000) };
-+static ANTLR3_BITSET_LIST FOLLOW_DATETAG_in_crit168 = { FOLLOW_DATETAG_in_crit168_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_crit170 */
-+static ANTLR3_BITWORD FOLLOW_set_in_crit170_bits[] = { ANTLR3_UINT64_LIT(0x0000000000208000) };
-+static ANTLR3_BITSET_LIST FOLLOW_set_in_crit170 = { FOLLOW_set_in_crit170_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_dateval_in_crit176 */
-+static ANTLR3_BITWORD FOLLOW_dateval_in_crit176_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_dateval_in_crit176 = { FOLLOW_dateval_in_crit176_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENUMTAG_in_crit183 */
-+static ANTLR3_BITWORD FOLLOW_ENUMTAG_in_crit183_bits[] = { ANTLR3_UINT64_LIT(0x0000000000001000) };
-+static ANTLR3_BITSET_LIST FOLLOW_ENUMTAG_in_crit183 = { FOLLOW_ENUMTAG_in_crit183_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_IS_in_crit185 */
-+static ANTLR3_BITWORD FOLLOW_IS_in_crit185_bits[] = { ANTLR3_UINT64_LIT(0x0000000000100000) };
-+static ANTLR3_BITSET_LIST FOLLOW_IS_in_crit185 = { FOLLOW_IS_in_crit185_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_ENUMVAL_in_crit187 */
-+static ANTLR3_BITWORD FOLLOW_ENUMVAL_in_crit187_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_ENUMVAL_in_crit187 = { FOLLOW_ENUMVAL_in_crit187_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval200 */
-+static ANTLR3_BITWORD FOLLOW_DATE_in_dateval200_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval200 = { FOLLOW_DATE_in_dateval200_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval207 */
-+static ANTLR3_BITWORD FOLLOW_interval_in_dateval207_bits[] = { ANTLR3_UINT64_LIT(0x0000000000040000) };
-+static ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval207 = { FOLLOW_interval_in_dateval207_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_BEFORE_in_dateval209 */
-+static ANTLR3_BITWORD FOLLOW_BEFORE_in_dateval209_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
-+static ANTLR3_BITSET_LIST FOLLOW_BEFORE_in_dateval209 = { FOLLOW_BEFORE_in_dateval209_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval211 */
-+static ANTLR3_BITWORD FOLLOW_DATE_in_dateval211_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval211 = { FOLLOW_DATE_in_dateval211_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval218 */
-+static ANTLR3_BITWORD FOLLOW_interval_in_dateval218_bits[] = { ANTLR3_UINT64_LIT(0x0000000000020000) };
-+static ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval218 = { FOLLOW_interval_in_dateval218_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AFTER_in_dateval220 */
-+static ANTLR3_BITWORD FOLLOW_AFTER_in_dateval220_bits[] = { ANTLR3_UINT64_LIT(0x0000000000200000) };
-+static ANTLR3_BITSET_LIST FOLLOW_AFTER_in_dateval220 = { FOLLOW_AFTER_in_dateval220_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATE_in_dateval222 */
-+static ANTLR3_BITWORD FOLLOW_DATE_in_dateval222_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_DATE_in_dateval222 = { FOLLOW_DATE_in_dateval222_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_interval_in_dateval229 */
-+static ANTLR3_BITWORD FOLLOW_interval_in_dateval229_bits[] = { ANTLR3_UINT64_LIT(0x0000000000400000) };
-+static ANTLR3_BITSET_LIST FOLLOW_interval_in_dateval229 = { FOLLOW_interval_in_dateval229_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_AGO_in_dateval231 */
-+static ANTLR3_BITWORD FOLLOW_AGO_in_dateval231_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_AGO_in_dateval231 = { FOLLOW_AGO_in_dateval231_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_interval243 */
-+static ANTLR3_BITWORD FOLLOW_INT_in_interval243_bits[] = { ANTLR3_UINT64_LIT(0x0000000000800000) };
-+static ANTLR3_BITSET_LIST FOLLOW_INT_in_interval243 = { FOLLOW_INT_in_interval243_bits, 1 };
-+/** Bitset defining follow set for error recovery in rule state: FOLLOW_DATINTERVAL_in_interval245 */
-+static ANTLR3_BITWORD FOLLOW_DATINTERVAL_in_interval245_bits[] = { ANTLR3_UINT64_LIT(0x0000000000000002) };
-+static ANTLR3_BITSET_LIST FOLLOW_DATINTERVAL_in_interval245 = { FOLLOW_DATINTERVAL_in_interval245_bits, 1 };
-+
-+
-+
-+
-+/* ==============================================
-+ * Parsing rules
-+ */
-+/**
-+ * $ANTLR start playlist
-+ * SMARTPL.g:27:1: playlist : STR '{' expression '}' EOF ;
-+ */
-+static SMARTPLParser_playlist_return
-+playlist(pSMARTPLParser ctx)
-+{
-+ SMARTPLParser_playlist_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN STR1;
-+ pANTLR3_COMMON_TOKEN char_literal2;
-+ pANTLR3_COMMON_TOKEN char_literal4;
-+ pANTLR3_COMMON_TOKEN EOF5;
-+ SMARTPLParser_expression_return expression3;
-+ #undef RETURN_TYPE_expression3
-+ #define RETURN_TYPE_expression3 SMARTPLParser_expression_return
-+
-+ pANTLR3_BASE_TREE STR1_tree;
-+ pANTLR3_BASE_TREE char_literal2_tree;
-+ pANTLR3_BASE_TREE char_literal4_tree;
-+ pANTLR3_BASE_TREE EOF5_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ STR1 = NULL;
-+ char_literal2 = NULL;
-+ char_literal4 = NULL;
-+ EOF5 = NULL;
-+ expression3.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ STR1_tree = NULL;
-+ char_literal2_tree = NULL;
-+ char_literal4_tree = NULL;
-+ EOF5_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ // SMARTPL.g:27:10: ( STR '{' expression '}' EOF )
-+ // SMARTPL.g:27:12: STR '{' expression '}' EOF
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ STR1 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_playlist42);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleplaylistEx;
-+ }
-+
-+ STR1_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STR1));
-+ ADAPTOR->addChild(ADAPTOR, root_0, STR1_tree);
-+
-+ char_literal2 = (pANTLR3_COMMON_TOKEN) MATCHT(30, &FOLLOW_30_in_playlist44);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleplaylistEx;
-+ }
-+
-+ char_literal2_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, char_literal2));
-+ ADAPTOR->addChild(ADAPTOR, root_0, char_literal2_tree);
-+
-+ FOLLOWPUSH(FOLLOW_expression_in_playlist46);
-+ expression3=expression(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleplaylistEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, expression3.tree);
-+ char_literal4 = (pANTLR3_COMMON_TOKEN) MATCHT(31, &FOLLOW_31_in_playlist48);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleplaylistEx;
-+ }
-+
-+ char_literal4_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, char_literal4));
-+ ADAPTOR->addChild(ADAPTOR, root_0, char_literal4_tree);
-+
-+ EOF5 = (pANTLR3_COMMON_TOKEN) MATCHT(EOF, &FOLLOW_EOF_in_playlist50);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleplaylistEx;
-+ }
-+
-+ EOF5_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, EOF5));
-+ ADAPTOR->addChild(ADAPTOR, root_0, EOF5_tree);
-+
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleplaylistEx; /* Prevent compiler warnings */
-+ ruleplaylistEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end playlist */
-+
-+/**
-+ * $ANTLR start expression
-+ * SMARTPL.g:30:1: expression : aexpr ( OR aexpr )* ;
-+ */
-+static SMARTPLParser_expression_return
-+expression(pSMARTPLParser ctx)
-+{
-+ SMARTPLParser_expression_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN OR7;
-+ SMARTPLParser_aexpr_return aexpr6;
-+ #undef RETURN_TYPE_aexpr6
-+ #define RETURN_TYPE_aexpr6 SMARTPLParser_aexpr_return
-+
-+ SMARTPLParser_aexpr_return aexpr8;
-+ #undef RETURN_TYPE_aexpr8
-+ #define RETURN_TYPE_aexpr8 SMARTPLParser_aexpr_return
-+
-+ pANTLR3_BASE_TREE OR7_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ OR7 = NULL;
-+ aexpr6.tree = NULL;
-+
-+ aexpr8.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ OR7_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ // SMARTPL.g:30:12: ( aexpr ( OR aexpr )* )
-+ // SMARTPL.g:30:14: aexpr ( OR aexpr )*
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_aexpr_in_expression62);
-+ aexpr6=aexpr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, aexpr6.tree);
-+
-+ // SMARTPL.g:30:20: ( OR aexpr )*
-+
-+ for (;;)
-+ {
-+ int alt1=2;
-+ switch ( LA(1) )
-+ {
-+ case OR:
-+ {
-+ alt1=1;
-+ }
-+ break;
-+
-+ }
-+
-+ switch (alt1)
-+ {
-+ case 1:
-+ // SMARTPL.g:30:21: OR aexpr
-+ {
-+ OR7 = (pANTLR3_COMMON_TOKEN) MATCHT(OR, &FOLLOW_OR_in_expression65);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ OR7_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, OR7));
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, OR7_tree, root_0));
-+
-+ FOLLOWPUSH(FOLLOW_aexpr_in_expression68);
-+ aexpr8=aexpr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleexpressionEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, aexpr8.tree);
-+
-+ }
-+ break;
-+
-+ default:
-+ goto loop1; /* break out of the loop */
-+ break;
-+ }
-+ }
-+ loop1: ; /* Jump out to here if this rule does not match */
-+
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleexpressionEx; /* Prevent compiler warnings */
-+ ruleexpressionEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end expression */
-+
-+/**
-+ * $ANTLR start aexpr
-+ * SMARTPL.g:33:1: aexpr : nexpr ( AND nexpr )* ;
-+ */
-+static SMARTPLParser_aexpr_return
-+aexpr(pSMARTPLParser ctx)
-+{
-+ SMARTPLParser_aexpr_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN AND10;
-+ SMARTPLParser_nexpr_return nexpr9;
-+ #undef RETURN_TYPE_nexpr9
-+ #define RETURN_TYPE_nexpr9 SMARTPLParser_nexpr_return
-+
-+ SMARTPLParser_nexpr_return nexpr11;
-+ #undef RETURN_TYPE_nexpr11
-+ #define RETURN_TYPE_nexpr11 SMARTPLParser_nexpr_return
-+
-+ pANTLR3_BASE_TREE AND10_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ AND10 = NULL;
-+ nexpr9.tree = NULL;
-+
-+ nexpr11.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ AND10_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ // SMARTPL.g:33:8: ( nexpr ( AND nexpr )* )
-+ // SMARTPL.g:33:10: nexpr ( AND nexpr )*
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_nexpr_in_aexpr83);
-+ nexpr9=nexpr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleaexprEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, nexpr9.tree);
-+
-+ // SMARTPL.g:33:16: ( AND nexpr )*
-+
-+ for (;;)
-+ {
-+ int alt2=2;
-+ switch ( LA(1) )
-+ {
-+ case AND:
-+ {
-+ alt2=1;
-+ }
-+ break;
-+
-+ }
-+
-+ switch (alt2)
-+ {
-+ case 1:
-+ // SMARTPL.g:33:17: AND nexpr
-+ {
-+ AND10 = (pANTLR3_COMMON_TOKEN) MATCHT(AND, &FOLLOW_AND_in_aexpr86);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleaexprEx;
-+ }
-+
-+ AND10_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, AND10));
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, AND10_tree, root_0));
-+
-+ FOLLOWPUSH(FOLLOW_nexpr_in_aexpr89);
-+ nexpr11=nexpr(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleaexprEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, nexpr11.tree);
-+
-+ }
-+ break;
-+
-+ default:
-+ goto loop2; /* break out of the loop */
-+ break;
-+ }
-+ }
-+ loop2: ; /* Jump out to here if this rule does not match */
-+
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleaexprEx; /* Prevent compiler warnings */
-+ ruleaexprEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end aexpr */
-+
-+/**
-+ * $ANTLR start nexpr
-+ * SMARTPL.g:36:1: nexpr : ( NOT crit | crit );
-+ */
-+static SMARTPLParser_nexpr_return
-+nexpr(pSMARTPLParser ctx)
-+{
-+ SMARTPLParser_nexpr_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN NOT12;
-+ SMARTPLParser_crit_return crit13;
-+ #undef RETURN_TYPE_crit13
-+ #define RETURN_TYPE_crit13 SMARTPLParser_crit_return
-+
-+ SMARTPLParser_crit_return crit14;
-+ #undef RETURN_TYPE_crit14
-+ #define RETURN_TYPE_crit14 SMARTPLParser_crit_return
-+
-+ pANTLR3_BASE_TREE NOT12_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ NOT12 = NULL;
-+ crit13.tree = NULL;
-+
-+ crit14.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ NOT12_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ {
-+ // SMARTPL.g:36:8: ( NOT crit | crit )
-+
-+ ANTLR3_UINT32 alt3;
-+
-+ alt3=2;
-+
-+ switch ( LA(1) )
-+ {
-+ case NOT:
-+ {
-+ alt3=1;
-+ }
-+ break;
-+ case LPAR:
-+ case STRTAG:
-+ case INTTAG:
-+ case DATETAG:
-+ case ENUMTAG:
-+ {
-+ alt3=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 3;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto rulenexprEx;
-+ }
-+
-+ switch (alt3)
-+ {
-+ case 1:
-+ // SMARTPL.g:36:10: NOT crit
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ NOT12 = (pANTLR3_COMMON_TOKEN) MATCHT(NOT, &FOLLOW_NOT_in_nexpr104);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulenexprEx;
-+ }
-+
-+ NOT12_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, NOT12));
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, NOT12_tree, root_0));
-+
-+ FOLLOWPUSH(FOLLOW_crit_in_nexpr107);
-+ crit13=crit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulenexprEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, crit13.tree);
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:37:6: crit
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_crit_in_nexpr114);
-+ crit14=crit(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulenexprEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, crit14.tree);
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto rulenexprEx; /* Prevent compiler warnings */
-+ rulenexprEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end nexpr */
-+
-+/**
-+ * $ANTLR start crit
-+ * SMARTPL.g:40:1: crit : ( LPAR expression RPAR -> expression | STRTAG ( INCLUDES | IS ) STR | INTTAG INTBOOL INT | DATETAG ( AFTER | BEFORE ) dateval | ENUMTAG IS ENUMVAL );
-+ */
-+static SMARTPLParser_crit_return
-+crit(pSMARTPLParser ctx)
-+{
-+ SMARTPLParser_crit_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN LPAR15;
-+ pANTLR3_COMMON_TOKEN RPAR17;
-+ pANTLR3_COMMON_TOKEN STRTAG18;
-+ pANTLR3_COMMON_TOKEN set19;
-+ pANTLR3_COMMON_TOKEN STR20;
-+ pANTLR3_COMMON_TOKEN INTTAG21;
-+ pANTLR3_COMMON_TOKEN INTBOOL22;
-+ pANTLR3_COMMON_TOKEN INT23;
-+ pANTLR3_COMMON_TOKEN DATETAG24;
-+ pANTLR3_COMMON_TOKEN set25;
-+ pANTLR3_COMMON_TOKEN ENUMTAG27;
-+ pANTLR3_COMMON_TOKEN IS28;
-+ pANTLR3_COMMON_TOKEN ENUMVAL29;
-+ SMARTPLParser_expression_return expression16;
-+ #undef RETURN_TYPE_expression16
-+ #define RETURN_TYPE_expression16 SMARTPLParser_expression_return
-+
-+ SMARTPLParser_dateval_return dateval26;
-+ #undef RETURN_TYPE_dateval26
-+ #define RETURN_TYPE_dateval26 SMARTPLParser_dateval_return
-+
-+ pANTLR3_BASE_TREE LPAR15_tree;
-+ pANTLR3_BASE_TREE RPAR17_tree;
-+ pANTLR3_BASE_TREE STRTAG18_tree;
-+ pANTLR3_BASE_TREE set19_tree;
-+ pANTLR3_BASE_TREE STR20_tree;
-+ pANTLR3_BASE_TREE INTTAG21_tree;
-+ pANTLR3_BASE_TREE INTBOOL22_tree;
-+ pANTLR3_BASE_TREE INT23_tree;
-+ pANTLR3_BASE_TREE DATETAG24_tree;
-+ pANTLR3_BASE_TREE set25_tree;
-+ pANTLR3_BASE_TREE ENUMTAG27_tree;
-+ pANTLR3_BASE_TREE IS28_tree;
-+ pANTLR3_BASE_TREE ENUMVAL29_tree;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_RPAR;
-+ pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LPAR;
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_expression;
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ LPAR15 = NULL;
-+ RPAR17 = NULL;
-+ STRTAG18 = NULL;
-+ set19 = NULL;
-+ STR20 = NULL;
-+ INTTAG21 = NULL;
-+ INTBOOL22 = NULL;
-+ INT23 = NULL;
-+ DATETAG24 = NULL;
-+ set25 = NULL;
-+ ENUMTAG27 = NULL;
-+ IS28 = NULL;
-+ ENUMVAL29 = NULL;
-+ expression16.tree = NULL;
-+
-+ dateval26.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ LPAR15_tree = NULL;
-+ RPAR17_tree = NULL;
-+ STRTAG18_tree = NULL;
-+ set19_tree = NULL;
-+ STR20_tree = NULL;
-+ INTTAG21_tree = NULL;
-+ INTBOOL22_tree = NULL;
-+ INT23_tree = NULL;
-+ DATETAG24_tree = NULL;
-+ set25_tree = NULL;
-+ ENUMTAG27_tree = NULL;
-+ IS28_tree = NULL;
-+ ENUMVAL29_tree = NULL;
-+
-+ stream_RPAR = NULL;
-+ #define CREATE_stream_RPAR if (stream_RPAR == NULL) {stream_RPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token RPAR"); }
-+ stream_LPAR = NULL;
-+ #define CREATE_stream_LPAR if (stream_LPAR == NULL) {stream_LPAR = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LPAR"); }
-+ stream_expression = NULL;
-+ #define CREATE_stream_expression if (stream_expression == NULL) {stream_expression = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule expression"); }
-+
-+ retval.tree = NULL;
-+ {
-+ {
-+ // SMARTPL.g:40:7: ( LPAR expression RPAR -> expression | STRTAG ( INCLUDES | IS ) STR | INTTAG INTBOOL INT | DATETAG ( AFTER | BEFORE ) dateval | ENUMTAG IS ENUMVAL )
-+
-+ ANTLR3_UINT32 alt4;
-+
-+ alt4=5;
-+
-+ switch ( LA(1) )
-+ {
-+ case LPAR:
-+ {
-+ alt4=1;
-+ }
-+ break;
-+ case STRTAG:
-+ {
-+ alt4=2;
-+ }
-+ break;
-+ case INTTAG:
-+ {
-+ alt4=3;
-+ }
-+ break;
-+ case DATETAG:
-+ {
-+ alt4=4;
-+ }
-+ break;
-+ case ENUMTAG:
-+ {
-+ alt4=5;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 4;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto rulecritEx;
-+ }
-+
-+ switch (alt4)
-+ {
-+ case 1:
-+ // SMARTPL.g:40:9: LPAR expression RPAR
-+ {
-+ LPAR15 = (pANTLR3_COMMON_TOKEN) MATCHT(LPAR, &FOLLOW_LPAR_in_crit127);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ CREATE_stream_LPAR; stream_LPAR->add(stream_LPAR, LPAR15, NULL);
-+
-+ FOLLOWPUSH(FOLLOW_expression_in_crit129);
-+ expression16=expression(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ CREATE_stream_expression; stream_expression->add(stream_expression, expression16.tree, NULL);
-+ RPAR17 = (pANTLR3_COMMON_TOKEN) MATCHT(RPAR, &FOLLOW_RPAR_in_crit131);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ CREATE_stream_RPAR; stream_RPAR->add(stream_RPAR, RPAR17, NULL);
-+
-+
-+
-+ /* AST REWRITE
-+ * elements : expression
-+ * token labels :
-+ * rule labels : retval
-+ * token list labels :
-+ * rule list labels :
-+ */
-+ {
-+ pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
-+
-+ stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
-+
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+ retval.tree = root_0;
-+ // 40:30: -> expression
-+ {
-+ ADAPTOR->addChild(ADAPTOR, root_0, stream_expression == NULL ? NULL : stream_expression->nextTree(stream_expression));
-+
-+ }
-+
-+ retval.tree = root_0; // set result root
-+ if (stream_retval != NULL) stream_retval->free(stream_retval);
-+
-+
-+ }
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:41:6: STRTAG ( INCLUDES | IS ) STR
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ STRTAG18 = (pANTLR3_COMMON_TOKEN) MATCHT(STRTAG, &FOLLOW_STRTAG_in_crit142);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ STRTAG18_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STRTAG18));
-+ ADAPTOR->addChild(ADAPTOR, root_0, STRTAG18_tree);
-+
-+ set19=(pANTLR3_COMMON_TOKEN)LT(1);
-+ if ( ((LA(1) >= INCLUDES) && (LA(1) <= IS)) )
-+ {
-+ CONSUME();
-+ ADAPTOR->addChild(ADAPTOR, root_0, (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set19)));
-+ PERRORRECOVERY=ANTLR3_FALSE;
-+ }
-+ else
-+ {
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+ EXCEPTION->expectingSet = &FOLLOW_set_in_crit144;
-+ RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_crit144); goto rulecritEx;
-+ }
-+
-+ STR20 = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_crit150);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ STR20_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STR20));
-+ ADAPTOR->addChild(ADAPTOR, root_0, STR20_tree);
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // SMARTPL.g:42:6: INTTAG INTBOOL INT
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ INTTAG21 = (pANTLR3_COMMON_TOKEN) MATCHT(INTTAG, &FOLLOW_INTTAG_in_crit157);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ INTTAG21_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, INTTAG21));
-+ ADAPTOR->addChild(ADAPTOR, root_0, INTTAG21_tree);
-+
-+ INTBOOL22 = (pANTLR3_COMMON_TOKEN) MATCHT(INTBOOL, &FOLLOW_INTBOOL_in_crit159);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ INTBOOL22_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, INTBOOL22));
-+ ADAPTOR->addChild(ADAPTOR, root_0, INTBOOL22_tree);
-+
-+ INT23 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_crit161);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ INT23_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, INT23));
-+ ADAPTOR->addChild(ADAPTOR, root_0, INT23_tree);
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // SMARTPL.g:43:6: DATETAG ( AFTER | BEFORE ) dateval
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ DATETAG24 = (pANTLR3_COMMON_TOKEN) MATCHT(DATETAG, &FOLLOW_DATETAG_in_crit168);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ DATETAG24_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATETAG24));
-+ ADAPTOR->addChild(ADAPTOR, root_0, DATETAG24_tree);
-+
-+ set25=(pANTLR3_COMMON_TOKEN)LT(1);
-+ if ( ((LA(1) >= AFTER) && (LA(1) <= BEFORE)) )
-+ {
-+ CONSUME();
-+ ADAPTOR->addChild(ADAPTOR, root_0, (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set25)));
-+ PERRORRECOVERY=ANTLR3_FALSE;
-+ }
-+ else
-+ {
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_MISMATCHED_SET_EXCEPTION;
-+ EXCEPTION->name = (void *)ANTLR3_MISMATCHED_SET_NAME;
-+ EXCEPTION->expectingSet = &FOLLOW_set_in_crit170;
-+ RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_crit170); goto rulecritEx;
-+ }
-+
-+ FOLLOWPUSH(FOLLOW_dateval_in_crit176);
-+ dateval26=dateval(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, dateval26.tree);
-+
-+ }
-+ break;
-+ case 5:
-+ // SMARTPL.g:44:6: ENUMTAG IS ENUMVAL
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ ENUMTAG27 = (pANTLR3_COMMON_TOKEN) MATCHT(ENUMTAG, &FOLLOW_ENUMTAG_in_crit183);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ ENUMTAG27_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, ENUMTAG27));
-+ ADAPTOR->addChild(ADAPTOR, root_0, ENUMTAG27_tree);
-+
-+ IS28 = (pANTLR3_COMMON_TOKEN) MATCHT(IS, &FOLLOW_IS_in_crit185);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ IS28_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, IS28));
-+ ADAPTOR->addChild(ADAPTOR, root_0, IS28_tree);
-+
-+ ENUMVAL29 = (pANTLR3_COMMON_TOKEN) MATCHT(ENUMVAL, &FOLLOW_ENUMVAL_in_crit187);
-+ if (HASEXCEPTION())
-+ {
-+ goto rulecritEx;
-+ }
-+
-+ ENUMVAL29_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, ENUMVAL29));
-+ ADAPTOR->addChild(ADAPTOR, root_0, ENUMVAL29_tree);
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto rulecritEx; /* Prevent compiler warnings */
-+ rulecritEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+ if (stream_RPAR != NULL) stream_RPAR->free(stream_RPAR);
-+ if (stream_LPAR != NULL) stream_LPAR->free(stream_LPAR);
-+ if (stream_expression != NULL) stream_expression->free(stream_expression);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end crit */
-+
-+/**
-+ * $ANTLR start dateval
-+ * SMARTPL.g:47:1: dateval : ( DATE | interval BEFORE DATE | interval AFTER DATE | interval AGO );
-+ */
-+static SMARTPLParser_dateval_return
-+dateval(pSMARTPLParser ctx)
-+{
-+ SMARTPLParser_dateval_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN DATE30;
-+ pANTLR3_COMMON_TOKEN BEFORE32;
-+ pANTLR3_COMMON_TOKEN DATE33;
-+ pANTLR3_COMMON_TOKEN AFTER35;
-+ pANTLR3_COMMON_TOKEN DATE36;
-+ pANTLR3_COMMON_TOKEN AGO38;
-+ SMARTPLParser_interval_return interval31;
-+ #undef RETURN_TYPE_interval31
-+ #define RETURN_TYPE_interval31 SMARTPLParser_interval_return
-+
-+ SMARTPLParser_interval_return interval34;
-+ #undef RETURN_TYPE_interval34
-+ #define RETURN_TYPE_interval34 SMARTPLParser_interval_return
-+
-+ SMARTPLParser_interval_return interval37;
-+ #undef RETURN_TYPE_interval37
-+ #define RETURN_TYPE_interval37 SMARTPLParser_interval_return
-+
-+ pANTLR3_BASE_TREE DATE30_tree;
-+ pANTLR3_BASE_TREE BEFORE32_tree;
-+ pANTLR3_BASE_TREE DATE33_tree;
-+ pANTLR3_BASE_TREE AFTER35_tree;
-+ pANTLR3_BASE_TREE DATE36_tree;
-+ pANTLR3_BASE_TREE AGO38_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ DATE30 = NULL;
-+ BEFORE32 = NULL;
-+ DATE33 = NULL;
-+ AFTER35 = NULL;
-+ DATE36 = NULL;
-+ AGO38 = NULL;
-+ interval31.tree = NULL;
-+
-+ interval34.tree = NULL;
-+
-+ interval37.tree = NULL;
-+
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ DATE30_tree = NULL;
-+ BEFORE32_tree = NULL;
-+ DATE33_tree = NULL;
-+ AFTER35_tree = NULL;
-+ DATE36_tree = NULL;
-+ AGO38_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ {
-+ // SMARTPL.g:47:10: ( DATE | interval BEFORE DATE | interval AFTER DATE | interval AGO )
-+
-+ ANTLR3_UINT32 alt5;
-+
-+ alt5=4;
-+
-+ switch ( LA(1) )
-+ {
-+ case DATE:
-+ {
-+ alt5=1;
-+ }
-+ break;
-+ case INT:
-+ {
-+ switch ( LA(2) )
-+ {
-+ case DATINTERVAL:
-+ {
-+ switch ( LA(3) )
-+ {
-+ case AGO:
-+ {
-+ alt5=4;
-+ }
-+ break;
-+ case AFTER:
-+ {
-+ alt5=3;
-+ }
-+ break;
-+ case BEFORE:
-+ {
-+ alt5=2;
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 5;
-+ EXCEPTION->state = 3;
-+
-+
-+ goto ruledatevalEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 5;
-+ EXCEPTION->state = 2;
-+
-+
-+ goto ruledatevalEx;
-+ }
-+
-+ }
-+ break;
-+
-+ default:
-+ CONSTRUCTEX();
-+ EXCEPTION->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
-+ EXCEPTION->message = (void *)"";
-+ EXCEPTION->decisionNum = 5;
-+ EXCEPTION->state = 0;
-+
-+
-+ goto ruledatevalEx;
-+ }
-+
-+ switch (alt5)
-+ {
-+ case 1:
-+ // SMARTPL.g:47:12: DATE
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ DATE30 = (pANTLR3_COMMON_TOKEN) MATCHT(DATE, &FOLLOW_DATE_in_dateval200);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ DATE30_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATE30));
-+ ADAPTOR->addChild(ADAPTOR, root_0, DATE30_tree);
-+
-+
-+ }
-+ break;
-+ case 2:
-+ // SMARTPL.g:48:6: interval BEFORE DATE
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_interval_in_dateval207);
-+ interval31=interval(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, interval31.tree);
-+ BEFORE32 = (pANTLR3_COMMON_TOKEN) MATCHT(BEFORE, &FOLLOW_BEFORE_in_dateval209);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ BEFORE32_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, BEFORE32));
-+ ADAPTOR->addChild(ADAPTOR, root_0, BEFORE32_tree);
-+
-+ DATE33 = (pANTLR3_COMMON_TOKEN) MATCHT(DATE, &FOLLOW_DATE_in_dateval211);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ DATE33_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATE33));
-+ ADAPTOR->addChild(ADAPTOR, root_0, DATE33_tree);
-+
-+
-+ }
-+ break;
-+ case 3:
-+ // SMARTPL.g:49:6: interval AFTER DATE
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_interval_in_dateval218);
-+ interval34=interval(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, interval34.tree);
-+ AFTER35 = (pANTLR3_COMMON_TOKEN) MATCHT(AFTER, &FOLLOW_AFTER_in_dateval220);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ AFTER35_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, AFTER35));
-+ ADAPTOR->addChild(ADAPTOR, root_0, AFTER35_tree);
-+
-+ DATE36 = (pANTLR3_COMMON_TOKEN) MATCHT(DATE, &FOLLOW_DATE_in_dateval222);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ DATE36_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATE36));
-+ ADAPTOR->addChild(ADAPTOR, root_0, DATE36_tree);
-+
-+
-+ }
-+ break;
-+ case 4:
-+ // SMARTPL.g:50:6: interval AGO
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ FOLLOWPUSH(FOLLOW_interval_in_dateval229);
-+ interval37=interval(ctx);
-+
-+ FOLLOWPOP();
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ ADAPTOR->addChild(ADAPTOR, root_0, interval37.tree);
-+ AGO38 = (pANTLR3_COMMON_TOKEN) MATCHT(AGO, &FOLLOW_AGO_in_dateval231);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruledatevalEx;
-+ }
-+
-+ AGO38_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, AGO38));
-+ ADAPTOR->addChild(ADAPTOR, root_0, AGO38_tree);
-+
-+
-+ }
-+ break;
-+
-+ }
-+ }
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruledatevalEx; /* Prevent compiler warnings */
-+ ruledatevalEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end dateval */
-+
-+/**
-+ * $ANTLR start interval
-+ * SMARTPL.g:53:1: interval : INT DATINTERVAL ;
-+ */
-+static SMARTPLParser_interval_return
-+interval(pSMARTPLParser ctx)
-+{
-+ SMARTPLParser_interval_return retval;
-+
-+ pANTLR3_BASE_TREE root_0;
-+
-+ pANTLR3_COMMON_TOKEN INT39;
-+ pANTLR3_COMMON_TOKEN DATINTERVAL40;
-+
-+ pANTLR3_BASE_TREE INT39_tree;
-+ pANTLR3_BASE_TREE DATINTERVAL40_tree;
-+
-+ /* Initialize rule variables
-+ */
-+
-+
-+ root_0 = NULL;
-+
-+ INT39 = NULL;
-+ DATINTERVAL40 = NULL;
-+ retval.start = LT(1); retval.stop = retval.start;
-+
-+ INT39_tree = NULL;
-+ DATINTERVAL40_tree = NULL;
-+
-+
-+ retval.tree = NULL;
-+ {
-+ // SMARTPL.g:53:10: ( INT DATINTERVAL )
-+ // SMARTPL.g:53:12: INT DATINTERVAL
-+ {
-+ root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
-+
-+ INT39 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_interval243);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintervalEx;
-+ }
-+
-+ INT39_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, INT39));
-+ ADAPTOR->addChild(ADAPTOR, root_0, INT39_tree);
-+
-+ DATINTERVAL40 = (pANTLR3_COMMON_TOKEN) MATCHT(DATINTERVAL, &FOLLOW_DATINTERVAL_in_interval245);
-+ if (HASEXCEPTION())
-+ {
-+ goto ruleintervalEx;
-+ }
-+
-+ DATINTERVAL40_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DATINTERVAL40));
-+ ADAPTOR->addChild(ADAPTOR, root_0, DATINTERVAL40_tree);
-+
-+
-+ }
-+
-+ }
-+
-+
-+ // This is where rules clean up and exit
-+ //
-+ goto ruleintervalEx; /* Prevent compiler warnings */
-+ ruleintervalEx: ;
-+ retval.stop = LT(-1);
-+
-+ retval.stop = LT(-1);
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
-+ ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
-+
-+ if (HASEXCEPTION())
-+ {
-+ PREPORTERROR();
-+ PRECOVER();
-+ retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
-+ }
-+
-+
-+ return retval;
-+}
-+/* $ANTLR end interval */
-+/* End of parsing rules
-+ * ==============================================
-+ */
-+
-+/* ==============================================
-+ * Syntactic predicates
-+ */
-+/* End of syntactic predicates
-+ * ==============================================
-+ */
-+
-+
-+
-+
-+
-+
-+/* End of code
-+ * =============================================================================
-+ */
-diff --git a/src/pregen/SMARTPLParser.h b/src/pregen/SMARTPLParser.h
-new file mode 100644
-index 0000000..38ef500
---- /dev/null
-+++ b/src/pregen/SMARTPLParser.h
-@@ -0,0 +1,285 @@
-+/** \file
-+ * This C header file was generated by $ANTLR version 3.2 debian-7ubuntu3
-+ *
-+ * - From the grammar source file : SMARTPL.g
-+ * - On : 2016-01-01 12:23:40
-+ * - for the parser : SMARTPLParserParser *
-+ * Editing it, at least manually, is not wise.
-+ *
-+ * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
-+ *
-+ *
-+ * The parser SMARTPLParser has the callable functions (rules) shown below,
-+ * which will invoke the code for the associated rule in the source grammar
-+ * assuming that the input stream is pointing to a token/text stream that could begin
-+ * this rule.
-+ *
-+ * For instance if you call the first (topmost) rule in a parser grammar, you will
-+ * get the results of a full parse, but calling a rule half way through the grammar will
-+ * allow you to pass part of a full token stream to the parser, such as for syntax checking
-+ * in editors and so on.
-+ *
-+ * The parser entry points are called indirectly (by function pointer to function) via
-+ * a parser context typedef pSMARTPLParser, which is returned from a call to SMARTPLParserNew().
-+ *
-+ * The methods in pSMARTPLParser are as follows:
-+ *
-+ * - SMARTPLParser_playlist_return pSMARTPLParser->playlist(pSMARTPLParser)
-+ * - SMARTPLParser_expression_return pSMARTPLParser->expression(pSMARTPLParser)
-+ * - SMARTPLParser_aexpr_return pSMARTPLParser->aexpr(pSMARTPLParser)
-+ * - SMARTPLParser_nexpr_return pSMARTPLParser->nexpr(pSMARTPLParser)
-+ * - SMARTPLParser_crit_return pSMARTPLParser->crit(pSMARTPLParser)
-+ * - SMARTPLParser_dateval_return pSMARTPLParser->dateval(pSMARTPLParser)
-+ * - SMARTPLParser_interval_return pSMARTPLParser->interval(pSMARTPLParser)
-+ *
-+ * The return type for any particular rule is of course determined by the source
-+ * grammar file.
-+ */
-+// [The "BSD licence"]
-+// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
-+// http://www.temporal-wave.com
-+// http://www.linkedin.com/in/jimidle
-+//
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions
-+// are met:
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+// 3. 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 _SMARTPLParser_H
-+#define _SMARTPLParser_H
-+/* =============================================================================
-+ * Standard antlr3 C runtime definitions
-+ */
-+#include <antlr3.h>
-+
-+/* End of standard antlr 3 runtime definitions
-+ * =============================================================================
-+ */
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+// Forward declare the context typedef so that we can use it before it is
-+// properly defined. Delegators and delegates (from import statements) are
-+// interdependent and their context structures contain pointers to each other
-+// C only allows such things to be declared if you pre-declare the typedef.
-+//
-+typedef struct SMARTPLParser_Ctx_struct SMARTPLParser, * pSMARTPLParser;
-+
-+
-+
-+#ifdef ANTLR3_WINDOWS
-+// Disable: Unreferenced parameter, - Rules with parameters that are not used
-+// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
-+// initialized but unused variable - tree rewrite variables declared but not needed
-+// Unreferenced local variable - lexer rule declares but does not always use _type
-+// potentially unitialized variable used - retval always returned from a rule
-+// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
-+//
-+// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
-+// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
-+// usually generated when a parser rule is given a parameter that it does not use. Mostly though
-+// this is a matter of orthogonality hence I disable that one.
-+//
-+#pragma warning( disable : 4100 )
-+#pragma warning( disable : 4101 )
-+#pragma warning( disable : 4127 )
-+#pragma warning( disable : 4189 )
-+#pragma warning( disable : 4505 )
-+#pragma warning( disable : 4701 )
-+#endif
-+typedef struct SMARTPLParser_playlist_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ SMARTPLParser_playlist_return;
-+
-+typedef struct SMARTPLParser_expression_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ SMARTPLParser_expression_return;
-+
-+typedef struct SMARTPLParser_aexpr_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ SMARTPLParser_aexpr_return;
-+
-+typedef struct SMARTPLParser_nexpr_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ SMARTPLParser_nexpr_return;
-+
-+typedef struct SMARTPLParser_crit_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ SMARTPLParser_crit_return;
-+
-+typedef struct SMARTPLParser_dateval_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ SMARTPLParser_dateval_return;
-+
-+typedef struct SMARTPLParser_interval_return_struct
-+{
-+ /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
-+ */
-+ pANTLR3_COMMON_TOKEN start;
-+ pANTLR3_COMMON_TOKEN stop;
-+ pANTLR3_BASE_TREE tree;
-+
-+}
-+ SMARTPLParser_interval_return;
-+
-+
-+
-+/** Context tracking structure for SMARTPLParser
-+ */
-+struct SMARTPLParser_Ctx_struct
-+{
-+ /** Built in ANTLR3 context tracker contains all the generic elements
-+ * required for context tracking.
-+ */
-+ pANTLR3_PARSER pParser;
-+
-+
-+ SMARTPLParser_playlist_return (*playlist) (struct SMARTPLParser_Ctx_struct * ctx);
-+ SMARTPLParser_expression_return (*expression) (struct SMARTPLParser_Ctx_struct * ctx);
-+ SMARTPLParser_aexpr_return (*aexpr) (struct SMARTPLParser_Ctx_struct * ctx);
-+ SMARTPLParser_nexpr_return (*nexpr) (struct SMARTPLParser_Ctx_struct * ctx);
-+ SMARTPLParser_crit_return (*crit) (struct SMARTPLParser_Ctx_struct * ctx);
-+ SMARTPLParser_dateval_return (*dateval) (struct SMARTPLParser_Ctx_struct * ctx);
-+ SMARTPLParser_interval_return (*interval) (struct SMARTPLParser_Ctx_struct * ctx);
-+ // Delegated rules
-+ const char * (*getGrammarFileName)();
-+ void (*free) (struct SMARTPLParser_Ctx_struct * ctx);
-+ /* @headerFile.members() */
-+ pANTLR3_BASE_TREE_ADAPTOR adaptor;
-+ pANTLR3_VECTOR_FACTORY vectors;
-+ /* End @headerFile.members() */
-+};
-+
-+// Function protoypes for the constructor functions that external translation units
-+// such as delegators and delegates may wish to call.
-+//
-+ANTLR3_API pSMARTPLParser SMARTPLParserNew (pANTLR3_COMMON_TOKEN_STREAM instream);
-+ANTLR3_API pSMARTPLParser SMARTPLParserNewSSD (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
-+
-+/** Symbolic definitions of all the tokens that the parser will work with.
-+ * \{
-+ *
-+ * Antlr will define EOF, but we can't use that as it it is too common in
-+ * in C header files and that would be confusing. There is no way to filter this out at the moment
-+ * so we just undef it here for now. That isn't the value we get back from C recognizers
-+ * anyway. We are looking for ANTLR3_TOKEN_EOF.
-+ */
-+#ifdef EOF
-+#undef EOF
-+#endif
-+#ifdef Tokens
-+#undef Tokens
-+#endif
-+#define INTBOOL 14
-+#define STRTAG 10
-+#define AGO 22
-+#define WHITESPACE 29
-+#define GREATEREQUAL 25
-+#define BEFORE 18
-+#define DATETAG 16
-+#define INT 15
-+#define NOT 7
-+#define AFTER 17
-+#define AND 6
-+#define EOF -1
-+#define INCLUDES 11
-+#define STR 4
-+#define T__30 30
-+#define T__31 31
-+#define GREATER 24
-+#define LPAR 8
-+#define ENUMTAG 19
-+#define IS 12
-+#define ENUMVAL 20
-+#define EQUAL 28
-+#define OR 5
-+#define LESS 26
-+#define RPAR 9
-+#define DATE 21
-+#define LESSEQUAL 27
-+#define DATINTERVAL 23
-+#define INTTAG 13
-+#ifdef EOF
-+#undef EOF
-+#define EOF ANTLR3_TOKEN_EOF
-+#endif
-+
-+#ifndef TOKENSOURCE
-+#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
-+#endif
-+
-+/* End of token definitions for SMARTPLParser
-+ * =============================================================================
-+ */
-+/** \} */
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-+/* END - Note:Keep extra line feed to satisfy UNIX systems */
--- /dev/null
+From 1b8adc11edec48a9b8fcb75b9efdaf618a6744bd Mon Sep 17 00:00:00 2001
+From: ejurgensen <espenjurgensen@gmail.com>
+Date: Fri, 25 Aug 2017 19:27:41 +0200
+Subject: [PATCH] [dmap] Use a wrapper for dmap_find_field() Avoids the need to
+ have definition of dmap_find_field in dmap_common.h that must be kept in sync
+ with the definition that gperf generates.
+
+Also should fix compilation problems when gperf is not present, ref pr #390
+---
+ configure.ac | 21 ---------------------
+ src/dmap_common.c | 6 ++++++
+ src/dmap_common.h | 4 +---
+ src/httpd_daap.c | 2 +-
+ 4 files changed, 8 insertions(+), 25 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9b149be..9819c82 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -32,27 +32,6 @@ to install it.]])],
+ [AC_MSG_ERROR([[GNU gperf required, please install it.]])])
+ ])
+
+-GPERF_TEST="$(echo foo,bar | ${GPERF} -L ANSI-C)"
+-
+-AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([
+- #include <string.h>
+- const char * in_word_set(const char *, size_t);
+- $GPERF_TEST]
+- )],
+- [GPERF_LEN_TYPE=size_t],
+- [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([
+- #include <string.h>
+- const char * in_word_set(const char *, unsigned);
+- $GPERF_TEST]
+- )],
+- [GPERF_LEN_TYPE=unsigned],
+- [AC_MSG_ERROR([** unable to determine gperf len type])]
+- )]
+-)
+-
+-AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type])
+ AC_PATH_PROG([ANTLR], [[antlr3]])
+ AS_IF([[test -z "$ANTLR"]],
+ [AS_IF([[test -f "$srcdir/src/SMARTPLLexer.h"]],
+diff --git a/src/dmap_common.c b/src/dmap_common.c
+index 250a2d1..b2bc362 100644
+--- a/src/dmap_common.c
++++ b/src/dmap_common.c
+@@ -42,6 +42,12 @@ dmap_get_fields_table(int *nfields)
+ return dmap_fields;
+ }
+
++// This wrapper is so callers don't need to include dmap_fields_hash.h
++const struct dmap_field *
++dmap_find_field_wrapper(const char *str, int len)
++{
++ return dmap_find_field(str, len);
++}
+
+ void
+ dmap_add_container(struct evbuffer *evbuf, const char *tag, int len)
+diff --git a/src/dmap_common.h b/src/dmap_common.h
+index 93a2bdc..73f72d0 100644
+--- a/src/dmap_common.h
++++ b/src/dmap_common.h
+@@ -2,7 +2,6 @@
+ #ifndef __DMAP_HELPERS_H__
+ #define __DMAP_HELPERS_H__
+
+-#include "config.h"
+ #include <event2/buffer.h>
+ #include <event2/http.h>
+
+@@ -45,9 +44,8 @@ extern const struct dmap_field_map dfm_dmap_aeSP;
+ const struct dmap_field *
+ dmap_get_fields_table(int *nfields);
+
+-/* From dmap_fields.gperf - keep in sync, don't alter */
+ const struct dmap_field *
+-dmap_find_field (register const char *str, register GPERF_LEN_TYPE len);
++dmap_find_field_wrapper(const char *str, int len);
+
+
+ void
+diff --git a/src/httpd_daap.c b/src/httpd_daap.c
+index aef2fe0..0564275 100644
+--- a/src/httpd_daap.c
++++ b/src/httpd_daap.c
+@@ -738,7 +738,7 @@ parse_meta(struct evhttp_request *req, char *tag, const char *param, const struc
+
+ if (n == i)
+ {
+- meta[i] = dmap_find_field(field, strlen(field));
++ meta[i] = dmap_find_field_wrapper(field, strlen(field));
+
+ if (!meta[i])
+ {
+--
+2.7.4
+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/lame
-PKG_MD5SUM:=84835b313d4a8b68f5349816d33e07ce
+PKG_HASH:=24346b4158e4af3bd9f2e194bb23eb473c75fb7377011523353196b19b9a23ff
PKG_FIXUP:=autoreconf
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/mad \
ftp://ftp.mars.org/pub/mpeg/
-PKG_MD5SUM:=6814b47ceaa99880c754c5195aa1aac1
+PKG_HASH:=5a79c7516ff7560dffc6a14399a389432bc619c905b13d3b73da22fa65acede0
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Simon Peter <probono@puredarwin.org>
include $(TOPDIR)/rules.mk
PKG_NAME:=mpd
-PKG_VERSION:=0.20.8
-PKG_RELEASE:=1
+PKG_VERSION:=0.20.9
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.musicpd.org/download/mpd/0.20/
-PKG_HASH:=7d177f29663c4a0997413401e52bbf11d2bb472773bbcf9294f839c4b8751e35
+PKG_HASH:=cd77a2869e32354b004cc6b34fcb0bee56114caa2d9ed862aaa8071441e34eb7
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-2.0
CATEGORY:=Sound
TITLE:=Music Player Daemon
URL:=http://www.musicpd.org/
- DEPENDS:= +glib2 +libcurl +libpthread +libmpdclient +libstdcpp $(ICONV_DEPENDS) \
- +libflac +BUILD_PATENTED:libmad +libvorbisidec +AUDIO_SUPPORT:alsa-lib \
- +boost +boost-container +libexpat
+ DEPENDS:= +zlib +libcurl +libpthread +libmpdclient +libstdcpp $(ICONV_DEPENDS) \
+ +AUDIO_SUPPORT:alsa-lib +boost +boost-container +libexpat
endef
define Package/mpd/Default/description
define Package/mpd-full
$(call Package/mpd/Default)
TITLE+= (full)
- DEPENDS+= \
- +libaudiofile +BUILD_PATENTED:libfaad2 +libffmpeg +libid3tag \
- +libmms +libogg +libsndfile +libvorbis +libupnp
+ DEPENDS+= +libffmpeg +libid3tag +libmms +libupnp +libshout
PROVIDES:=mpd
VARIANT:=full
endef
define Package/mpd-mini
$(call Package/mpd/Default)
TITLE+= (mini)
+ DEPENDS+= +libflac +libmpg123 +libvorbisidec
PROVIDES:=mpd
VARIANT:=mini
endef
/etc/avahi/services/mpd.service
endef
-TARGET_CFLAGS += -ggdb3
-TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib $(if $(ICONV_FULL),-liconv)
+EXTRA_LDFLAGS += $(if $(ICONV_FULL),-liconv,-Wl,--whole-archive -liconv -Wl,--no-whole-archive)
EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_VERSION_4_8),-std=gnu++11,-std=gnu++14)
CONFIGURE_ARGS += \
--disable-debug \
--disable-documentation \
--disable-test \
- --disable-werror \
- \
+ --disable-aac \
+ --disable-adplug \
--disable-ao \
+ --disable-audiofile \
--disable-bzip2 \
+ --disable-cdio-paranoia \
--disable-fluidsynth \
--disable-wildmidi \
--disable-gme \
--enable-inotify \
--disable-icu \
- --disable-eventfd \
+ --enable-iconv \
--disable-iso9660 \
--disable-jack \
--disable-roar \
--disable-libwrap \
--disable-lsr \
+ --disable-mad \
--disable-mikmod \
--disable-modplug \
--disable-mpc \
- --disable-mpg123 \
+ --disable-nfs \
--disable-openal \
--disable-opus \
--disable-pulse \
--disable-sidplay \
+ --disable-smbclient \
+ --disable-sndfile \
--disable-solaris-output \
--disable-sqlite \
+ --disable-systemd-daemon \
--disable-lame-encoder \
--disable-twolame-encoder \
--disable-shine-encoder \
+ --disable-vorbis-encoder \
--enable-wave-encoder \
--disable-wavpack \
+ --disable-webdav \
--disable-wildmidi \
--disable-zzip \
--with-zeroconf=no \
--disable-soxr \
- \
--enable-curl \
- --enable-flac \
--enable-httpd-output \
- $(call autoconf_bool,CONFIG_BUILD_PATENTED,mad) \
$(call autoconf_bool,CONFIG_AUDIO_SUPPORT,alsa) \
--enable-tcp \
- --enable-un \
+ --disable-sndio \
+ --disable-haiku
-CONFIGURE_VARS += \
- FLAC_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/FLAC" \
- FLAC_LIBS="$(TARGET_LDFLAGS) -lFLAC" \
- $(if $(CONFIG_BUILD_PATENTED),MAD_CFLAGS="$(TARGET_CFLAGS)") \
- $(if $(CONFIG_BUILD_PATENTED),MAD_LIBS="$(TARGET_LDFLAGS) -lmad") \
ifeq ($(BUILD_VARIANT),full)
CONFIGURE_ARGS += \
--enable-upnp \
- $(call autoconf_bool,CONFIG_BUILD_PATENTED,aac) \
- --enable-audiofile \
- --enable-fifo \
--enable-ffmpeg \
+ --disable-flac \
--enable-id3 \
--enable-mms \
- --enable-flac \
+ --disable-mpg123 \
--enable-pipe-output \
--enable-recorder-output \
- --disable-shout \
- --enable-sndfile \
- --enable-vorbis \
- --disable-vorbis-encoder \
- --with-tremor=yes \
-
+ --enable-shout \
+ --disable-vorbis
endif
ifeq ($(BUILD_VARIANT),mini)
# oggflac is not compatible with tremor
CONFIGURE_ARGS += \
--disable-upnp \
- --disable-aac \
- --disable-audiofile \
--disable-fifo \
--disable-ffmpeg \
--disable-id3 \
--disable-mms \
- --disable-pipe-output \
- --disable-recorder-output \
--disable-shout \
- --disable-sndfile \
- --disable-vorbis \
- --disable-vorbis-encoder \
+ --enable-vorbis \
--with-tremor=yes \
-
+ --disable-recorder-output
endif
define Package/mpd/install
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
-@@ -930,6 +930,7 @@ static const char *const ffmpeg_mime_typ
+@@ -931,6 +931,7 @@ static const char *const ffmpeg_mime_typ
"audio/qcelp",
"audio/vorbis",
"audio/vorbis+ogg",
include $(TOPDIR)/rules.mk
PKG_NAME:=mpg123
-PKG_VERSION:=1.22.3
-PKG_RELEASE:=3
+PKG_VERSION:=1.25.6
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://www.mpg123.de/download/
-PKG_MD5SUM:=fca857bc5ad0d2070cd38bd5f0f85f1c
+PKG_SOURCE_URL:=@SF/mpg123
+PKG_HASH:=0f0458c9b87799bc2c9bf9455279cc4d305e245db43b51a39ef27afe025c5a8e
PKG_MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
PKG_FIXUP:=libtool
define Package/mpg123/Default
URL:=http://www.mpg123.de
- DEPENDS:=@BUILD_PATENTED
endef
define Package/libmpg123
DEPENDS:=+libltdl
endef
+define Package/libout123
+ $(call Package/mpg123/Default)
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=Library for continuous playback of audio streams via various platform-specific output methods
+ DEPENDS:=+libltdl
+endef
+
define Package/mpg123
$(call Package/mpg123/Default)
SECTION:=sound
CATEGORY:=Sound
TITLE:=fast console mpeg audio player
- DEPENDS+=+libmpg123 +alsa-lib
+ DEPENDS+=+libmpg123 +alsa-lib +libout123
endef
-define Build/Configure
- $(call Build/Configure/Default, \
- --enable-shared \
- --enable-static \
+TARGET_CFLAGS += -D_GNU_SOURCE
+
+CONFIGURE_ARGS+= \
+ --enable-shared \
+ --enable-static \
+ --with-audio=alsa \
+ --with-default-audio=alsa \
+
+ifeq ($(CONFIG_SOFT_FLOAT),y)
+ CONFIGURE_ARGS+= \
--with-cpu=generic_nofpu \
- --with-audio=alsa \
- --with-default-audio=alsa \
- )
-endef
+ --enable-int-quality=yes
+else
+ CONFIGURE_ARGS+= \
+ --with-cpu=generic_fpu
+endif
+
+ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),)
+ CONFIGURE_ARGS+= \
+ --with-cpu=arm_fpu
+endif
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)/usr/include/mpg123.h \
+ $(PKG_INSTALL_DIR)/usr/include/out123.h \
+ $(PKG_INSTALL_DIR)/usr/include/fmt123.h \
$(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/libmpg123.{la,a,so*} \
+ $(PKG_INSTALL_DIR)/usr/lib/libout123.{la,a,so*} \
$(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/mpg123
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libmpg123.pc \
+ $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libout123.pc \
$(1)/usr/lib/pkgconfig
endef
$(1)/usr/lib/
endef
+define Package/libout123/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/libout123.so* \
+ $(1)/usr/lib/
+endef
+
define Package/mpg123/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) \
endef
$(eval $(call BuildPackage,libmpg123))
+$(eval $(call BuildPackage,libout123))
$(eval $(call BuildPackage,mpg123))
include $(TOPDIR)/rules.mk
PKG_NAME:=pianod
-PKG_VERSION:=174.05
+PKG_VERSION:=174.07
PKG_RELEASE:=1
PKG_SOURCE_URL:=https://github.com/thess/pianod-sc/releases/download/$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=0bae19b0c1e309343bc1b351e521173fe439431542a949dd2bacf4165cce5200
+PKG_HASH:=eee969926c095497893fbd28711258a31efb2d2301da87563dbcd101d8771bff
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
define Package/pianod
SECTION:=sound
CATEGORY:=Sound
- DEPENDS:=+libao +libfaad2 +libmad +libmbedtls +libjson-c +libgcrypt +libpthread
+ DEPENDS:=+libao +libfaad2 +libmpg123 +libmbedtls +libjson-c +libgcrypt +libpthread
TITLE:=Pandora radio daemon
USERID:=pianod=88:pianod=88
URL:=http://deviousfish.com/pianod1/
PKG_SOURCE:=pa_stable_v$(PKG_VERSION).tgz
PKG_SOURCE_URL:=http://www.portaudio.com/archives/
-PKG_MD5SUM:=7f220406902af9dca009668e198cbd23
+PKG_HASH:=8fe024a5f0681e112c6979808f684c3516061cc51d3acc0b726af98fc96c8d57
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE.txt
include $(TOPDIR)/rules.mk
PKG_NAME:=pulseaudio
-PKG_VERSION:=10.0
-PKG_RELEASE:=1
+PKG_VERSION:=11.0
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://freedesktop.org/software/pulseaudio/releases/
-PKG_HASH:=a3186824de9f0d2095ded5d0d0db0405dc73133983c2fbb37291547e37462f57
+PKG_HASH:=072305d4018fc5e75bb1b45ee6b938fa52fc9fd27493bf327415ef89ed14c969
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=GPL LICENSE
define Package/pulseaudio/Default
SECTION:=sound
CATEGORY:=Sound
- DEPENDS:=+libspeexdsp +libsndfile +libltdl +libpthread \
- +librt +alsa-lib +libopenssl +libwrap +libcap $(ICONV_DEPENDS) $(INTL_DEPENDS)
+ DEPENDS:=+libsndfile +libltdl +libpthread +librt +alsa-lib \
+ +libopenssl +libwrap +libcap $(ICONV_DEPENDS) $(INTL_DEPENDS)
TITLE:=Network sound server
MAINTAINER:=Peter Wagner <tripolar@gmx.at>
URL:=http://www.pulseaudio.org
--without-fftw \
--disable-avahi \
--disable-dbus \
- --without-soxr
+ --without-soxr \
+ --without-speex
CONFIGURE_VARS += \
PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig"
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=ce80e005908f41d0e6fde1c4a21e9cb8ee54007b
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=55fe50e21ab5998d745626bd3f98fdbbf2f670b87c26823f5654537a29e7f6c9
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=MIT
PKG_SOURCE_VERSION:=$(PKG_VERSION)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=892a8c8c5302026501c07f2e75c0d51963167143c96875f12578f7e7c9dadc96
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
Mike Brady <mikebrady@eircom.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/toots/shine/releases/download/$(PKG_VERSION)/
-PKG_MD5SUM:=fcad8108335f4b051b303fbdf3fca3fe
+PKG_HASH:=6c5310bda766b116ed2415d639a27e5e11040e068b4b2db6bd733333e620cb4f
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
--without-png \
--without-sndfile \
--with-lame \
- --with-id3tag
+ --with-id3tag \
+ --disable-openmp
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
PKG_NAME:=squeezelite
PKG_VERSION:=1.8.4-743
-PKG_RELEASE=1
+PKG_RELEASE=2
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=LICENSE.txt
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=e37ed17fed9e11a7346cbe9f1e1deeccc051f42e
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=b6ea4a11366330790f5e36bd875b45bb19a9772dfc984c462f436dfca30256c0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_BUILD_DEPENDS:=libflac libvorbis libmad libfaad2 SQUEEZELITE_WMA:libffmpeg-audio-dec
+PKG_BUILD_DEPENDS:=libflac libvorbis libmpg123 libfaad2 SQUEEZELITE_WMA:libffmpeg-audio-dec
include $(INCLUDE_DIR)/package.mk
define Package/squeezelite-full
$(call Package/squeezelite/default)
TITLE+= (full)
- DEPENDS+= +libflac +libvorbis +libmad +libfaad2 \
+ DEPENDS+= +libflac +libvorbis +libmpg123 +libfaad2 \
+SQUEEZELITE_WMA:libffmpeg-audio-dec
VARIANT:=full
endef
local vorbis_lib="libvorbisidec.so.1"
excl_codecs=`checkcodec decode_flac "libFLAC.so.8" flac "$excl_codecs"`
- excl_codecs=`checkcodec decode_mp3 "libmad.so.0" mp3 "$excl_codecs"`
+ excl_codecs=`checkcodec decode_mp3 "libmpg123.so.0" mp3 "$excl_codecs"`
excl_codecs=`checkcodec decode_aac "libfaad.so.2" aac "$excl_codecs"`
[ -e "/usr/lib/$vorbis_lib" ] || vorbis_lib="libvorbisfile.so.3"
--- /dev/null
+--- a/Makefile
++++ b/Makefile
+@@ -15,7 +15,7 @@ OPT_IR = -DIR
+ SOURCES = \
+ main.c slimproto.c buffer.c stream.c utils.c \
+ output.c output_alsa.c output_pa.c output_stdout.c output_pack.c decode.c \
+- flac.c pcm.c mad.c vorbis.c faad.c mpg.c
++ flac.c pcm.c vorbis.c faad.c mpg.c
+
+ SOURCES_DSD = dsd.c dop.c dsd2pcm/dsd2pcm.c
+ SOURCES_FF = ffmpeg.c
+@@ -25,7 +25,7 @@ SOURCES_IR = ir.c
+
+ LINK_LINUX = -ldl
+
+-LINKALL = -lFLAC -lmad -lvorbisfile -lfaad -lmpg123
++LINKALL = -lFLAC -lvorbisfile -lfaad -lmpg123
+ LINKALL_FF = -lavcodec -lavformat -lavutil
+ LINKALL_RESAMPLE = -lsoxr
+ LINKALL_IR = -llirc_client
+--- a/decode.c
++++ b/decode.c
+@@ -145,8 +145,8 @@ void decode_init(log_level level, const
+ if (!strstr(exclude_codecs, "pcm") && (!include_codecs || strstr(include_codecs, "pcm"))) codecs[i++] = register_pcm();
+
+ // try mad then mpg for mp3 unless command line option passed
+- if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) &&
+- (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mad"))) codecs[i] = register_mad();
++// if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) &&
++// (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mad"))) codecs[i] = register_mad();
+ if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) && !codecs[i] &&
+ (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mpg"))) codecs[i] = register_mpg();
+
+--- a/main.c
++++ b/main.c
+@@ -39,7 +39,8 @@
+ #else
+ #define CODECS_DSD ""
+ #endif
+-#define CODECS_MP3 " (mad,mpg for specific mp3 codec)"
++//#define CODECS_MP3 " (mad,mpg for specific mp3 codec)"
++#define CODECS_MP3 " (mpg123 for specific mp3 codec)"
+
+ #define CODECS CODECS_BASE CODECS_FF CODECS_DSD CODECS_MP3
+
+--- a/squeezelite.h
++++ b/squeezelite.h
+@@ -154,7 +154,7 @@
+
+ #if LINUX
+ #define LIBFLAC "libFLAC.so.8"
+-#define LIBMAD "libmad.so.0"
++//#define LIBMAD "libmad.so.0"
+ #define LIBMPG "libmpg123.so.0"
+ #define LIBVORBIS "libvorbisfile.so.3"
+ #define LIBTREMOR "libvorbisidec.so.1"
+@@ -168,7 +168,7 @@
+
+ #if OSX
+ #define LIBFLAC "libFLAC.8.dylib"
+-#define LIBMAD "libmad.0.dylib"
++//#define LIBMAD "libmad.0.dylib"
+ #define LIBMPG "libmpg123.0.dylib"
+ #define LIBVORBIS "libvorbisfile.3.dylib"
+ #define LIBTREMOR "libvorbisidec.1.dylib"
+@@ -181,7 +181,7 @@
+
+ #if WIN
+ #define LIBFLAC "libFLAC.dll"
+-#define LIBMAD "libmad-0.dll"
++//#define LIBMAD "libmad-0.dll"
+ #define LIBMPG "libmpg123-0.dll"
+ #define LIBVORBIS "libvorbisfile.dll"
+ #define LIBTREMOR "libvorbisidec.dll"
+@@ -194,7 +194,7 @@
+
+ #if FREEBSD
+ #define LIBFLAC "libFLAC.so.11"
+-#define LIBMAD "libmad.so.2"
++//#define LIBMAD "libmad.so.2"
+ #define LIBMPG "libmpg123.so.0"
+ #define LIBVORBIS "libvorbisfile.so.6"
+ #define LIBTREMOR "libvorbisidec.so.1"
+++ /dev/null
---- a/Makefile
-+++ b/Makefile
-@@ -15,7 +15,7 @@ OPT_IR = -DIR
- SOURCES = \
- main.c slimproto.c buffer.c stream.c utils.c \
- output.c output_alsa.c output_pa.c output_stdout.c output_pack.c decode.c \
-- flac.c pcm.c mad.c vorbis.c faad.c mpg.c
-+ flac.c pcm.c mad.c vorbis.c faad.c
-
- SOURCES_DSD = dsd.c dop.c dsd2pcm/dsd2pcm.c
- SOURCES_FF = ffmpeg.c
-@@ -25,7 +25,7 @@ SOURCES_IR = ir.c
-
- LINK_LINUX = -ldl
-
--LINKALL = -lFLAC -lmad -lvorbisfile -lfaad -lmpg123
-+LINKALL = -lFLAC -lmad -lvorbisfile -lfaad
- LINKALL_FF = -lavcodec -lavformat -lavutil
- LINKALL_RESAMPLE = -lsoxr
- LINKALL_IR = -llirc_client
---- a/decode.c
-+++ b/decode.c
-@@ -147,8 +147,8 @@ void decode_init(log_level level, const
- // try mad then mpg for mp3 unless command line option passed
- if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) &&
- (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mad"))) codecs[i] = register_mad();
-- if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) && !codecs[i] &&
-- (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mpg"))) codecs[i] = register_mpg();
-+// if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) && !codecs[i] &&
-+// (!include_codecs || strstr(include_codecs, "mp3") || strstr(include_codecs, "mpg"))) codecs[i] = register_mpg();
-
- mutex_create(decode.mutex);
-
---- a/main.c
-+++ b/main.c
-@@ -39,7 +39,8 @@
- #else
- #define CODECS_DSD ""
- #endif
--#define CODECS_MP3 " (mad,mpg for specific mp3 codec)"
-+//#define CODECS_MP3 " (mad,mpg for specific mp3 codec)"
-+#define CODECS_MP3 " (mad for specific mp3 codec)"
-
- #define CODECS CODECS_BASE CODECS_FF CODECS_DSD CODECS_MP3
-
---- a/squeezelite.h
-+++ b/squeezelite.h
-@@ -155,7 +155,7 @@
- #if LINUX
- #define LIBFLAC "libFLAC.so.8"
- #define LIBMAD "libmad.so.0"
--#define LIBMPG "libmpg123.so.0"
-+//#define LIBMPG "libmpg123.so.0"
- #define LIBVORBIS "libvorbisfile.so.3"
- #define LIBTREMOR "libvorbisidec.so.1"
- #define LIBFAAD "libfaad.so.2"
-@@ -169,7 +169,7 @@
- #if OSX
- #define LIBFLAC "libFLAC.8.dylib"
- #define LIBMAD "libmad.0.dylib"
--#define LIBMPG "libmpg123.0.dylib"
-+//#define LIBMPG "libmpg123.0.dylib"
- #define LIBVORBIS "libvorbisfile.3.dylib"
- #define LIBTREMOR "libvorbisidec.1.dylib"
- #define LIBFAAD "libfaad.2.dylib"
-@@ -182,7 +182,7 @@
- #if WIN
- #define LIBFLAC "libFLAC.dll"
- #define LIBMAD "libmad-0.dll"
--#define LIBMPG "libmpg123-0.dll"
-+//#define LIBMPG "libmpg123-0.dll"
- #define LIBVORBIS "libvorbisfile.dll"
- #define LIBTREMOR "libvorbisidec.dll"
- #define LIBFAAD "libfaad2.dll"
-@@ -195,7 +195,7 @@
- #if FREEBSD
- #define LIBFLAC "libFLAC.so.11"
- #define LIBMAD "libmad.so.2"
--#define LIBMPG "libmpg123.so.0"
-+//#define LIBMPG "libmpg123.so.0"
- #define LIBVORBIS "libvorbisfile.so.6"
- #define LIBTREMOR "libvorbisidec.so.1"
- #define LIBFAAD "libfaad.so.2"
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/s/svox
-PKG_MD5SUM:=df4bf610ff4273b420e80ff64af93130
+PKG_HASH:=337b25e6ccb3764f0df1e176470b883c90e40e98840d4133340fcc89eb3cea0c
PKG_MAINTAINER:=Alessandro Di Marco <dmr@ethzero.com>
PKG_LICENSE:=Apache-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.lesbonscomptes.com/upmpdcli/downloads
-PKG_MD5SUM:=de9f232d6d5f746ec81ec239e11bdda4
+PKG_HASH:=2df3e6593f18c097b6247fb8da919b94701bf083b219056b006d68e6dcef75b5
PKG_MAINTAINER:=Petko Bordjukov <bordjukov@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=7b5045c3c1a306e3bfc3c50f2a769eca67f20206af3bd56eaa0da1e04df93fcc
PKG_SOURCE_URL:=git://git.sv.gnu.org/acl.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
include $(TOPDIR)/rules.mk
PKG_NAME:=acpica-unix
-PKG_VERSION:=20170629
+PKG_VERSION:=20170831
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://acpica.org/sites/$(subst -unix,,$(PKG_NAME))/files/$(PKG_SOURCE_URL)
-PKG_HASH:=5f05d8f63d60888d7450f090ce270ef7ed026de9293ce9f6d04fe99cbbb77635
+PKG_HASH:=c918a422f6c72e27b08c841158b52d870b92730fb6406b33d20ef50b1d2b4113
PKG_MAINTAINER:=Philip Prindeville <philipp@redfish-solutions.com>
PKG_LICENSE:=GPL-2.0
define Package/acpica-unix
SECTION:=utils
CATEGORY:=Utilities
- DEPENDS:=
- TITLE:=ACPI utilities for UNIX
+ DEPENDS:=@TARGET_x86_64
+ TITLE:=ACPI utilities (currently acpidump) for UNIX
URL:=https://acpica.org/
endef
Open Source utilities for ACPI including the ACPICA Machine Language
(AML) interpreter, a simulator, test suites, and a compiler to
translate ACPI Source Language (ASL) into AML.
+
+ At this time, only acpidump is bundledr; more might be added later.
endef
define Build/Configure
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@SF/acpid2
-PKG_MD5SUM:=e41bdf628e122edb4342fca432ea7db9
+PKG_HASH:=820c223e53cc11d9d7229fb1ffc2c2205f1054082c80f83f5a4ec4df16d3a616
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=48b3fbac1c30c5968b2608eb09b53ea37c310a24
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=4d00a1ceb480793db95e359cb95d63630920335415c7ffdcd05f2616cf1bc034
PKG_MAINTAINER:=Russell Senior <russell@personaltelco.net>
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/a/at
-PKG_MD5SUM:=d05da75d9b75d93917ffb16ab48b1e19
+PKG_HASH:=cb9af59c6a54edce9536ba629841055409d1f89d8ae26494727a97141fb4d5c1
PKG_LICENSE:=GPL-2.0+ GPL-3.0+ ISC
PKG_LICENSE_FILES:=COPYING Copyright
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME)
-PKG_MD5SUM:=58bb42049122cf80fe4f4d0ce36d92ee
+PKG_HASH:=0f9f731b6394ca7795b88359689a7fa1fba818c6e1d962513eb28da670e0a196
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/NethServer/bandwidthd/archive/$(PKG_VERSION)
-PKG_MD5SUM:=a4075335d06fe91ae815616ed9e27375
+PKG_HASH:=41803a202956ae99b095f98ce92e5637dad62d25509ccd5cff9a8913626a4226
PKG_MAINTAINER:=Jean-Michel Lacroix <lacroix@lepine-lacroix.info>
PKG_SOURCE:=$(PKG_NAME)-$(BASE_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/bash
-PKG_MD5SUM:=81348932d5da294953e15d4814c74dd1
+PKG_HASH:=afc687a28e0e24dc21b988fa159ff9dbcf6b7caa92ade8645cc6d5605cd024d4
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BASE_VERSION)
PKG_LICENSE:=GPL-3.0+
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=ftp://ftp.debian.org/debian/pool/main/b/bc
-PKG_MD5SUM:=24d0831812d8262b6cac8316b0bac483
+PKG_HASH:=5e1471869dd27ba4120dd3942d2f4ec6646cf917fb056be9ae0d3a8259668d47
PKG_MAINTAINER:=Bruno Randolf <br1@einfach.org>
PKG_LICENSE:=GPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://ftp.digifail.com/software/bluelog
-PKG_MD5SUM:=614d0fe65bae68acff1d33d9f86e4805
+PKG_HASH:=9750b007daffaffecea3b8dd2332bf74cc24955c307861197a20d04d845bc412
OUI_SOURCE:=oui-2016-05-30.txt.gz
OUI_URL:=http://sources.lede-project.org/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/
-PKG_MD5SUM:=dae2ed00c63791800ea7d10a381270a5
+PKG_HASH:=0618c5440be6715805060ab5eea930526f34089c437bf61819447b160254f4df
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=http://www.coker.com.au/bonnie++/experimental/
-PKG_MD5SUM:=d6cf9703242998b2ddc2d875b028b3c6
+PKG_HASH:=44f5a05937648a6526ba99354555d7d15f2dd392e55d3436f6746da6f6c35982
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=copyright.txt
PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs/
-PKG_MD5SUM:=25ba238f44b9a1a54e62f7b361bdc9d8
PKG_HASH:=e17a68cc52a27d905b715445e91ddbaa4d42de4847d54836d6ed21e012dabf0e
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/linux-can/can-utils
PKG_SOURCE_DATE:=2017-02-16
PKG_SOURCE_VERSION:=cb33a55720716cbe01e6025a2bda74a1b7e492d3
-PKG_MIRROR_HASH:=cb6a615bc7d62923d5bc0130891e824e9964de8a31920004b74872a07d8743ef
+PKG_MIRROR_HASH:=d9c01eeff3d81a28161ca5c3937ec005a1f49ca3eb97bee0164d53cc66365786
PKG_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=@SF/cmdpad
-PKG_MD5SUM:=6633b2354b7f23f9cd8e2bfb6e735965
+PKG_HASH:=19963f20f1af50fab0013fb373af294ea412da7241d1ea91fad90455291948b9
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=MIT
PKG_NAME:=collectd
PKG_VERSION:=5.7.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://collectd.org/files/ \
--- /dev/null
+From af01dd6fa3eb458e2fbb272703b0cae37ea54a9b Mon Sep 17 00:00:00 2001
+From: Marcin Jurkowski <marcin1j@gmail.com>
+Date: Tue, 11 Jul 2017 15:00:25 +0200
+Subject: [PATCH] uptime plugin: don't cache boot time and simplify Linux code
+
+Caching boottime on startup yields incorrect uptime values if system
+date changes after the daemon is started.
+This is almost certain to happen on embedded systems without RTC, where
+clock is set from NTP server at some point after boot process.
+
+On Linux, we can retrieve uptime directly by either reading /proc/uptime
+(it's sufficient to read a few bytes) or calling sysinfo() function.
+Use the latter since it's the most efficient way in speed, memory
+requirements and code simplicity terms.
+---
+ src/uptime.c | 71 ++++++++++++++++--------------------------------------------
+ 1 file changed, 19 insertions(+), 52 deletions(-)
+
+--- a/src/uptime.c
++++ b/src/uptime.c
+@@ -25,8 +25,7 @@
+ #include "plugin.h"
+
+ #if KERNEL_LINUX
+-#define STAT_FILE "/proc/stat"
+-/* Using /proc filesystem to retrieve the boot time, Linux only. */
++#include <sys/sysinfo.h>
+ /* #endif KERNEL_LINUX */
+
+ #elif HAVE_LIBKSTAT
+@@ -53,8 +52,6 @@
+ /*
+ * Global variables
+ */
+-/* boottime always used, no OS distinction */
+-static time_t boottime;
+
+ #if HAVE_LIBKSTAT
+ extern kstat_ctl_t *kc;
+@@ -72,8 +69,6 @@ static void uptime_submit(gauge_t value)
+ plugin_dispatch_values(&vl);
+ }
+
+-static int uptime_init(void) /* {{{ */
+-{
+ /*
+ * On most unix systems the uptime is calculated by looking at the boot
+ * time (stored in unix time, since epoch) and the current one. We are
+@@ -84,48 +79,21 @@ static int uptime_init(void) /* {{{ */
+ * the boot time, the plugin is unregistered and there is no chance to
+ * try again later. Nevertheless, this is very unlikely to happen.
+ */
+-
++static time_t uptime_get_sys(void) { /* {{{ */
++ time_t result;
+ #if KERNEL_LINUX
+- unsigned long starttime;
+- char buffer[1024];
+- int ret;
+- FILE *fh;
+-
+- ret = 0;
+-
+- fh = fopen(STAT_FILE, "r");
++ struct sysinfo info;
++ int status;
+
+- if (fh == NULL) {
++ status = sysinfo(&info);
++ if (status != 0) {
+ char errbuf[1024];
+- ERROR("uptime plugin: Cannot open " STAT_FILE ": %s",
++ ERROR("uptime plugin: Error calling sysinfo: %s",
+ sstrerror(errno, errbuf, sizeof(errbuf)));
+ return (-1);
+ }
+
+- while (fgets(buffer, 1024, fh) != NULL) {
+- /* look for the btime string and read the value */
+- ret = sscanf(buffer, "btime %lu", &starttime);
+- /* avoid further loops if btime has been found and read
+- * correctly (hopefully) */
+- if (ret == 1)
+- break;
+- }
+-
+- fclose(fh);
+-
+- /* loop done, check if no value has been found/read */
+- if (ret != 1) {
+- ERROR("uptime plugin: No value read from " STAT_FILE "");
+- return (-1);
+- }
+-
+- boottime = (time_t)starttime;
+-
+- if (boottime == 0) {
+- ERROR("uptime plugin: btime read from " STAT_FILE ", "
+- "but `boottime' is zero!");
+- return (-1);
+- }
++ result = (time_t)info.uptime;
+ /* #endif KERNEL_LINUX */
+
+ #elif HAVE_LIBKSTAT
+@@ -159,13 +127,13 @@ static int uptime_init(void) /* {{{ */
+ return (-1);
+ }
+
+- boottime = (time_t)knp->value.ui32;
+-
+- if (boottime == 0) {
++ if (knp->value.ui32 == 0) {
+ ERROR("uptime plugin: kstat_data_lookup returned success, "
+ "but `boottime' is zero!");
+ return (-1);
+ }
++
++ result = time(NULL) - (time_t)knp->value.ui32;
+ /* #endif HAVE_LIBKSTAT */
+
+ #elif HAVE_SYS_SYSCTL_H
+@@ -186,13 +154,13 @@ static int uptime_init(void) /* {{{ */
+ return (-1);
+ }
+
+- boottime = boottv.tv_sec;
+-
+- if (boottime == 0) {
++ if (boottv.tv_sec == 0) {
+ ERROR("uptime plugin: sysctl(3) returned success, "
+ "but `boottime' is zero!");
+ return (-1);
+ }
++
++ result = time(NULL) - boottv.tv_sec;
+ /* #endif HAVE_SYS_SYSCTL_H */
+
+ #elif HAVE_PERFSTAT
+@@ -212,18 +180,18 @@ static int uptime_init(void) /* {{{ */
+ if (hertz <= 0)
+ hertz = HZ;
+
+- boottime = time(NULL) - cputotal.lbolt / hertz;
++ result = cputotal.lbolt / hertz;
+ #endif /* HAVE_PERFSTAT */
+
+- return (0);
+-} /* }}} int uptime_init */
++ return result;
++} /* }}} int uptime_get_sys */
+
+ static int uptime_read(void) {
+ gauge_t uptime;
+ time_t elapsed;
+
+ /* calculate the amount of time elapsed since boot, AKA uptime */
+- elapsed = time(NULL) - boottime;
++ elapsed = uptime_get_sys();
+
+ uptime = (gauge_t)elapsed;
+
+@@ -233,6 +201,5 @@ static int uptime_read(void) {
+ }
+
+ void module_register(void) {
+- plugin_register_init("uptime", uptime_init);
+ plugin_register_read("uptime", uptime_read);
+ } /* void module_register */
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/coreutils
-PKG_MD5SUM:=abed135279f87ad6762ce57ff6d89c41
+PKG_HASH:=ec43ca5bcfc62242accb46b7f121f6b684ee21ecd7d075059bf650ff9e37b82d
PKG_BUILD_DEPENDS:=libpthread
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_SOURCE_URL:=https://github.com/ondrej1024/crelay
PKG_SOURCE_VERSION:=V$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=e7cae6dcc299cbec86e6cbc79dd155a1489d97c9a46b3b4e5179a6ca11cc4b8b
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_SOURCE_URL:=https://github.com/cryptodev-linux/cryptodev-linux
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=a705360197260d28535746ae98c461ba2cfb7a9e
-PKG_MIRROR_HASH:=553069ecf1f3d5d5652404aaf438610f555c94db4369c7c1db85210c4e3cdfee
+PKG_MIRROR_HASH:=334a8f4df18e36e97459b4c6669c9873c13c4f5dae25243cf41ff70c2ce661d8
PKG_MAINTAINER:=Ansuel Smith <ansuelsmth@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://dbus.freedesktop.org/releases/dbus/
-PKG_MD5SUM:=27b8e99ffad603b8acfa25201c6e3d5c
+PKG_HASH:=ad7dcad73ad9b0ff55819985d354eacfffe07e2eb8c763e155efc21d6001084b
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_LICENSE:=AFL-2.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.sourceforge.net/project/dfu-programmer/dfu-programmer/$(PKG_VERSION)/
-PKG_MD5SUM:=98641b0a7cf1cc8c8be3584d5552f6d8
+PKG_HASH:=1db4d36b1aedab2adc976e8faa5495df3cf82dc4bf883633dc6ba71f7c4af995
PKG_MAINTAINER:=Stefan Hellermann <stefan@the2masters.de>
PKG_LICENSE:=GPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)/files/
-PKG_MD5SUM:=233bb1e08ef4b405062445d84e28fde6
PKG_HASH:=36428c6a6cb3088cad5a3592933385253da5f29f2effa61518ee5991ea38f833
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME)
-PKG_MD5SUM:=7ec35bb193729c1d593a1460b59d82d24b89102ab23fd0416e6cf4325d077e45
+PKG_HASH:=7ec35bb193729c1d593a1460b59d82d24b89102ab23fd0416e6cf4325d077e45
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_NAME:=domoticz
PKG_VERSION_MAJOR:=3
-PKG_VERSION_PATCH:=5877
+PKG_VERSION_PATCH:=8153
PKG_VERSION:=$(PKG_VERSION_MAJOR).$(PKG_VERSION_PATCH)
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/domoticz/domoticz/archive/$(PKG_VERSION)/$(PKG_SOURCE)
-PKG_HASH:=fb88edbe428851a7a337a85faa93f6da00713b3ad086ff6957031dc9b3b58bba
+PKG_HASH:=5ea8f37f2ef900e9bd17b1b5375e75bfdec4f09001e3e2e0b647a260989d014c
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=License.txt
-DUSE_STATIC_OPENZWAVE=no \
-DUSE_PYTHON=no
+TARGET_CXXFLAGS+=-DWITH_GPIO
+
define Build/Prepare
$(call Build/Prepare/Default)
# Fix APPVERSION to suppress update popup
# Remove unwanted scripts
cd $(PKG_BUILD_DIR)/scripts && rm -rf \
buienradar_rain_example.pl \
- _domoticz_main.bat \
+ _domoticz_main* \
download_update.sh \
+ dzVents/{.gitignore,documentation,examples,generated_scripts} \
+ dzVents/runtime/{integration-tests,misc/smoothing.xlsx,tests} \
logrotate/ \
+ lua_parsers/example* \
+ lua/*demo.lua \
python/ \
readme.txt \
restart_domoticz \
templates/All.Python \
update_domoticz
+ # Remove *.md
+ cd $(PKG_BUILD_DIR) && $(FIND) -name '*.md' -delete
endef
define Package/domoticz/install
[ -n "$loglevel" ] && procd_append_param command -loglevel "$loglevel"
[ -n "$syslog" ] && procd_append_param command -syslog "$syslog"
[ -n "$userdata" ] && {
- mkdir -p "$userdata"
- chmod 0770 "$userdata"
- chown domoticz:domoticz "$userdata"
+ mkdir -p "${userdata}/generated_scripts"
+ chmod -R 0770 "$userdata"
+ chown -R domoticz:domoticz "$userdata"
procd_append_param command -userdata "$userdata"
}
[ -n "$sslcert" -a "${sslwww:-0}" -gt 0 ] && {
+++ /dev/null
-From 2504f02de752aceb5a3c1d4749032147efde8082 Mon Sep 17 00:00:00 2001
-From: dwmw2 <dwmw2@infradead.org>
-Date: Fri, 3 Feb 2017 07:40:35 +0000
-Subject: [PATCH] Add -sslkey option to allow separate cert/key files (#1195)
-
----
- main/domoticz.cpp | 11 +++++++++++
- webserver/server_settings.hpp | 2 +-
- 2 files changed, 12 insertions(+), 1 deletion(-)
-
---- a/main/domoticz.cpp
-+++ b/main/domoticz.cpp
-@@ -76,6 +76,7 @@ const char *szHelp=
- #ifdef WWW_ENABLE_SSL
- "\t-sslwww port (for example -sslwww 443, or -sslwww 0 to disable https)\n"
- "\t-sslcert file_path (for example /opt/domoticz/server_cert.pem)\n"
-+ "\t-sslkey file_path (if different from certificate file)\n"
- "\t-sslpass passphrase (to access to server private key in certificate)\n"
- "\t-sslmethod method (for SSL method)\n"
- "\t-ssloptions options (for SSL options, default is 'default_workarounds,no_sslv2,single_dh_use')\n"
-@@ -682,6 +683,16 @@ int main(int argc, char**argv)
- return 1;
- }
- secure_webserver_settings.cert_file_path = cmdLine.GetSafeArgument("-sslcert", 0, "");
-+ secure_webserver_settings.private_key_file_path = secure_webserver_settings.cert_file_path;
-+ }
-+ if (cmdLine.HasSwitch("-sslkey"))
-+ {
-+ if (cmdLine.GetArgumentCount("-sslkey") != 1)
-+ {
-+ _log.Log(LOG_ERROR, "Please specify a file path for your server SSL key file");
-+ return 1;
-+ }
-+ secure_webserver_settings.private_key_file_path = cmdLine.GetSafeArgument("-sslkey", 0, "");
- }
- if (cmdLine.HasSwitch("-sslpass"))
- {
---- a/webserver/server_settings.hpp
-+++ b/webserver/server_settings.hpp
-@@ -227,7 +227,7 @@ public:
- // use certificate file for all usage by default
- certificate_chain_file_path = ssl_settings.cert_file_path;
- ca_cert_file_path = ssl_settings.cert_file_path;
-- private_key_file_path = ssl_settings.cert_file_path;
-+ private_key_file_path = ssl_settings.private_key_file_path;
- tmp_dh_file_path = ssl_settings.cert_file_path;
- verify_file_path = ssl_settings.cert_file_path;
- }
+++ /dev/null
-diff --git a/hardware/evohome.cpp b/hardware/evohome.cpp
-index fcbee6d..f77291e 100644
---- a/hardware/evohome.cpp
-+++ b/hardware/evohome.cpp
-@@ -423,11 +423,11 @@ void CEvohome::RunScript(const char *pdata, const unsigned char length)
- boost::replace_all(OnAction, "{state}", s_strid.str());
- boost::replace_all(OnAction, "{until}", CEvohomeDateTime::GetISODate(tsen->EVOHOME2));
- //Execute possible script
-- std::string scriptname;
-- if (OnAction.find("script:///") != std::string::npos)
-- scriptname = OnAction.substr(9);
-- else
-- scriptname = OnAction.substr(8);
-+ std::string scriptname = OnAction.substr(9);
-+#if !defined WIN32
-+ if (scriptname.find("/") != 0)
-+ scriptname = szUserDataFolder + "scripts/" + scriptname;
-+#endif
- std::string scriptparams="";
- //Add parameters
- int pindex=scriptname.find(' ');
-@@ -439,7 +439,7 @@ void CEvohome::RunScript(const char *pdata, const unsigned char length)
-
- if (file_exist(scriptname.c_str()))
- {
-- m_sql.AddTaskItem(_tTaskItem::ExecuteScript(1,scriptname,scriptparams));
-+ m_sql.AddTaskItem(_tTaskItem::ExecuteScript(0.2f,scriptname,scriptparams));
- }
- else
- _log.Log(LOG_ERROR,"evohome: Error script not found '%s'",scriptname.c_str());
-@@ -1321,7 +1321,7 @@ bool CEvohome::DecodeZoneName(CEvohomeMsg &msg)
- }
- if(memcmp(&msg.payload[2],m_szNameErr,18)==0)
- {
-- Log(true,LOG_STATUS,"evohome: %s: Warning zone name not set: %d", tag, msg.payload[0]);
-+ Log(true,LOG_STATUS,"evohome: %s: Warning zone name not set: %d", tag, msg.payload[0]+1);
- m_bStartup[0]=false;
- return true;
- }
-@@ -1606,9 +1606,11 @@ bool CEvohome::DecodeBatteryInfo(CEvohomeMsg &msg)
- RFX_SETID3(msg.GetID(0),tsen.EVOHOME2.id1,tsen.EVOHOME2.id2,tsen.EVOHOME2.id3)
- tsen.EVOHOME2.updatetype = updBattery;
-
-- double dbCharge=0;
-- if(nBattery!=0xFF)
-- dbCharge=(double)nBattery/2.0; //Presumed to be the charge level where sent
-+ if (nBattery == 0xFF)
-+ nBattery = 100; // recode full battery (0xFF) to 100 for consistency across device types
-+ else
-+ nBattery = nBattery / 2; // recode battery level values to 0-100 from original 0-200 values
-+
- if(nLowBat==0)
- nBattery=0;
- tsen.EVOHOME2.battery_level=nBattery;
-@@ -1657,9 +1659,11 @@ bool CEvohome::DecodeBatteryInfo(CEvohomeMsg &msg)
- tsen.EVOHOME2.type=pTypeEvohomeWater;
- tsen.EVOHOME2.subtype=sTypeEvohomeWater;
- tsen.EVOHOME2.zone=nDevNo;
-- sDecodeRXMessage(this, (const unsigned char *)&tsen.EVOHOME2, NULL, nBattery);
-+ RFX_SETID3(GetControllerID(), tsen.EVOHOME2.id1, tsen.EVOHOME2.id2, tsen.EVOHOME2.id3);
-+ sDecodeRXMessage(this, (const unsigned char *)&tsen.EVOHOME2, "DHW Temp", nBattery); // Update DHW Zone sensor
- }
-- Log(true,LOG_STATUS,"evohome: %s: %s=%d charge=%d (%.1f %%) level=%d (%s)",tag,szType.c_str(),nDevNo,nBattery,dbCharge,nLowBat,(nLowBat==0)?"Low":"OK");
-+
-+ Log(true,LOG_STATUS,"evohome: %s: %s=%d charge=%d(%%) level=%d (%s)",tag,szType.c_str(),nDevNo,nBattery,nLowBat,(nLowBat==0)?"Low":"OK");
-
- return true;
- }
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -606,8 +606,6 @@ else()
+@@ -645,8 +645,6 @@ else()
target_link_libraries(domoticz -lrt ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} ${CURL_LIBRARIES} pthread ${LUA_LIBRARIES} ${MQTT_LIBRARIES} ${SQLite_LIBRARIES} ${CMAKE_DL_LIBS} ${TELLDUS_LIBRARIES} ${EXECINFO_LIBRARIES})
ENDIF()
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -534,39 +534,6 @@ IF(OpenZWave)
+@@ -579,39 +579,6 @@ IF(OpenZWave)
target_link_libraries(domoticz ${OpenZWave})
include_directories(${CMAKE_SOURCE_DIR}/hardware/openzwave)
add_definitions(-DWITH_OPENZWAVE)
- find_library(UDEV NAMES libudev.a)
- IF(UDEV)
- message(STATUS ${UDEV})
-- target_link_libraries(domoticz ${UDEV} -lrt)
+- target_link_libraries(domoticz ${UDEV} -lrt -lresolv)
- else()
- find_library(UDEV NAMES libudev.so)
- IF(UDEV)
- message(STATUS ${UDEV})
-- target_link_libraries(domoticz ${UDEV} -lrt)
+- target_link_libraries(domoticz ${UDEV} -lrt -lresolv)
- else()
- MESSAGE(FATAL_ERROR "LIB UDEV not found on your system, see install.txt how to get them installed.\nsudo apt-get install libudev-dev")
- ENDIF(UDEV)
+++ /dev/null
---- a/hardware/OpenZWave.cpp
-+++ b/hardware/OpenZWave.cpp
-@@ -993,7 +993,7 @@ bool COpenZWave::OpenSerialConnector()
- }
- m_nodes.clear();
- m_bNeedSave = false;
-- std::string ConfigPath = szStartupFolder + "Config/";
-+ std::string ConfigPath = "/usr/share/domoticz/openzwave/";
- std::string UserPath = ConfigPath;
- if (szStartupFolder != szUserDataFolder)
- {
---- a/main/EventSystem.cpp
-+++ b/main/EventSystem.cpp
-@@ -44,7 +44,7 @@ extern "C" {
- using namespace boost::python;
- #endif
-
--extern std::string szUserDataFolder;
-+extern std::string szScriptsFolder;
-
- CEventSystem::CEventSystem(void)
- {
-@@ -1086,9 +1086,9 @@ void CEventSystem::EvaluateEvent(const s
- std::stringstream lua_DirT;
-
- #ifdef WIN32
-- lua_DirT << szUserDataFolder << "scripts\\lua\\";
-+ lua_DirT << szScriptsFolder << "lua\\";
- #else
-- lua_DirT << szUserDataFolder << "scripts/lua/";
-+ lua_DirT << szScriptsFolder << "lua/";
- #endif
-
- std::string lua_Dir = lua_DirT.str();
-@@ -1139,9 +1139,9 @@ void CEventSystem::EvaluateEvent(const s
- {
- std::stringstream python_DirT;
- #ifdef WIN32
-- python_DirT << szUserDataFolder << "scripts\\python\\";
-+ python_DirT << szScriptsFolder << "python\\";
- #else
-- python_DirT << szUserDataFolder << "scripts/python/";
-+ python_DirT << szScriptsFolder << "python/";
- #endif
-
- std::string python_Dir = python_DirT.str();
-@@ -2021,7 +2021,7 @@ bool CEventSystem::parseBlocklyActions(c
- }
- #if !defined WIN32
- if (sPath.find("/") != 0)
-- sPath = szUserDataFolder + "scripts/" + sPath;
-+ sPath = szScriptsFolder + sPath;
- #endif
-
- m_sql.AddTaskItem(_tTaskItem::ExecuteScript(1, sPath, sParam));
-@@ -2133,9 +2133,9 @@ void CEventSystem::EvaluatePython(const
- std::stringstream python_DirT;
-
- #ifdef WIN32
-- python_DirT << szUserDataFolder << "scripts\\python\\";
-+ python_DirT << szScriptsFolder << "python\\";
- #else
-- python_DirT << szUserDataFolder << "scripts/python/";
-+ python_DirT << szScriptsFolder << "python/";
- #endif
- std::string python_Dir = python_DirT.str();
- if(!Py_IsInitialized()) {
-@@ -3909,9 +3909,9 @@ namespace http {
-
- std::stringstream template_file;
- #ifdef WIN32
-- template_file << szUserDataFolder << "scripts\\templates\\" << eventType << "." << interpreter;
-+ template_file << szScriptsFolder << "templates\\" << eventType << "." << interpreter;
- #else
-- template_file << szUserDataFolder << "scripts/templates/" << eventType << "." << interpreter;
-+ template_file << szScriptsFolder << "templates/" << eventType << "." << interpreter;
- #endif
- std::ifstream file;
- std::stringstream template_content;
---- a/main/LuaHandler.cpp
-+++ b/main/LuaHandler.cpp
-@@ -22,7 +22,7 @@ extern "C" {
- #include "mainworker.h"
- #include "../hardware/hardwaretypes.h"
-
--extern std::string szUserDataFolder;
-+extern std::string szScriptsFolder;
-
- int CLuaHandler::l_domoticz_applyXPath(lua_State* lua_state)
- {
-@@ -319,9 +319,9 @@ bool CLuaHandler::executeLuaScript(const
- {
- std::stringstream lua_DirT;
- #ifdef WIN32
-- lua_DirT << szUserDataFolder << "scripts\\lua_parsers\\";
-+ lua_DirT << szScriptsFolder << "lua_parsers\\";
- #else
-- lua_DirT << szUserDataFolder << "scripts/lua_parsers/";
-+ lua_DirT << szScriptsFolder << "lua_parsers/";
- #endif
- std::string lua_Dir = lua_DirT.str();
-
---- a/main/SQLHelper.cpp
-+++ b/main/SQLHelper.cpp
-@@ -612,6 +612,7 @@ const char *sqlCreateMobileDevices =
- "[LastUpdate] DATETIME DEFAULT(datetime('now', 'localtime'))"
- ");";
-
-+extern std::string szScriptsFolder;
- extern std::string szUserDataFolder;
-
- CSQLHelper::CSQLHelper(void)
-@@ -3408,9 +3409,9 @@ unsigned long long CSQLHelper::UpdateVal
- //Execute possible script
- std::string scriptname;
- #ifdef WIN32
-- scriptname = szUserDataFolder + "scripts\\domoticz_main.bat";
-+ scriptname = szScriptsFolder + "domoticz_main.bat";
- #else
-- scriptname = szUserDataFolder + "scripts/domoticz_main";
-+ scriptname = szScriptsFolder + "domoticz_main";
- #endif
- if (file_exist(scriptname.c_str()))
- {
-@@ -6460,7 +6461,7 @@ bool CSQLHelper::HandleOnOffAction(const
- std::string scriptname = OnAction.substr(9);
- #if !defined WIN32
- if (scriptname.find("/") != 0)
-- scriptname = szUserDataFolder + "scripts/" + scriptname;
-+ scriptname = szScriptsFolder + scriptname;
- #endif
- std::string scriptparams="";
- //Add parameters
-@@ -6492,7 +6493,7 @@ bool CSQLHelper::HandleOnOffAction(const
- std::string scriptname = OffAction.substr(9);
- #if !defined WIN32
- if (scriptname.find("/") != 0)
-- scriptname = szUserDataFolder + "scripts/" + scriptname;
-+ scriptname = szScriptsFolder + scriptname;
- #endif
- std::string scriptparams="";
- int pindex=scriptname.find(' ');
---- a/main/WebServer.cpp
-+++ b/main/WebServer.cpp
-@@ -55,6 +55,7 @@
-
- #define round(a) ( int ) ( a + .5 )
-
-+extern std::string szScriptsFolder;
- extern std::string szUserDataFolder;
- extern std::string szWWWFolder;
-
-@@ -2614,9 +2615,9 @@ namespace http {
- if (scriptname.find("..") != std::string::npos)
- return;
- #ifdef WIN32
-- scriptname = szUserDataFolder + "scripts\\" + scriptname;
-+ scriptname = szScriptsFolder + scriptname;
- #else
-- scriptname = szUserDataFolder + "scripts/" + scriptname;
-+ scriptname = szScriptsFolder + scriptname;
- #endif
- if (!file_exist(scriptname.c_str()))
- return;
---- a/main/domoticz.cpp
-+++ b/main/domoticz.cpp
-@@ -135,6 +135,7 @@ static const _facilities facilities[] =
- };
- std::string logfacname = "user";
- #endif
-+std::string szScriptsFolder;
- std::string szStartupFolder;
- std::string szUserDataFolder;
- std::string szWWWFolder;
-@@ -603,6 +604,19 @@ int main(int argc, char**argv)
- szUserDataFolder = szroot;
- }
-
-+ szScriptsFolder=szStartupFolder;
-+ if (cmdLine.HasSwitch("-scripts"))
-+ {
-+ if (cmdLine.GetArgumentCount("-scripts") != 1)
-+ {
-+ _log.Log(LOG_ERROR, "Please specify a path for scripts directory");
-+ return 1;
-+ }
-+ std::string szroot = cmdLine.GetSafeArgument("-scripts", 0, "");
-+ if (szroot.size() != 0)
-+ szScriptsFolder = szroot;
-+ }
-+
- if (cmdLine.HasSwitch("-startupdelay"))
- {
- if (cmdLine.GetArgumentCount("-startupdelay") != 1)
---- a/main/mainworker.cpp
-+++ b/main/mainworker.cpp
-@@ -139,6 +139,7 @@
-
- #define round(a) ( int ) ( a + .5 )
-
-+extern std::string szScriptsFolder;
- extern std::string szStartupFolder;
- extern std::string szUserDataFolder;
- extern std::string szWWWFolder;
-@@ -1394,8 +1395,8 @@ void MainWorker::Do_Work()
- m_sql.GetPreferencesVar("ReleaseChannel", nValue);
- bool bIsBetaChannel = (nValue != 0);
-
-- std::string scriptname = szUserDataFolder + "scripts/download_update.sh";
-- std::string strparm = szUserDataFolder;
-+ std::string scriptname = szScriptsFolder + "download_update.sh";
-+ std::string strparm = szScriptsFolder;
- if (bIsBetaChannel)
- strparm += " /beta";
-
---- a/notifications/NotificationHTTP.cpp
-+++ b/notifications/NotificationHTTP.cpp
-@@ -6,7 +6,7 @@
- #include "../main/SQLHelper.h"
- #include "../main/Logger.h"
-
--extern std::string szUserDataFolder;
-+extern std::string szScriptsFolder;
-
- CNotificationHTTP::CNotificationHTTP() : CNotificationBase(std::string("http"), OPTIONS_NONE)
- {
-@@ -97,7 +97,7 @@ bool CNotificationHTTP::SendMessageImple
- std::string scriptparams = "";
- #if !defined WIN32
- if (scriptname.find("/") != 0)
-- scriptname = szUserDataFolder + "scripts/" + scriptname;
-+ scriptname = szScriptsFolder + scriptname;
- #endif
- //Add parameters
- uPos = scriptname.find(" ");
---- a/push/GooglePubSubPush.cpp
-+++ b/push/GooglePubSubPush.cpp
-@@ -20,7 +20,7 @@ extern "C" {
- using namespace boost::python;
- #endif
-
--extern std::string szUserDataFolder;
-+extern std::string szScriptsFolder;
-
- // this should be filled in by the preprocessor
- extern const char * Python_exe;
-@@ -222,11 +222,11 @@ void CGooglePubSubPush::DoGooglePubSubPu
-
- #ifdef ENABLE_PYTHON
- #ifdef WIN32
-- python_DirT << szUserDataFolder << "scripts\\python\\";
-- std::string filename = szUserDataFolder + "scripts\\python\\" + "googlepubsub.py";
-+ python_DirT << szScriptsFolder << "python\\";
-+ std::string filename = szScriptsFolder + "python\\" + "googlepubsub.py";
- #else
-- python_DirT << szUserDataFolder << "scripts/python/";
-- std::string filename = szUserDataFolder + "scripts/python/" + "googlepubsub.py";
-+ python_DirT << szScriptsFolder << "python/";
-+ std::string filename = szScriptsFolder + "python/" + "googlepubsub.py";
- #endif
-
- char * argv[1];
--- /dev/null
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -521,20 +521,23 @@ else()
+ MESSAGE(FATAL_ERROR "cURL not found on your system, see install.txt how to get them installed. (for example 'sudo apt-get install curl libcurl4-openssl-dev')")
+ ENDIF(CURL_FOUND)
+
+-find_path(LIBUSB_INCLUDE_DIR usb.h
+- HINTS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
+-find_library(LIBUSB_LIBRARY NAMES usb
+- HINTS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
+-set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY})
++option(WITH_LIBUSB "Enable libusb support" NO)
++ if(WITH_LIBUSB)
++ find_path(LIBUSB_INCLUDE_DIR usb.h
++ HINTS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
++ find_library(LIBUSB_LIBRARY NAMES usb
++ HINTS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
++ set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY})
+
+-find_package_handle_standard_args(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
+-IF(LIBUSB_FOUND)
+- MESSAGE(STATUS "LIBUSB found at: ${LIBUSB_LIBRARIES}")
+- add_definitions(-DWITH_LIBUSB)
+- target_link_libraries(domoticz ${LIBUSB_LIBRARIES})
+-else()
+- MESSAGE(STATUS "==== LibUSB not found, support for TE923/Voltcraft disabled!")
+-ENDIF(LIBUSB_FOUND)
++ find_package_handle_standard_args(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
++ IF(LIBUSB_FOUND)
++ MESSAGE(STATUS "LIBUSB found at: ${LIBUSB_LIBRARIES}")
++ add_definitions(-DWITH_LIBUSB)
++ target_link_libraries(domoticz ${LIBUSB_LIBRARIES})
++ else()
++ MESSAGE(STATUS "==== LibUSB not found, support for TE923/Voltcraft disabled!")
++ ENDIF(LIBUSB_FOUND)
++endif(WITH_LIBUSB)
+
+ #
+ # Find MD5/RMD160/SHA library
+++ /dev/null
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -476,20 +476,23 @@ else()
- MESSAGE(FATAL_ERROR "cURL not found on your system, see install.txt how to get them installed. (for example 'sudo apt-get install curl libcurl4-openssl-dev')")
- ENDIF(CURL_FOUND)
-
--find_path(LIBUSB_INCLUDE_DIR usb.h
-- HINTS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
--find_library(LIBUSB_LIBRARY NAMES usb
-- HINTS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
--set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY})
-+option(WITH_LIBUSB "Enable libusb support" NO)
-+ if(WITH_LIBUSB)
-+ find_path(LIBUSB_INCLUDE_DIR usb.h
-+ HINTS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
-+ find_library(LIBUSB_LIBRARY NAMES usb
-+ HINTS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
-+ set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY})
-
--find_package_handle_standard_args(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
--IF(LIBUSB_FOUND)
-- MESSAGE(STATUS "LIBUSB found at: ${LIBUSB_LIBRARIES}")
-- add_definitions(-DWITH_LIBUSB)
-- target_link_libraries(domoticz ${LIBUSB_LIBRARIES})
--else()
-- MESSAGE(STATUS "==== LibUSB not found, support for TE923/Voltcraft disabled!")
--ENDIF(LIBUSB_FOUND)
-+ find_package_handle_standard_args(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
-+ IF(LIBUSB_FOUND)
-+ MESSAGE(STATUS "LIBUSB found at: ${LIBUSB_LIBRARIES}")
-+ add_definitions(-DWITH_LIBUSB)
-+ target_link_libraries(domoticz ${LIBUSB_LIBRARIES})
-+ else()
-+ MESSAGE(STATUS "==== LibUSB not found, support for TE923/Voltcraft disabled!")
-+ ENDIF(LIBUSB_FOUND)
-+endif(WITH_LIBUSB)
-
- #
- # Find MD5/RMD160/SHA library
--- /dev/null
+diff --git a/hardware/EvohomeScript.cpp b/hardware/EvohomeScript.cpp
+index 5258fc55..0a44e97c 100644
+--- a/hardware/EvohomeScript.cpp
++++ b/hardware/EvohomeScript.cpp
+@@ -30,7 +30,7 @@
+
+ #include <string>
+
+-extern std::string szUserDataFolder;
++extern std::string szScriptsFolder;
+
+
+ CEvohomeScript::CEvohomeScript(const int ID)
+@@ -143,7 +143,7 @@ void CEvohomeScript::RunScript(const char *pdata, const unsigned char length)
+ std::string scriptname = OnAction.substr(9);
+ #if !defined WIN32
+ if (scriptname.find("/") != 0)
+- scriptname = szUserDataFolder + "scripts/" + scriptname;
++ scriptname = szScriptsFolder + "scripts/" + scriptname;
+ #endif
+ std::string scriptparams="";
+ //Add parameters
+diff --git a/hardware/OpenZWave.cpp b/hardware/OpenZWave.cpp
+index 1f5c341c..24db61c9 100644
+--- a/hardware/OpenZWave.cpp
++++ b/hardware/OpenZWave.cpp
+@@ -948,7 +948,7 @@ bool COpenZWave::OpenSerialConnector()
+
+ m_nodes.clear();
+ m_bNeedSave = false;
+- std::string ConfigPath = szStartupFolder + "Config/";
++ std::string ConfigPath = "/usr/share/domoticz/openzwave/";
+ std::string UserPath = ConfigPath;
+ if (szStartupFolder != szUserDataFolder)
+ {
+diff --git a/main/EventSystem.cpp b/main/EventSystem.cpp
+index 4eff02fd..f2b17b97 100644
+--- a/main/EventSystem.cpp
++++ b/main/EventSystem.cpp
+@@ -33,9 +33,11 @@ extern "C" {
+ #endif
+ }
+
++extern std::string szScriptsFolder;
+ extern std::string szUserDataFolder;
+ extern http::server::CWebServerHelper m_webservers;
+
++static std::string dzv_Dir;
+ static std::string m_printprefix;
+
+ #ifdef ENABLE_PYTHON
+@@ -115,7 +117,6 @@ static const _tJsonMap JsonMap[] =
+ { NULL, NULL, tString }
+ };
+
+-
+ CEventSystem::CEventSystem(void)
+ {
+ m_stoprequested = false;
+@@ -149,7 +150,7 @@ void CEventSystem::StartEventSystem()
+ GetCurrentScenesGroups();
+ GetCurrentUserVariables();
+ #ifdef ENABLE_PYTHON
+- Plugins::PythonEventsInitialize(szUserDataFolder);
++ Plugins::PythonEventsInitialize(szScriptsFolder);
+ #endif
+
+ m_thread = boost::shared_ptr<boost::thread>(new boost::thread(boost::bind(&CEventSystem::Do_Work, this)));
+@@ -179,11 +180,11 @@ void CEventSystem::SetEnabled(const bool bEnabled)
+
+ void CEventSystem::LoadEvents()
+ {
+- std::string dzv_Dir,s;
++ std::string s;
+ #ifdef WIN32
+- dzv_Dir = szUserDataFolder + "scripts\\dzVents\\generated_scripts\\";
++ dzv_Dir = szUserDataFolder + "generated_scripts\\";
+ #else
+- dzv_Dir = szUserDataFolder + "scripts/dzVents/generated_scripts/";
++ dzv_Dir = szUserDataFolder + "generated_scripts/";
+ #endif
+ boost::unique_lock<boost::shared_mutex> eventsMutexLock(m_eventsMutex);
+ _log.Log(LOG_STATUS, "EventSystem: reset all events...");
+@@ -274,18 +275,18 @@ void CEventSystem::LoadEvents()
+ void CEventSystem::Do_Work()
+ {
+ #ifdef WIN32
+- m_lua_Dir = szUserDataFolder + "scripts\\lua\\";
+- m_dzv_Dir = szUserDataFolder + "scripts\\dzVents\\runtime\\";
++ m_lua_Dir = szScriptsFolder + "lua\\";
++ m_dzv_Dir = szScriptsFolder + "dzVents\\runtime\\";
+ #else
+- m_lua_Dir = szUserDataFolder + "scripts/lua/";
+- m_dzv_Dir = szUserDataFolder + "scripts/dzVents/runtime/";
++ m_lua_Dir = szScriptsFolder + "lua/";
++ m_dzv_Dir = szScriptsFolder + "dzVents/runtime/";
+ #endif
+
+ #ifdef ENABLE_PYTHON
+ #ifdef WIN32
+- m_python_Dir = szUserDataFolder + "scripts\\python\\";
++ m_python_Dir = szScriptsFolder + "python\\";
+ #else
+- m_python_Dir = szUserDataFolder + "scripts/python/";
++ m_python_Dir = szScriptsFolder + "python/";
+ #endif
+ #endif
+ m_stoprequested = false;
+@@ -1426,9 +1427,9 @@ void CEventSystem::EvaluateEvent(const std::string &reason, const uint64_t Devic
+ {
+ std::string dzv_scripts;
+ #ifdef WIN32
+- dzv_scripts = szUserDataFolder + "scripts\\dzVents\\scripts\\";
++ dzv_scripts = szScriptsFolder + "dzVents\\scripts\\";
+ #else
+- dzv_scripts = szUserDataFolder + "scripts/dzVents/scripts/";
++ dzv_scripts = szScriptsFolder + "dzVents/scripts/";
+ #endif
+ DirectoryListing(FileEntries, dzv_scripts, false, true);
+ for (itt = FileEntries.begin(); itt != FileEntries.end(); ++itt)
+@@ -2404,7 +2405,7 @@ bool CEventSystem::parseBlocklyActions(const std::string &Actions, const std::st
+ }
+ #if !defined WIN32
+ if (sPath.find("/") != 0)
+- sPath = szUserDataFolder + "scripts/" + sPath;
++ sPath = szScriptsFolder + sPath;
+ #endif
+
+ m_sql.AddTaskItem(_tTaskItem::ExecuteScript(0.2f, sPath, sParam));
+@@ -3508,13 +3509,16 @@ void CEventSystem::EvaluateLua(const std::string &reason, const std::string &fil
+ {
+ std::stringstream lua_DirT;
+
+- lua_DirT << szUserDataFolder <<
++ lua_DirT << szScriptsFolder <<
+ #ifdef WIN32
+- "scripts\\dzVents\\";
++ "dzVents\\";
+ #else
+- "scripts/dzVents/";
++ "dzVents/";
+ #endif
+
++ lua_pushstring(lua_state, "generated_script_path");
++ lua_pushstring(lua_state, dzv_Dir.c_str());
++ lua_rawset(lua_state, -3);
+ lua_pushstring(lua_state, "script_path");
+ lua_pushstring(lua_state, lua_DirT.str().c_str());
+ lua_rawset(lua_state, -3);
+@@ -4695,9 +4699,9 @@ namespace http {
+
+ std::stringstream template_file;
+ #ifdef WIN32
+- template_file << szUserDataFolder << "scripts\\templates\\" << eventType << "." << interpreter;
++ template_file << szScriptsFolder << "templates\\" << eventType << "." << interpreter;
+ #else
+- template_file << szUserDataFolder << "scripts/templates/" << eventType << "." << interpreter;
++ template_file << szScriptsFolder << "templates/" << eventType << "." << interpreter;
+ #endif
+ std::ifstream file;
+ std::stringstream template_content;
+diff --git a/main/EventsPythonModule.cpp b/main/EventsPythonModule.cpp
+index f69e7219..2d97562e 100644
+--- a/main/EventsPythonModule.cpp
++++ b/main/EventsPythonModule.cpp
+@@ -108,7 +108,7 @@
+
+ int PythonEventsInitalized = 0;
+
+- bool PythonEventsInitialize(std::string szUserDataFolder) {
++ bool PythonEventsInitialize(std::string szScriptsFolder) {
+
+ if (!Plugins::Py_LoadLibrary())
+ {
+@@ -131,9 +131,9 @@
+
+ std::string ssPath;
+ #ifdef WIN32
+- ssPath = szUserDataFolder + "scripts\\python\\;";
++ ssPath = szScriptsFolder + "python\\;";
+ #else
+- ssPath = szUserDataFolder + "scripts/python/:";
++ ssPath = szScriptsFolder + "python/:";
+ #endif
+
+ std::wstring sPath = std::wstring(ssPath.begin(), ssPath.end());
+diff --git a/main/LuaHandler.cpp b/main/LuaHandler.cpp
+index 8fdcb278..c2ad98ff 100644
+--- a/main/LuaHandler.cpp
++++ b/main/LuaHandler.cpp
+@@ -22,7 +22,7 @@ extern "C" {
+ #include "mainworker.h"
+ #include "../hardware/hardwaretypes.h"
+
+-extern std::string szUserDataFolder;
++extern std::string szScriptsFolder;
+
+ int CLuaHandler::l_domoticz_updateDevice(lua_State* lua_state)
+ {
+@@ -155,9 +155,9 @@ bool CLuaHandler::executeLuaScript(const std::string &script, const std::string
+ {
+ std::stringstream lua_DirT;
+ #ifdef WIN32
+- lua_DirT << szUserDataFolder << "scripts\\lua_parsers\\";
++ lua_DirT << szScriptsFolder << "lua_parsers\\";
+ #else
+- lua_DirT << szUserDataFolder << "scripts/lua_parsers/";
++ lua_DirT << szScriptsFolder << "lua_parsers/";
+ #endif
+ std::string lua_Dir = lua_DirT.str();
+
+diff --git a/main/SQLHelper.cpp b/main/SQLHelper.cpp
+index 491aa5a2..d529243a 100644
+--- a/main/SQLHelper.cpp
++++ b/main/SQLHelper.cpp
+@@ -633,6 +633,7 @@ const char *sqlCreateMobileDevices =
+ "[LastUpdate] DATETIME DEFAULT(datetime('now', 'localtime'))"
+ ");";
+
++extern std::string szScriptsFolder;
+ extern std::string szUserDataFolder;
+
+ CSQLHelper::CSQLHelper(void)
+@@ -3683,9 +3684,9 @@ uint64_t CSQLHelper::UpdateValueInt(const int HardwareID, const char* ID, const
+ //Execute possible script
+ std::string scriptname;
+ #ifdef WIN32
+- scriptname = szUserDataFolder + "scripts\\domoticz_main.bat";
++ scriptname = szScriptsFolder + "domoticz_main.bat";
+ #else
+- scriptname = szUserDataFolder + "scripts/domoticz_main";
++ scriptname = szScriptsFolder + "domoticz_main";
+ #endif
+ if (file_exist(scriptname.c_str()))
+ {
+@@ -6641,7 +6642,7 @@ bool CSQLHelper::HandleOnOffAction(const bool bIsOn, const std::string &OnAction
+ std::string scriptname = OnAction.substr(9);
+ #if !defined WIN32
+ if (scriptname.find("/") != 0)
+- scriptname = szUserDataFolder + "scripts/" + scriptname;
++ scriptname = szScriptsFolder + scriptname;
+ #endif
+ std::string scriptparams="";
+ //Add parameters
+@@ -6675,7 +6676,7 @@ bool CSQLHelper::HandleOnOffAction(const bool bIsOn, const std::string &OnAction
+ std::string scriptname = OffAction.substr(9);
+ #if !defined WIN32
+ if (scriptname.find("/") != 0)
+- scriptname = szUserDataFolder + "scripts/" + scriptname;
++ scriptname = szScriptsFolder + scriptname;
+ #endif
+ std::string scriptparams = "";
+ int pindex = scriptname.find(' ');
+diff --git a/main/WebServer.cpp b/main/WebServer.cpp
+index f8471791..d2cf10b2 100644
+--- a/main/WebServer.cpp
++++ b/main/WebServer.cpp
+@@ -59,6 +59,7 @@
+
+ #define round(a) ( int ) ( a + .5 )
+
++extern std::string szScriptsFolder;
+ extern std::string szUserDataFolder;
+ extern std::string szWWWFolder;
+
+@@ -2987,9 +2988,9 @@ namespace http {
+ if (scriptname.find("..") != std::string::npos)
+ return;
+ #ifdef WIN32
+- scriptname = szUserDataFolder + "scripts\\" + scriptname;
++ scriptname = szScriptsFolder + scriptname;
+ #else
+- scriptname = szUserDataFolder + "scripts/" + scriptname;
++ scriptname = szScriptsFolder + scriptname;
+ #endif
+ if (!file_exist(scriptname.c_str()))
+ return;
+diff --git a/main/domoticz.cpp b/main/domoticz.cpp
+index 5ef96f68..52599b14 100644
+--- a/main/domoticz.cpp
++++ b/main/domoticz.cpp
+@@ -136,6 +136,7 @@ static const _facilities facilities[] =
+ };
+ std::string logfacname = "user";
+ #endif
++std::string szScriptsFolder;
+ std::string szStartupFolder;
+ std::string szUserDataFolder;
+ std::string szWWWFolder;
+@@ -696,6 +697,19 @@ int main(int argc, char**argv)
+ szUserDataFolder = szroot;
+ }
+
++ szScriptsFolder=szStartupFolder;
++ if (cmdLine.HasSwitch("-scripts"))
++ {
++ if (cmdLine.GetArgumentCount("-scripts") != 1)
++ {
++ _log.Log(LOG_ERROR, "Please specify a path for scripts directory");
++ return 1;
++ }
++ std::string szroot = cmdLine.GetSafeArgument("-scripts", 0, "");
++ if (szroot.size() != 0)
++ szScriptsFolder = szroot;
++ }
++
+ if (cmdLine.HasSwitch("-startupdelay"))
+ {
+ if (cmdLine.GetArgumentCount("-startupdelay") != 1)
+diff --git a/main/mainworker.cpp b/main/mainworker.cpp
+index 803690e1..e89a783b 100644
+--- a/main/mainworker.cpp
++++ b/main/mainworker.cpp
+@@ -159,6 +159,7 @@
+
+ #define round(a) ( int ) ( a + .5 )
+
++extern std::string szScriptsFolder;
+ extern std::string szStartupFolder;
+ extern std::string szUserDataFolder;
+ extern std::string szWWWFolder;
+@@ -1473,8 +1474,8 @@ void MainWorker::Do_Work()
+ m_sql.GetPreferencesVar("ReleaseChannel", nValue);
+ bool bIsBetaChannel = (nValue != 0);
+
+- std::string scriptname = szUserDataFolder + "scripts/download_update.sh";
+- std::string strparm = szUserDataFolder;
++ std::string scriptname = szScriptsFolder + "download_update.sh";
++ std::string strparm = szScriptsFolder;
+ if (bIsBetaChannel)
+ strparm += " /beta";
+
+diff --git a/notifications/NotificationHTTP.cpp b/notifications/NotificationHTTP.cpp
+index decff3b4..632e4e66 100644
+--- a/notifications/NotificationHTTP.cpp
++++ b/notifications/NotificationHTTP.cpp
+@@ -6,7 +6,7 @@
+ #include "../main/SQLHelper.h"
+ #include "../main/Logger.h"
+
+-extern std::string szUserDataFolder;
++extern std::string szScriptsFolder;
+
+ CNotificationHTTP::CNotificationHTTP() : CNotificationBase(std::string("http"), OPTIONS_NONE)
+ {
+@@ -105,7 +105,7 @@ bool CNotificationHTTP::SendMessageImplementation(
+ std::string scriptparams = "";
+ #if !defined WIN32
+ if (scriptname.find("/") != 0)
+- scriptname = szUserDataFolder + "scripts/" + scriptname;
++ scriptname = szScriptsFolder + scriptname;
+ #endif
+ //Add parameters
+ uPos = scriptname.find(" ");
+diff --git a/push/GooglePubSubPush.cpp b/push/GooglePubSubPush.cpp
+index 359a7d7c..46e489f6 100644
+--- a/push/GooglePubSubPush.cpp
++++ b/push/GooglePubSubPush.cpp
+@@ -22,7 +22,7 @@ extern "C" {
+ using namespace boost::python;
+ #endif
+
+-extern std::string szUserDataFolder;
++extern std::string szScriptsFolder;
+
+ // this should be filled in by the preprocessor
+ extern const char * Python_exe;
+@@ -231,11 +231,11 @@ void CGooglePubSubPush::DoGooglePubSubPush()
+
+ #ifdef ENABLE_PYTHON_DECAP
+ #ifdef WIN32
+- python_DirT << szUserDataFolder << "scripts\\python\\";
+- std::string filename = szUserDataFolder + "scripts\\python\\" + "googlepubsub.py";
++ python_DirT << szScriptsFolder << "python\\";
++ std::string filename = szScriptsFolder + "python\\" + "googlepubsub.py";
+ #else
+- python_DirT << szUserDataFolder << "scripts/python/";
+- std::string filename = szUserDataFolder + "scripts/python/" + "googlepubsub.py";
++ python_DirT << szScriptsFolder << "python/";
++ std::string filename = szScriptsFolder + "python/" + "googlepubsub.py";
+ #endif
+
+ wchar_t * argv[1];
+diff --git a/scripts/dzVents/runtime/dzVents.lua b/scripts/dzVents/runtime/dzVents.lua
+index d0dfa869..8370d6a9 100644
+--- a/scripts/dzVents/runtime/dzVents.lua
++++ b/scripts/dzVents/runtime/dzVents.lua
+@@ -1,8 +1,9 @@
+ local currentPath = globalvariables['script_path']
++local generatedScriptPath = globalvariables['generated_script_path']
+ local triggerReason = globalvariables['script_reason']
+
+ _G.scriptsFolderPath = currentPath .. 'scripts' -- global
+-_G.generatedScriptsFolderPath = currentPath .. 'generated_scripts' -- global
++_G.generatedScriptsFolderPath = generatedScriptPath -- global
+ _G.dataFolderPath = currentPath .. 'data' -- global
+
+ package.path = package.path .. ';' .. currentPath .. '?.lua'
+@@ -10,7 +11,7 @@ package.path = package.path .. ';' .. currentPath .. 'runtime/?.lua'
+ package.path = package.path .. ';' .. currentPath .. 'runtime/device-adapters/?.lua'
+ package.path = package.path .. ';' .. currentPath .. 'dzVents/?.lua'
+ package.path = package.path .. ';' .. currentPath .. 'scripts/?.lua'
+-package.path = package.path .. ';' .. currentPath .. 'generated_scripts/?.lua'
++package.path = package.path .. ';' .. generatedScriptPath .. '?.lua'
+ package.path = package.path .. ';' .. currentPath .. 'data/?.lua'
+
+ local EventHelpers = require('EventHelpers')
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=fb63bdc2a61f0169b3c21b33bcdc99f202685b78
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=efb2580509cf13a769cffd1982433d29acd64a5c115793417fd36d9d5f73c9e8
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_SOURCE:=dvtm-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.brain-dump.org/projects/dvtm/
-PKG_MD5SUM:=887e162a3abe2ad8e86caefab20cdd63
+PKG_HASH:=8f2015c05e2ad82f12ae4cf12b363d34f527a4bbc8c369667f239e4542e1e510
PKG_MAINTAINER:=Yunfan Jiang <jyf1987@gmail.com>
PKG_LICENSE:=MIT/X
PKG_REV:=07538893fb6c2a9539678c45f9dbbf1e4f222b46
PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=397395a471c0b5af1a173666ba21a5bedb4c3423a6e37c545c3627bed73dcb76
PKG_SOURCE_URL:=git://github.com/tcatm/$(PKG_NAME).git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=9716be17dadc496f15861e41e17980be9d444de856bc2e5b9a732f9ce826b8dd
PKG_SOURCE_URL:=git://anongit.freedesktop.org/evtest
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=9936aa8009438ce185bea2694a997fc1
+PKG_HASH:=ded4c9f73731cd48fec3b6bdaccce896473b6d8e337e9612e16cf1431bb1169d
PKG_MAINTAINER:=Daniel Dickinson <lede@daniel.thecshore.com>
PKG_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://download.flashrom.org/releases
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_MD5SUM:=aab9c98925d9cfb5ffb28b67a6112530
+PKG_HASH:=cb3156b0f63eb192024b76c0814135930297aac41f80761a5d293de769783c45
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
PKG_LICENSE:=GPLv3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_MIRROR_HASH:=0c4a99179a76e8479bdc7d91c312de7fc9e6d4d54132d1b2aba836138c86440c
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/tohojo/flent
PKG_REV:=03c72cc340def354024351b6500774b11170d5ba
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://fontconfig.org/release/
-PKG_MD5SUM:=824d000eb737af6e16c826dd3b2d6c90
+PKG_HASH:=dc62447533bca844463a3c3fd4083b57c90f18a70506e7a9f4936b5a1e516a99
PKG_FIXUP:=libtool
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/gawk
-PKG_MD5SUM:=53e184e2d0f90def9207860531802456322be091c7b48f23fdc79cda65adc266
+PKG_HASH:=53e184e2d0f90def9207860531802456322be091c7b48f23fdc79cda65adc266
PKG_LICENSE:=GPL
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=gku100.tar.gz
PKG_SOURCE_URL:=ftp://kermit.columbia.edu/kermit/archives
-PKG_MD5SUM:=aea4fa728b9981fce41c9f2c635f2e05
+PKG_HASH:=3dbe63291277c4795255343b48b860777fb0a160163d7e1d30b1ee68585593eb
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Nathaniel Wesley Filardo <nwfilardo@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.franken.de/pub/crypt/mirror/ftp.gnupg.org/gcrypt/gnupg \
ftp://ftp.gnupg.org/gcrypt/gnupg
-PKG_MD5SUM:=9bdeabf3c0f87ff21cb3f9216efdd01d
PKG_HASH:=6b47a3100c857dcab3c60e6152e56a997f2c7862c1b8b2b25adf3884a1ae2276
PKG_LICENSE:=GPL-3.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME)
-PKG_MD5SUM:=68691b5de4c94f82ec4062b042b5eb63
+PKG_HASH:=03579af13a4d3fe0c5b79fa44b5f75c9f3cac6749357f1d99ce5d38c09bc2029
PKG_MAINTAINER:=Pushpal Sidhu <psidhu.devel@gmail.com>
PKG_LICENSE:=BSD-3-Clause
+++ /dev/null
-#
-# Copyright (C) 2016 Daniel Engberg <daniel.engberg.lists@pyret.net>
-#
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gptfdisk
-PKG_VERSION:=1.0.1
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/gptfdisk
-PKG_MD5SUM:=d7f3d306b083123bcc6f5941efade586
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/gptfdisk/default
- SECTION:=utils
- CATEGORY:=Utilities
- SUBMENU:=Disc
- URL:=http://www.rodsbooks.com/gdisk
- MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
-endef
-
-define Package/gdisk
- $(call Package/gptfdisk/default)
- TITLE:=GPT partition table manipulation utility
- DEPENDS:=+libstdcpp +libuuid +libpopt
-endef
-
-define Package/gdisk/description
- GPT partition table manipulation utility with an interface
- similar to fdisk. It can read and convert MBR partitions in GPT
- but is otherwise unable to generate or modify MBR partitions.
-endef
-
-define Package/sgdisk
- $(call Package/gptfdisk/default)
- TITLE:=script-friendly GPT partition table manipulation utility
- DEPENDS:=+libstdcpp +libuuid +libpopt
-endef
-
-define Package/sgdisk/description
- Script-friendly GPT partition table manipulation utility.
- It can read and convert MBR partitions in GPT but is otherwise
- unable to generate or modify MBR partitions.
- To the contrary of gdisk, its interface is geared towards scripts,
- so it takes command line arguments instead of being interactive.
- It will NOT ask confirmation before carrying out the operations.
- It has a slightly smaller footprint than gdisk tool.
-endef
-
-define Package/cgdisk
- $(call Package/gptfdisk/default)
- TITLE:=ncurses-based GPT partition table manipulation utility
- DEPENDS:=+libstdcpp +libuuid +libncurses +libpopt
-endef
-
-define Package/cgdisk/description
-ncurses-based partition table manipulation utility with GPT support.
-Similar to sfdisk, but works with GPT partitions. Shares the same limitations
-of the gdisk partition utility. While it can read and convert MBR partitions
-in GPT, it cannot modify MBR partitions on its own.
-endef
-
-define Package/gdisk/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/gdisk $(1)/usr/sbin
-endef
-
-define Package/sgdisk/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/sgdisk $(1)/usr/sbin
-endef
-
-define Package/cgdisk/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/cgdisk $(1)/usr/sbin
-endef
-
-$(eval $(call BuildPackage,gdisk))
-$(eval $(call BuildPackage,sgdisk))
-$(eval $(call BuildPackage,cgdisk))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/grep
-PKG_MD5SUM:=afdd61c7221434722671baf002ac9267
+PKG_HASH:=246a8fb37e82aa33d495b07c22fdab994c039ab0f818538eac81b01e78636870
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/gzip
-PKG_MD5SUM:=c4abae2ddd5c6f39c6f8169693cc7ac0
+PKG_HASH:=eccbaa178c7801618c887956f1668d45bb57863a9d2678bfc3e36d01fb951904
PKG_LICENSE:=GPL-3.0+
PKG_INSTALL:=1
PKG_NAME:=hamlib
PKG_VERSION:=3.0.1
PKG_RELEASE:=1
-PKG_MD5SUM:=451acb9f727ed706ae2f59ee3f0e03c7
+PKG_HASH:=3fec97ea326d02aa8f35834c4af34194a3f544e6212f391397d788c566b44e32
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/hamlib
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/haserl
-PKG_MD5SUM:=918f0b4f6cec0b438c8b5c78f2989010
+PKG_HASH:=a1b633e80f3e2638e7f8f850786e95072cfd9877f88780092996fd6aaf7ae2da
PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/haveged \
http://www.issihosts.com/$(PKG_NAME)
-PKG_MD5SUM:=9c2363ed9542a6784ff08e247182137e71f2ddb79e8e6c1ac4ad50d21ced3715
+PKG_HASH:=9c2363ed9542a6784ff08e247182137e71f2ddb79e8e6c1ac4ad50d21ced3715
PKG_LICENSE:=GPLv3
PKG_MAINTAINER:=Hannu Nyman <hannu.nyman@iki.fi>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=41e52e669fc59fa82ee0c2bcce1336d3
+PKG_HASH:=308e90104d7ee8124db50dc9b0d8c61c6afc65d524de2e75f76d84f80674fbdc
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=d380062ad6c4b40076736efbb640f1f5
+PKG_HASH:=0892b44bd817c251264a24f6ecbbb010958033e0395d2030f25f1c5608ac780e
PKG_MAINTAINER:=Richard Kunze <richard.kunze@web.de>
PKG_LICENSE:=BSD-Style Open Source License
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
PKG_SOURCE_URL:=http://archive.ubuntu.com/ubuntu/pool/universe/h/$(PKG_NAME)
PKG_BUILD_DIR:=$(BUILD_DIR)/diskdev_cmds-$(PKG_VERSION)
-PKG_MD5SUM:=261c3de5ec0dcf5244e3f60d79c1d6f1
+PKG_HASH:=74c9aeca899ed7f4bf155c65fc45bf0f250c0f6d57360ea953b1d536d9aa45e6
PKG_LICENSE:=APSL 2.0
include $(INCLUDE_DIR)/package.mk
PKG_MAINTAINER:=Simon Peter <probono@puredarwin.org>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=98ffd9ead07d6208acf7f713dc6574877d4967bdfb47bf70444ec9d44399faaa
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
http://fossies.org/linux/misc/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=7104a1043d11a5e2c7b131614eb1b962
+PKG_HASH:=db5e69f2e2a6e3aa2ecdfe6a5f490b149c504468770f58921c8c5b8a7860a441
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=PACKAGE_python-smbus:python
PKG_SOURCE_URL:=@SF/joe-editor
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=59e63debe60b456a6ee5c0c27a756a47
+PKG_HASH:=a5704828bbca29acb9e200414fef522c66cdf9ce28150f402d6767da43460979
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Vitaly Protsko <villy@sft.ru>
PKG_LICENCE:=GPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/stedolan/jq/releases/download/jq-$(PKG_VERSION)/
-PKG_MD5SUM:=0933532b086bd8b6a41c1b162b1731f9
+PKG_HASH:=c4d2bfec6436341113419debf479d833692cc5cdab7eb0326b5a4d4fbe9f493c
PKG_INSTALL:=1
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENCE
PKG_MAINTAINER:=Takashi Umeno <umeno.takashi@gmail.com>
-PKG_MD5SUM:=7dfe46d474c02c86946c1d7a461ae549
+PKG_HASH:=70528039da9c5fdfadaea325ab6243cdabef627da0398335312e08d90ab415f8
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.kernel.org/pub/linux/utils/kernel/kmod/
-PKG_MD5SUM:=d6f4fef718a50bd88080de6a43bc64d8
+PKG_HASH:=89c1a1a2193c31f9ebe582640bfa2bd401341dc24119f5a7f702588116fadaa0
PKG_MAINTAINER:=Jeff Waugh <jdub@bethesignal.org>
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=COPYING
include $(TOPDIR)/rules.mk
PKG_NAME:=lcdproc
-# PKG_VERSION:=0.5.8
-PKG_BASE_VERSION:=0.5.8
-PKG_VERSION:=$(PKG_BASE_VERSION)+git2070222
-PKG_RELEASE:=3
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/lcdproc/lcdproc.git
-PKG_SOURCE_VERSION:=156983afab6d8f49d9a84e2a0929874eac569cc3
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_BASE_VERSION)
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_BASE_VERSION)
-
-#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-#PKG_SOURCE_URL:=https://github.com/lcdproc/lcdproc/releases/download/v$(PKG_VERSION)/
-#PKG_MD5SUM:=1dd25676946c61184c6f51cc0a75379e
+PKG_VERSION:=0.5.9
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/lcdproc/lcdproc/releases/download/v$(PKG_VERSION)/
+PKG_HASH:=d48a915496c96ff775b377d2222de3150ae5172bfb84a6ec9f9ceab962f97b83
PKG_MAINTAINER:=Harald Geyer <harald@ccbib.org>, \
Philip Prindeville <philipp@redfish-solutions.com>
PKG_LICENSE:=GPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.greenwoodsoftware.com/less
-PKG_MD5SUM:=50ef46065c65257141a7340123527767
+PKG_HASH:=3fa38f2cf5e9e040bb44fffaa6c76a84506e379e47f5a04686ab78102090dda5
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_VERSION:=f8cdcc35bff0785aecf49d9a8484a71ce3ebee4f
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=892e9e2eed78e27fb7a08e8ce78b1164a3d101ba79a9e04f1c1273940d48cf17
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=GPL-2.0+ LGPL-2.1+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= https://github.com/logrotate/logrotate/releases/download/$(PKG_VERSION)
-PKG_MD5SUM:=888f58caf07082c76f5dd39e5d30ec12
+PKG_HASH:=dbc76cae5d4912455b5221654bb6114e43d91a3a0879ce3e20a62a157532912e
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://ohse.de/uwe/releases/
-PKG_MD5SUM:=b5ce6a74abc9b9eb2af94dffdfd372a4
+PKG_HASH:=c28b36b14bddb014d9e9c97c52459852f97bd405f89113f30bee45ed92728ff1
PKG_MAINTAINER:=Hsing-Wang Liao <kuoruan@gmail.com>
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://sunsite.ualberta.ca/pub/Mirror/lsof/ ftp://ftp.fu-berlin.de/pub/unix/tools/lsof
-PKG_MD5SUM:=1b9cd34f3fb86856a125abbf2be3a386
+PKG_HASH:=81ac2fc5fdc944793baf41a14002b6deb5a29096b387744e28f8c30a360a3718
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)
PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
PKG_LICENSE:=Unique
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://linuxcontainers.org/downloads/lxc/
-PKG_MD5SUM:=dd9684dde0a58ed13f4f49c855b79a1a
+PKG_HASH:=9588ad1b04e114ee7370f690c65131e28098b28d2521d97c73557d11897ed0be
PKG_BUILD_DEPENDS:=lua
PKG_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/alobbs/macchanger/releases/download/$(PKG_VERSION)/
-PKG_MD5SUM:=ca56f16142914337391dac91603eb332
+PKG_HASH:=dae2717c270fd5f62d790dbf80c19793c651b1b26b62c101b82d5fdf25a845bf
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_URL:=https://github.com/webstack/mbtools.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=149e9c69cec180f18cf8781cf5285b97352bf719
-PKG_MIRROR_HASH:=1e6e2f0e40b1c596bb55279bcedfac5a8deb86ef56978dce01a78877151c9352
+PKG_MIRROR_HASH:=3aed4146e06bd9f9bcc271824c6b1d75d1fc2a0bd980f2b729c3b4755c6f70a8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_FIXUP:=autoreconf
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/3977/
-PKG_MD5SUM:=7044ca3e291268c33294f171d426dc2d
+PKG_HASH:=9ac3a663b82f4f5df64114b4792b9926b536c85f59de0f2d2b321c7626a904f4
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-2.0
include $(TOPDIR)/rules.mk
PKG_NAME:=mksh
-PKG_VERSION:=54
+PKG_VERSION:=55
PKG_RELEASE:=1
PKG_MAINTAINER:=Thorsten Glaser <tg@mirbsd.org>
PKG_SOURCE:=$(PKG_NAME)-R$(PKG_VERSION).tgz
PKG_SOURCE_URL:=http://www.mirbsd.org/MirOS/dist/mir/mksh \
- http://pub.allbsd.org/MirOS/dist/mir/mksh/
-PKG_MD5SUM:=be0a6fb93b4a5f927bcc1893bb6692f8
+ http://pub.allbsd.org/MirOS/dist/mir/mksh
+PKG_HASH:=ced42cb4a181d97d52d98009eed753bd553f7c34e6991d404f9a8dcb45c35a57
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
CC="$(TARGET_CC)" \
TARGET_OS="$(shell uname -s)" \
CFLAGS="$(TARGET_CFLAGS)" \
- CPPFLAGS="-DMKSH_SMALL=1 -DMKSH_ASSUME_UTF8=0 -DMKSH_BINSHPOSIX" \
+ CPPFLAGS="-DMKSH_SMALL=1 -DMKSH_ASSUME_UTF8=0 -DMKSH_BINSHPOSIX -DMKSHRC_PATH=\\\"/etc/mkshrc\\\"" \
HAVE_CAN_FSTACKPROTECTORALL=0 \
HAVE_CAN_FSTACKPROTECTORSTRONG=0 \
LDFLAGS="$(TARGET_LDFLAGS)" \
-Refreshed for mksh-r54, based on tg's patch
-
From 23712cea8e2a623fd952eb781df0011c501703d0 Mon Sep 17 00:00:00 2001
From: Thorsten Glaser <tg@mirbsd.org>
Date: Thu, 25 Jul 2013 22:07:33 +0200
- ls(1) has no -o option
* OpenWrt and FreeWRT-1.0 fix:
- since this is not ~/.mkshrc make sure subshells find it
+
+From: Alif M. A. <alive4ever@live.com>
+Date: Thu, 20 Jul 2017 14:52:39 +0000
+Subject: [PATCH] Refresh 100-dot_mkshrc for mksh-R55
+
+Additional changes of the patch as of mksh-R55
+* Use content of `/proc/sys/kernel/hostname` to set `$HOSTNAME`, since
+ `hostname` applet isn't compiled into `busybox`.
+* Use `/bin/vi` as fallback `$EDITOR`.
+* Use `/etc/mkshrc` as default startup file, so there is no need to
+ manually source it during interactive session.
+
---
+Reviewed-by: Thorsten Glaser <tg at mirbsd.org>
Signed-off-by: Alif M. A. <alive4ever at live.com>
+
--- a/dot.mkshrc
+++ b/dot.mkshrc
-@@ -28,8 +28,9 @@
- *) return 0 ;;
- esac
-
--PS1='#'; (( USER_ID )) && PS1='$'; \: "${TERM:=vt100}${HOSTNAME:=$(\ulimit -c \
-- 0; hostname 2>/dev/null)}${EDITOR:=/bin/ed}${USER:=$(\ulimit -c 0; id -un \
-+PS1='#'; (( USER_ID )) && PS1='$'; \: "${HOSTNAME:=$(</proc/sys/kernel/hostname\
-+ )} = *([ ]|localhost) && HOSTNAME=$(\ulimit -c \
-+ 0; hostname 2>/dev/null)}${EDITOR:=/bin/vi}${USER:=$(\ulimit -c 0; id -un \
- 2>/dev/null || \echo \?)}${MKSH:=$(\builtin whence -p mksh)}"
- HOSTNAME=${HOSTNAME%%*([ ]).*}; HOSTNAME=${HOSTNAME##*([ ])}
- [[ $HOSTNAME = ?(ip6-)localhost?(6) ]] && HOSTNAME=
-@@ -52,7 +53,7 @@
- \alias l='ls -F'
- \alias la='l -a'
- \alias ll='l -l'
--\alias lo='l -alo'
-+\alias lo='l -al'
- \alias doch='sudo mksh -c "$(\builtin fc -ln -1)"'
- \command -v rot13 >/dev/null || \alias rot13='tr \
- abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \
-@@ -600,4 +601,8 @@
+@@ -56,10 +56,9 @@
+ done
+ )
- \unset p
+-\\builtin alias ls=ls l='ls -F' la='l -a' ll='l -l' lo='l -alo'
+-\: "${HOSTNAME:=$(\\builtin ulimit -c 0; \\builtin print -r -- $(hostname \
+- 2>/dev/null))}${EDITOR:=/bin/ed}${TERM:=vt100}${USER:=$(\\builtin ulimit \
+- -c 0; id -un 2>/dev/null)}${USER:=?}"
++\\builtin alias ls=ls l='ls -F' la='l -a' ll='l -l' lo='l -al'
++\: "${HOSTNAME:=$(</proc/sys/kernel/hostname)}${EDITOR:=/bin/vi}${TERM:=vt100}\
++ ${USER:=$(\\builtin ulimit -c 0; id -un 2>/dev/null)}${USER:=?}"
+ [[ $HOSTNAME = ?(?(ip6-)localhost?(6)) ]] && HOSTNAME=nil; \\builtin unalias ls
+ \\builtin export EDITOR HOSTNAME TERM USER
-+# we need this in OpenWrt for subshells that are not login shells
-+\: ${ENV=/etc/mkshrc}
-+[[ -z $ENV ]] || export ENV
-+
- \: place customisations above this line
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.sourceforge.net/$(PKG_NAME)/
-PKG_MD5SUM:=0da00209da96a0dc39efbb6eb5b4d8ff
+PKG_HASH:=6f8e562af6366e0d9bde76e434f740b55722c6c3c555860dbe80083f9d1d119f
include $(INCLUDE_DIR)/package.mk
PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git
PKG_SOURCE_DATE:=2017-03-20
PKG_SOURCE_VERSION:=37c86e60c0442fef570b75cd81aeb1db4d0cbafd
-PKG_MIRROR_HASH:=fc49fce4f592ffdc2a9c8f453ea96b28eb3ece0c6303ed73462cc61fb5b63318
+PKG_MIRROR_HASH:=652958e818d984804be6846ba504961f31c6e98414d0d34ec7a0d76d0844584a
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://ftp.andrew.cmu.edu/pub/mpack/
-PKG_MD5SUM:=a70fa5afa76539a9afb70b9d81568fe8
+PKG_HASH:=274108bb3a39982a4efc14fb3a65298e66c8e71367c3dabf49338162d207a94c
PKG_INSTALL:=1
PKG_SOURCE_VERSION:=$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://ftp.ibiblio.org/pub/Linux/system/backup/
-PKG_MD5SUM:=fdd5f5ec673c9f630a102ceff7612774
+PKG_HASH:=945cb4f3d9957dabe768f5941a9148b746396836c797b25f020c84319ba8170d
PKG_LICENSE:=GPL-2.0
http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.1/ \
http://mirror.switch.ch/ftp/mirror/mysql/Downloads/MySQL-5.1/
-PKG_MD5SUM:=887f869bcc757957067b9198f707f32f
+PKG_HASH:=05ebe21305408b24407d14b77607a3e5ffa3c300e03f1359d3066f301989dcb5
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=GPL-2.0
include $(TOPDIR)/rules.mk
PKG_NAME:=nano
-PKG_VERSION:=2.8.4
+PKG_VERSION:=2.8.7
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/nano
-PKG_HASH:=c7cf264f0f3e4af43ecdbc4ec72c3b1e831c69a1a5f6512d5b0c109e6bac7b11
+PKG_HASH:=fbe31746958698d73c6726ee48ad8b0612697157961a2e9aaa83b4aa53d1165a
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
--- /dev/null
+From 28cfab7580c42a6d6c9c5d787ce736094fd51a0c Mon Sep 17 00:00:00 2001
+From: Benno Schulenberg <bensberg@telfort.nl>
+Date: Tue, 29 Aug 2017 19:28:44 +0200
+Subject: tweaks: fix compilation when configured with --enable-tiny
+
+When moving the cursor to the top-left corner, it is not necessary
+to compute leftedge because firstcolumn IS the relevant leftedge.
+
+Reported-by: Jordi Mallach <jordi@debian.org>
+---
+ src/move.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/move.c b/src/move.c
+index d138356..ce276e4 100644
+--- a/src/move.c
++++ b/src/move.c
+@@ -121,7 +121,7 @@ void do_page_up(void)
+ openfile->current = openfile->edittop;
+ openfile->current_y = 0;
+
+- leftedge = leftedge_for(openfile->firstcolumn, openfile->edittop);
++ leftedge = openfile->firstcolumn;
+ target_column = 0;
+ } else
+ get_edge_and_target(&leftedge, &target_column);
+@@ -152,7 +152,7 @@ void do_page_down(void)
+ openfile->current = openfile->edittop;
+ openfile->current_y = 0;
+
+- leftedge = leftedge_for(openfile->firstcolumn, openfile->edittop);
++ leftedge = openfile->firstcolumn;
+ target_column = 0;
+ } else
+ get_edge_and_target(&leftedge, &target_column);
+--
+cgit v1.0-41-gc330
+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://dev.yorhel.nl/download
-PKG_MD5SUM:=7365ac46c420bc511621216b1747984f
+PKG_HASH:=820e4e4747a2a2ec7a2e9f06d2f5a353516362c22496a10a9834f871b877499a
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_VERSION:=2.6.2
PKG_RELEASE:=1
PKG_SOURCE:=oath-toolkit-$(PKG_VERSION).tar.gz
+PKG_HASH:=b03446fa4b549af5ebe4d35d7aba51163442d255660558cd861ebce536824aa0
PKG_SOURCE_URL:=@SAVANNAH/oath-toolkit
-PKG_SOURCE_MD5SUM:=4a05cd4768764843bd5493609a6bdb17
PKG_LICENSE:=LGPL-2.0+ GPL-3.0+
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=18b7e2a9a17f043fe8ac8b457680aafb1c249c55
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=fd898954f3a7f4f1f1b02a61b748546d648e323642c004353aeb4b337dbaa5dc
PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-Source
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-Source.tar.gz
PKG_SOURCE_URL:=@SF/openobex
-PKG_MD5SUM:=3181bfed9cb7db591605391068cb0085
+PKG_HASH:=3b264665d90901ea4ff720332ffb9b6d1d8f67187463d3a3279caddc7205ea57
PKG_LICENSE:=GPL-2.0+ LGPL-2.1+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=ef8a71daa581a3a2296fd3dafff21de2ca7b86319ec3a5c24ed6a216d1fdff45
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_NAME:=opensc
PKG_VERSION:=0.16.0
PKG_RELEASE:=1
-PKG_MD5SUM:=3ac8c29542bb48179e7086d35a1b8907a4e86aca3de3323c2f48bd74eaaf5729
+PKG_HASH:=3ac8c29542bb48179e7086d35a1b8907a4e86aca3de3323c2f48bd74eaaf5729
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.xiph.org/releases/opus/
-PKG_MD5SUM:=20682e4d8d1ae9ec5af3cf43e808b8cb
+PKG_HASH:=b1873dd78c7fbc98cf65d6e10cfddb5c2c03b3af93f922139a2104baedb4643a
PKG_LICENSE:=BSD-2-Clause
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=b5c20998e8ffc6fa3974daef99c02402
+PKG_HASH:=f7e11bae6cd29d58726e6d29b297834e5656d6069a407d798067ae25cb0812ea
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=GPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
-PKG_MD5SUM:=3a99141a9f40528d0a0035665a06dc37ddb1ae341658e51b50a76ecf86235efc
+PKG_HASH:=3a99141a9f40528d0a0035665a06dc37ddb1ae341658e51b50a76ecf86235efc
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/pcmcia
-PKG_MD5SUM:=5d85669b3440baa4532363da6caaf1b4
+PKG_HASH:=79e6ae441278e178c07501d492394ed2c0326fdb66894f6d040ec811b0dc8ed5
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://picocom.googlecode.com/files
-PKG_MD5SUM:=8eaba1d31407e8408674d6e57af447ef
+PKG_HASH:=d0f31c8f7a215a76922d30c81a52b9a2348c89e02a84935517002b3bc2c1129e
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=0deb9c7e135e9380a6d09e9d2e938a146bb698c8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MIRROR_HASH:=46bd7acf9a0f8fec1858496844ba0ef2f9525a22ac8c5c61b3fc4f2dc5881f33
PKG_MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
PKG_LICENSE:=GPL-2.0
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=8a198e3eafbde0b627e9992b41d26e6762e4f8c7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=60da7bd78e834112494e4019998c9de8d61f747eab244ef3c42cadc7fd0958cc
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_SOURCE_VERSION:=f6894b827c638af5cf8c5c622e66491c179ba2eb
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MIRROR_HASH:=143047dd44f78c10763446097bcadc551e99a7a8fefc484ef5a65d7bcbe8c181
PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
PKG_LICENSE:=GPL-3.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.ivarch.com/programs/sources/
-PKG_MD5SUM:=efe8e9e4cad5f3264a32258a63bf2c8e
+PKG_HASH:=76f3999b1c3b3027163dce6ef667cdf8dafb75218ee25e54a03bfe590478f90e
PKG_LICENSE:=Artistic-2.0
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_VERSION:=2.6.2
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_HASH:=9a7ec64f147b9e1e570c410e00ebe271869b5d4c85392ba047db7617c297faa3
PKG_SOURCE_URL:=http://wiki.qemu-project.org/download/
-PKG_SOURCE_MD5SUM:=bdf1f3d0c177ebeb35a079a4bc3fc74e
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE tcg/LICENSE
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/relayctl/relayctl-$(PKG_VERSION)
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
-PKG_MD5SUM:=24c848e0d705421dcd6accfffa31f704
+PKG_HASH:=74ce41ebd5d18816d52b5f9b1071f658f5a814b8194257f20700214bbee9de1e
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/gkernel/rng-tools/$(PKG_VERSION)/
-PKG_MD5SUM:=6726cdc6fae1f5122463f24ae980dd68
+PKG_HASH:=60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=Nathaniel Wesley Filardo <nwfilardo@gmail.com>
--- /dev/null
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=rpcd-mod-attendedsysupgrade
+PKG_VERSION:=1
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/rpcd-mod-attendedsysupgrade
+ SECTION:=utils
+ CATEGORY:=Base system
+ TITLE:=OpenWrt ubus RPC backend server (attendedsysupgrade)
+ MAINTAINER:=Paul Spooren <paul@spooren.de>
+ DEPENDS:=rpcd +cgi-io +rpcd-mod-packagelist
+endef
+
+define Package/rpcd-mod-attendedsysupgrade/description
+ implements sysupgrade function with ubus
+ add uci settings and needed acls
+endef
+
+define Build/Compile
+endef
+
+define Build/Configure
+endef
+
+define Package/rpcd-mod-attendedsysupgrade/install
+ $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d/
+ $(INSTALL_BIN) ./files/attendedsysupgrade.acl $(1)/usr/share/rpcd/acl.d/attendedsysupgrade.json
+
+ $(INSTALL_DIR) $(1)/usr/libexec/rpcd/
+ $(INSTALL_BIN) ./files/attendedsysupgrade.rpcd $(1)/usr/libexec/rpcd/attendedsysupgrade
+
+ $(INSTALL_DIR) $(1)/etc/uci-defaults/
+ $(INSTALL_BIN) ./files/attendedsysupgrade.defaults $(1)/etc/uci-defaults/attendedsysupgrade
+endef
+
+$(eval $(call BuildPackage,rpcd-mod-attendedsysupgrade))
--- /dev/null
+{
+ "attendedsysupgrade": {
+ "description": "attended sysupgrade via rpcd",
+ "read": {
+ "ubus": {
+ "attendedsysupgrade": [
+ "sysupgrade"
+ ],
+ "system": [
+ "board"
+ ],
+ "uci": [
+ "get"
+ ]
+ },
+ "uci": [
+ "*"
+ ]
+ },
+ "write": {
+ "cgi-io": [
+ "upload"
+ ]
+ }
+ }
+}
--- /dev/null
+#!/bin/sh
+
+[ -e /etc/config/attendedsysupgrade ] && exit 0
+
+touch /etc/config/attendedsysupgrade
+
+uci -q batch <<EOF
+set attendedsysupgrade.updateserver=updateserver
+set attendedsysupgrade.updateserver.url='https://betaupdate.libremesh.org'
+
+set attendedsysupgrade.updateclient=updateclient
+set attendedsysupgrade.updateclient.update_packages='1'
+
+commit attendedsysupgrade
+EOF
+
+exit 01
--- /dev/null
+#!/bin/sh
+
+. /usr/share/libubox/jshn.sh
+
+case "$1" in
+ list)
+ json_init
+ json_add_object "sysupgrade"
+ json_add_boolean "keep_settings" 1
+ json_close_object
+ json_dump
+ ;;
+ call)
+ case "$2" in
+ sysupgrade)
+ read input;
+ json_load "$input"
+ json_get_var keep_settings keep_settings
+
+ if [ -f "/tmp/sysupgrade.bin" ]; then
+ /etc/init.d/uhttpd stop
+ /etc/init.d/dropbear stop
+ sleep 1;
+ if [ "$keep_settings" -eq "0" ]; then
+ keep_settings_param="-n"
+ fi
+ /sbin/sysupgrade $keep_settings_param /tmp/sysupgrade.bin
+ fi
+ json_init
+ json_add_string "message" "could not find /tmp/sysupgrade.bin"
+ json_dump
+ esac
+ ;;
+esac
+
--- /dev/null
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=rpcd-mod-packagelist
+PKG_VERSION:=0.1
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/rpcd-mod-packagelist
+ SECTION:=utils
+ CATEGORY:=Base system
+ TITLE:=ubus packagelist
+ MAINTAINER:=Paul Spooren <paul@spooren.de>
+ DEPENDS:=rpcd @!CLEAN_IPKG
+endef
+
+define Package/rpcd-mod-packagelist/description
+ add ubus call to receive user installed packages without the need of opkg installed
+endef
+
+define Build/Compile
+endef
+
+define Build/Configure
+endef
+
+define Package/rpcd-mod-packagelist/install
+ $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d/
+ $(INSTALL_BIN) ./files/packagelist.acl $(1)/usr/share/rpcd/acl.d/packagelist.json
+
+ $(INSTALL_DIR) $(1)/usr/libexec/rpcd/
+ $(INSTALL_BIN) ./files/packagelist.rpcd $(1)/usr/libexec/rpcd/packagelist
+endef
+
+$(eval $(call BuildPackage,rpcd-mod-packagelist))
--- /dev/null
+{
+ "packagelist": {
+ "description": "get list of installed software packages",
+ "read": {
+ "ubus": {
+ "packagelist": [
+ "list"
+ ]
+ }
+ }
+ }
+}
--- /dev/null
+#!/bin/sh
+
+. /usr/share/libubox/jshn.sh
+
+case "$1" in
+list)
+ json_init
+ json_add_object "list"
+ json_dump
+ ;;
+call)
+ case "$2" in
+ list)
+ json_init;
+ json_add_object "packagelist"
+
+ if [ -f /usr/lib/opkg/status ]; then
+ while read var p1 p2 p3; do
+ if [ "$var" = "Package:" ]; then
+ pkg="$p1"
+ fi
+ if [ "$var" = "Version:" ]; then
+ version="$p1"
+ fi
+
+ if [ "$var" = "Status:" \
+ -a "$p1" = "install" \
+ -a "$p2" = "user" \
+ -a "$p3" = "installed" ]; then
+ json_add_string "$pkg" "$version";
+ fi
+ done < /usr/lib/opkg/status
+ fi
+
+ json_close_object
+ json_dump
+ ;;
+ esac
+ ;;
+esac
http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.0.x \
http://www.fastmirrors.org/rrdtool/rrdtool-1.0.x \
ftp://ftp.sunet.se/pub/network/monitoring/rrdtool/rrdtool-1.0.x
-PKG_MD5SUM:=c466e2e7df95fa8e318e46437da87686
+PKG_HASH:=42aa7c213dedbd95d33ca84d92f4187880f7e96062c6a3fb05bfb16f77ba2a91
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=git://github.com/tomojitakasu/RTKLIB.git
PKG_SOURCE_VERSION:=1cec90a9ffa424908ad1a4ca3d52f33f9b94d1f7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=edda6c29ba3d2f5401145a1497e88646fa0c13afc31ade7bdd982bd8e8081c6a
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=BSD-2-Clause
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=b805be0164475e58a73b57763a8cbbf8a2bd0ded
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=0bf15869935e4496108ade4f7e9c1f7990b11ce53c9c1e0c9e81bc7f082b33b5
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_MIRROR_HASH:=6b1a3ae95e6d9e896ec4f8dcca46b7cf5741533bb549d429ac3fd46c76e2d595
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/serialconsole/sc
-PKG_MD5SUM:=4fe58576a5bddb9f1fb3dcfc6410b885
+PKG_HASH:=5ae99b370a5a3feb38372b383edc23012b5be5d81547aeb1ac52b408037c1d1c
PKG_MAINTAINER:=Stefan Bethke <stb@lassitu.de>
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://pkg-shadow.alioth.debian.org/releases
-PKG_MD5SUM:=2bfafe7d4962682d31b5eba65dba4fc8
+PKG_HASH:=3b0893d1476766868cd88920f4f1231c4795652aa407569faff802bcda0f3d41
PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
PKG_LICENSE:=BSD-3-Clause
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=5ff4a05a5bcb6a64a9d6f77fed47014512f66b11
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MIRROR_HASH:=d09782160dbcc1ba3bd6a38941f38e130049d8383843f6f292409909678aed82
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=git://git.code.sf.net/p/sispmctl/git
PKG_MAINTAINER:=Richard Kunze <richard.kunze@web.de>
PKG_SOURCE_VERSION:=9171c2ea9cc9cbfb6f27b7bc25a535c8c35ee534
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=9eb2c599b6b8cd8529f7b25455ac2ac3fe97a9ae2e7eec28aea1e971f4d9112b
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/smartmontools
-PKG_MD5SUM:=093aeec3f8f39fa9a37593c4012d3156
+PKG_HASH:=89e8bb080130bc6ce148573ba5bb91bfe30236b64b1b5bbca26515d4b5c945bc
PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://smstools3.kekekasvi.com/packages/
-PKG_MD5SUM:=0241ef60e646fac1a06254a848e61ed7
+PKG_HASH:=ed00ffaeaa312a5b4f969f4e97a64603a866bbe16e393ea02f5bf05234814d59
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=cc6a41fdcec60610703ba6db488c621c64952898
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=3c37fde79ab09e9a590f4cdb55751083017197d0037a7c0dce56fceef5e05a21
PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
PKG_NAME:=squashfs-tools
PKG_VERSION:=4.3
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=9c1db6d13a51a2e009f0027ef336ce03624eac0d
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=4e9a017561b6f9d7b9782c7c672d224726ffd069b0543f310e85ed8ab1c4589b
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
--- /dev/null
+diff -aurp a/squashfs-tools/unsquash-1.c b/squashfs-tools/unsquash-1.c
+--- a/squashfs-tools/unsquash-1.c 2014-09-18 20:16:18.000000000 -0600
++++ b/squashfs-tools/unsquash-1.c 2017-08-29 13:18:14.403020644 -0600
+@@ -332,17 +332,19 @@ int read_uids_guids_1()
+ guid_table = uid_table + sBlk.no_uids;
+
+ if(swap) {
+- unsigned int suid_table[sBlk.no_uids + sBlk.no_guids];
++ unsigned int* suid_table = malloc((sBlk.no_uids + sBlk.no_guids) * sizeof(unsigned int));
+
+ res = read_fs_bytes(fd, sBlk.uid_start, (sBlk.no_uids +
+ sBlk.no_guids) * sizeof(unsigned int), suid_table);
+ if(res == FALSE) {
++ free(suid_table);
+ ERROR("read_uids_guids: failed to read uid/gid table"
+ "\n");
+ return FALSE;
+ }
+ SQUASHFS_SWAP_INTS_3(uid_table, suid_table,
+ sBlk.no_uids + sBlk.no_guids);
++ free(suid_table);
+ } else {
+ res = read_fs_bytes(fd, sBlk.uid_start, (sBlk.no_uids +
+ sBlk.no_guids) * sizeof(unsigned int), uid_table);
+diff -aurp a/squashfs-tools/unsquash-2.c b/squashfs-tools/unsquash-2.c
+--- a/squashfs-tools/unsquash-2.c 2014-09-18 20:16:18.000000000 -0600
++++ b/squashfs-tools/unsquash-2.c 2017-08-29 13:23:48.111321548 -0600
+@@ -32,7 +32,7 @@ void read_block_list_2(unsigned int *blo
+ TRACE("read_block_list: blocks %d\n", blocks);
+
+ if(swap) {
+- unsigned int sblock_list[blocks];
++ unsigned int* sblock_list = malloc(blocks*sizeof(unsigned int));
+ memcpy(sblock_list, block_ptr, blocks * sizeof(unsigned int));
+ SQUASHFS_SWAP_INTS_3(block_list, sblock_list, blocks);
+ } else
+@@ -45,7 +45,7 @@ int read_fragment_table_2(long long *dir
+ int res, i;
+ int bytes = SQUASHFS_FRAGMENT_BYTES_2(sBlk.s.fragments);
+ int indexes = SQUASHFS_FRAGMENT_INDEXES_2(sBlk.s.fragments);
+- unsigned int fragment_table_index[indexes];
++ unsigned int* fragment_table_index = malloc(indexes * sizeof(unsigned int));
+
+ TRACE("read_fragment_table: %d fragments, reading %d fragment indexes "
+ "from 0x%llx\n", sBlk.s.fragments, indexes,
+@@ -53,6 +53,7 @@ int read_fragment_table_2(long long *dir
+
+ if(sBlk.s.fragments == 0) {
+ *directory_table_end = sBlk.s.fragment_table_start;
++ free(fragment_table_index);
+ return TRUE;
+ }
+
+@@ -62,7 +63,7 @@ int read_fragment_table_2(long long *dir
+ "fragment table\n");
+
+ if(swap) {
+- unsigned int sfragment_table_index[indexes];
++ unsigned int* sfragment_table_index = malloc(indexes * sizeof(unsigned int));
+
+ res = read_fs_bytes(fd, sBlk.s.fragment_table_start,
+ SQUASHFS_FRAGMENT_INDEX_BYTES_2(sBlk.s.fragments),
+@@ -70,10 +71,14 @@ int read_fragment_table_2(long long *dir
+ if(res == FALSE) {
+ ERROR("read_fragment_table: failed to read fragment "
+ "table index\n");
++ free(sfragment_table_index);
++ free(fragment_table_index);
+ return FALSE;
+ }
+ SQUASHFS_SWAP_FRAGMENT_INDEXES_2(fragment_table_index,
+ sfragment_table_index, indexes);
++
++ free(sfragment_table_index);
+ } else {
+ res = read_fs_bytes(fd, sBlk.s.fragment_table_start,
+ SQUASHFS_FRAGMENT_INDEX_BYTES_2(sBlk.s.fragments),
+@@ -81,6 +86,7 @@ int read_fragment_table_2(long long *dir
+ if(res == FALSE) {
+ ERROR("read_fragment_table: failed to read fragment "
+ "table index\n");
++ free(fragment_table_index);
+ return FALSE;
+ }
+ }
+@@ -96,6 +102,7 @@ int read_fragment_table_2(long long *dir
+ if(length == FALSE) {
+ ERROR("read_fragment_table: failed to read fragment "
+ "table block\n");
++ free(fragment_table_index);
+ return FALSE;
+ }
+ }
+@@ -111,6 +118,7 @@ int read_fragment_table_2(long long *dir
+ }
+
+ *directory_table_end = fragment_table_index[0];
++ free(fragment_table_index);
+ return TRUE;
+ }
+
+diff -aurp a/squashfs-tools/unsquash-3.c b/squashfs-tools/unsquash-3.c
+--- a/squashfs-tools/unsquash-3.c 2014-09-18 20:16:18.000000000 -0600
++++ b/squashfs-tools/unsquash-3.c 2017-08-29 14:43:17.016089289 -0600
+@@ -32,7 +32,7 @@ int read_fragment_table_3(long long *dir
+ int res, i;
+ int bytes = SQUASHFS_FRAGMENT_BYTES_3(sBlk.s.fragments);
+ int indexes = SQUASHFS_FRAGMENT_INDEXES_3(sBlk.s.fragments);
+- long long fragment_table_index[indexes];
++ long long* fragment_table_index = malloc(indexes * sizeof(long long));
+
+ TRACE("read_fragment_table: %d fragments, reading %d fragment indexes "
+ "from 0x%llx\n", sBlk.s.fragments, indexes,
+@@ -40,6 +40,7 @@ int read_fragment_table_3(long long *dir
+
+ if(sBlk.s.fragments == 0) {
+ *directory_table_end = sBlk.s.fragment_table_start;
++ free(fragment_table_index);
+ return TRUE;
+ }
+
+@@ -49,7 +50,7 @@ int read_fragment_table_3(long long *dir
+ "fragment table\n");
+
+ if(swap) {
+- long long sfragment_table_index[indexes];
++ long long* sfragment_table_index = malloc(indexes * sizeof(long long));
+
+ res = read_fs_bytes(fd, sBlk.s.fragment_table_start,
+ SQUASHFS_FRAGMENT_INDEX_BYTES_3(sBlk.s.fragments),
+@@ -57,10 +58,13 @@ int read_fragment_table_3(long long *dir
+ if(res == FALSE) {
+ ERROR("read_fragment_table: failed to read fragment "
+ "table index\n");
++ free(fragment_table_index);
++ free(sfragment_table_index);
+ return FALSE;
+ }
+ SQUASHFS_SWAP_FRAGMENT_INDEXES_3(fragment_table_index,
+ sfragment_table_index, indexes);
++ free(sfragment_table_index);
+ } else {
+ res = read_fs_bytes(fd, sBlk.s.fragment_table_start,
+ SQUASHFS_FRAGMENT_INDEX_BYTES_3(sBlk.s.fragments),
+@@ -68,6 +72,7 @@ int read_fragment_table_3(long long *dir
+ if(res == FALSE) {
+ ERROR("read_fragment_table: failed to read fragment "
+ "table index\n");
++ free(fragment_table_index);
+ return FALSE;
+ }
+ }
+@@ -83,6 +88,7 @@ int read_fragment_table_3(long long *dir
+ if(length == FALSE) {
+ ERROR("read_fragment_table: failed to read fragment "
+ "table block\n");
++ free(fragment_table_index);
+ return FALSE;
+ }
+ }
+@@ -98,6 +104,7 @@ int read_fragment_table_3(long long *dir
+ }
+
+ *directory_table_end = fragment_table_index[0];
++ free(fragment_table_index);
+ return TRUE;
+ }
+
+diff -aurp a/squashfs-tools/unsquash-4.c b/squashfs-tools/unsquash-4.c
+--- a/squashfs-tools/unsquash-4.c 2014-09-18 20:16:18.000000000 -0600
++++ b/squashfs-tools/unsquash-4.c 2017-08-29 14:49:01.424441708 -0600
+@@ -33,7 +33,7 @@ int read_fragment_table_4(long long *dir
+ int res, i;
+ int bytes = SQUASHFS_FRAGMENT_BYTES(sBlk.s.fragments);
+ int indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk.s.fragments);
+- long long fragment_table_index[indexes];
++ long long* fragment_table_index = malloc(indexes * sizeof(long long));
+
+ TRACE("read_fragment_table: %d fragments, reading %d fragment indexes "
+ "from 0x%llx\n", sBlk.s.fragments, indexes,
+@@ -41,6 +41,7 @@ int read_fragment_table_4(long long *dir
+
+ if(sBlk.s.fragments == 0) {
+ *directory_table_end = sBlk.s.fragment_table_start;
++ free(fragment_table_index);
+ return TRUE;
+ }
+
+@@ -55,6 +56,7 @@ int read_fragment_table_4(long long *dir
+ if(res == FALSE) {
+ ERROR("read_fragment_table: failed to read fragment table "
+ "index\n");
++ free(fragment_table_index);
+ return FALSE;
+ }
+ SQUASHFS_INSWAP_FRAGMENT_INDEXES(fragment_table_index, indexes);
+@@ -70,6 +72,7 @@ int read_fragment_table_4(long long *dir
+ if(length == FALSE) {
+ ERROR("read_fragment_table: failed to read fragment "
+ "table index\n");
++ free(fragment_table_index);
+ return FALSE;
+ }
+ }
+@@ -78,6 +81,7 @@ int read_fragment_table_4(long long *dir
+ SQUASHFS_INSWAP_FRAGMENT_ENTRY(&fragment_table[i]);
+
+ *directory_table_end = fragment_table_index[0];
++ free(fragment_table_index);
+ return TRUE;
+ }
+
+@@ -356,13 +360,14 @@ int read_uids_guids_4()
+ int res, i;
+ int bytes = SQUASHFS_ID_BYTES(sBlk.s.no_ids);
+ int indexes = SQUASHFS_ID_BLOCKS(sBlk.s.no_ids);
+- long long id_index_table[indexes];
++ long long* id_index_table = malloc(indexes * sizeof(long long));
+
+ TRACE("read_uids_guids: no_ids %d\n", sBlk.s.no_ids);
+
+ id_table = malloc(bytes);
+ if(id_table == NULL) {
+ ERROR("read_uids_guids: failed to allocate id table\n");
++ free(id_index_table);
+ return FALSE;
+ }
+
+@@ -370,6 +375,7 @@ int read_uids_guids_4()
+ SQUASHFS_ID_BLOCK_BYTES(sBlk.s.no_ids), id_index_table);
+ if(res == FALSE) {
+ ERROR("read_uids_guids: failed to read id index table\n");
++ free(id_index_table);
+ return FALSE;
+ }
+ SQUASHFS_INSWAP_ID_BLOCKS(id_index_table, indexes);
+@@ -382,11 +388,13 @@ int read_uids_guids_4()
+ if(res == FALSE) {
+ ERROR("read_uids_guids: failed to read id table block"
+ "\n");
++ free(id_index_table);
+ return FALSE;
+ }
+ }
+
+ SQUASHFS_INSWAP_INTS(id_table, sBlk.s.no_ids);
+
++ free(id_index_table);
+ return TRUE;
+ }
+diff -aurp a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
+--- a/squashfs-tools/unsquashfs.c 2017-08-29 14:58:51.917037533 -0600
++++ b/squashfs-tools/unsquashfs.c 2017-08-29 13:14:03.082818149 -0600
+@@ -691,7 +691,7 @@ int read_block(int fd, long long start,
+ return 0;
+
+ if(compressed) {
+- char buffer[c_byte];
++ char* buffer = malloc(c_byte);
+ int error;
+
+ res = read_fs_bytes(fd, start + offset, c_byte, buffer);
+@@ -704,8 +704,10 @@ int read_block(int fd, long long start,
+ if(res == -1) {
+ ERROR("%s uncompress failed with error code %d\n",
+ comp->name, error);
++ free(buffer);
+ goto failed;
+ }
++ free(buffer);
+ } else {
+ res = read_fs_bytes(fd, start + offset, c_byte, block);
+ if(res == FALSE)
+@@ -2097,7 +2099,7 @@ void *writer(void *arg)
+ */
+ void *inflator(void *arg)
+ {
+- char tmp[block_size];
++ char* tmp = malloc(block_size);
+
+ while(1) {
+ struct cache_entry *entry = queue_get(to_inflate);
+@@ -2120,6 +2122,7 @@ void *inflator(void *arg)
+ */
+ cache_block_ready(entry, res == -1);
+ }
++ free(tmp);
+ }
+
+
+diff -aurp a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+--- a/squashfs-tools/mksquashfs.c 2017-09-05 15:09:19.090937121 -0600
++++ b/squashfs-tools/mksquashfs.c 2017-09-01 09:58:11.274529037 -0600
+@@ -652,7 +652,7 @@ long long write_directories()
+ long long write_id_table()
+ {
+ unsigned int id_bytes = SQUASHFS_ID_BYTES(id_count);
+- unsigned int p[id_count];
++ unsigned int* p = malloc(id_count * sizeof(unsigned int));
+ int i;
+
+ TRACE("write_id_table: ids %d, id_bytes %d\n", id_count, id_bytes);
+@@ -655,6 +655,9 @@ long long write_id_table()
+ unsigned int* p = malloc(id_count * sizeof(unsigned int));
+ int i;
+
++ if(p == NULL)
++ MEM_ERROR();
++
+ TRACE("write_id_table: ids %d, id_bytes %d\n", id_count, id_bytes);
+ for(i = 0; i < id_count; i++) {
+ TRACE("write_id_table: id index %d, id %d", i, id_table[i]->id);
+
+@@ -661,6 +661,7 @@ long long write_id_table()
+ SQUASHFS_SWAP_INTS(&id_table[i]->id, p + i, 1);
+ }
+
++ free(p);
+ return generic_write_table(id_bytes, p, 0, NULL, noI);
+ }
+
+diff -aurp a/squashfs-tools/read_fs.c b/squashfs-tools/read_fs.c
+--- a/squashfs-tools/read_fs.c 2014-09-18 20:16:18.000000000 -0600
++++ b/squashfs-tools/read_fs.c 2017-09-05 15:35:19.328547536 -0600
+@@ -77,18 +77,24 @@ int read_block(int fd, long long start,
+ return 0;
+
+ if(compressed) {
+- char buffer[c_byte];
++ char* buffer = malloc(c_byte);
+ int error;
+
++ if(buffer == NULL)
++ MEM_ERROR();
++
+ res = read_fs_bytes(fd, start + 2, c_byte, buffer);
+- if(res == 0)
++ if(res == 0) {
++ free(buffer);
+ return 0;
++ }
+
+ res = compressor_uncompress(comp, block, buffer, c_byte,
+ outlen, &error);
+ if(res == -1) {
+ ERROR("%s uncompress failed with error code %d\n",
+ comp->name, error);
++ free(buffer);
+ return 0;
+ }
+ } else {
+@@ -699,7 +705,7 @@ all_done:
+ unsigned int *read_id_table(int fd, struct squashfs_super_block *sBlk)
+ {
+ int indexes = SQUASHFS_ID_BLOCKS(sBlk->no_ids);
+- long long index[indexes];
++ long long* index;
+ int bytes = SQUASHFS_ID_BYTES(sBlk->no_ids);
+ unsigned int *id_table;
+ int res, i;
+@@ -708,12 +714,17 @@ unsigned int *read_id_table(int fd, stru
+ if(id_table == NULL)
+ MEM_ERROR();
+
++ index = malloc(indexes * sizeof(long long));
++ if(index == NULL)
++ MEM_ERROR();
++
+ res = read_fs_bytes(fd, sBlk->id_table_start,
+ SQUASHFS_ID_BLOCK_BYTES(sBlk->no_ids), index);
+ if(res == 0) {
+ ERROR("Failed to read id table index\n");
+ ERROR("Filesystem corrupted?\n");
+ free(id_table);
++ free(index);
+ return NULL;
+ }
+
+@@ -732,6 +743,7 @@ unsigned int *read_id_table(int fd, stru
+ "length %d\n", i, index[i], length);
+ ERROR("Filesystem corrupted?\n");
+ free(id_table);
++ free(index);
+ return NULL;
+ }
+ }
+@@ -753,14 +765,19 @@ int read_fragment_table(int fd, struct s
+ int res, i;
+ int bytes = SQUASHFS_FRAGMENT_BYTES(sBlk->fragments);
+ int indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk->fragments);
+- long long fragment_table_index[indexes];
++ long long* fragment_table_index = malloc(indexes * sizeof(long long));
++
++ if(fragment_table_index == NULL)
++ MEM_ERROR();
+
+ TRACE("read_fragment_table: %d fragments, reading %d fragment indexes "
+ "from 0x%llx\n", sBlk->fragments, indexes,
+ sBlk->fragment_table_start);
+
+- if(sBlk->fragments == 0)
++ if(sBlk->fragments == 0) {
++ free(fragment_table_index);
+ return 1;
++ }
+
+ *fragment_table = malloc(bytes);
+ if(*fragment_table == NULL)
+@@ -773,6 +790,7 @@ int read_fragment_table(int fd, struct s
+ ERROR("Failed to read fragment table index\n");
+ ERROR("Filesystem corrupted?\n");
+ free(*fragment_table);
++ free(fragment_table_index);
+ return 0;
+ }
+
+@@ -792,6 +810,7 @@ int read_fragment_table(int fd, struct s
+ fragment_table_index[i], length);
+ ERROR("Filesystem corrupted?\n");
+ free(*fragment_table);
++ free(fragment_table_index);
+ return 0;
+ }
+ }
+@@ -799,6 +818,7 @@ int read_fragment_table(int fd, struct s
+ for(i = 0; i < sBlk->fragments; i++)
+ SQUASHFS_INSWAP_FRAGMENT_ENTRY(&(*fragment_table)[i]);
+
++ free(fragment_table_index);
+ return 1;
+ }
+
+@@ -808,11 +828,16 @@ int read_inode_lookup_table(int fd, stru
+ {
+ int lookup_bytes = SQUASHFS_LOOKUP_BYTES(sBlk->inodes);
+ int indexes = SQUASHFS_LOOKUP_BLOCKS(sBlk->inodes);
+- long long index[indexes];
++ long long* index = malloc(indexes * sizeof(long long));
+ int res, i;
+
+- if(sBlk->lookup_table_start == SQUASHFS_INVALID_BLK)
++ if(index == NULL)
++ MEM_ERROR();
++
++ if(sBlk->lookup_table_start == SQUASHFS_INVALID_BLK) {
++ free(index);
+ return 1;
++ }
+
+ *inode_lookup_table = malloc(lookup_bytes);
+ if(*inode_lookup_table == NULL)
+@@ -824,6 +849,7 @@ int read_inode_lookup_table(int fd, stru
+ ERROR("Failed to read inode lookup table index\n");
+ ERROR("Filesystem corrupted?\n");
+ free(*inode_lookup_table);
++ free(index);
+ return 0;
+ }
+
+@@ -843,12 +869,14 @@ int read_inode_lookup_table(int fd, stru
+ length);
+ ERROR("Filesystem corrupted?\n");
+ free(*inode_lookup_table);
++ free(index);
+ return 0;
+ }
+ }
+
+ SQUASHFS_INSWAP_LONG_LONGS(*inode_lookup_table, sBlk->inodes);
+
++ free(index);
+ return 1;
+ }
+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://releases.stm32flash.googlecode.com/git
-PKG_MD5SUM:=ec9b5c8bae67f9a489786546d088bd14
+PKG_HASH:=023f28b01f644edc235c8815a4352e359d3ebdbe6368aaf6bbc28bab3e6ffa5b
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
PKG_LICENSE:=GPL-2.0+
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_MIRROR_HASH:=2f77c42b14a0b6b1e4d44dfd4d66b63ce6ed7484ca97debec0344f5c966e2e5c
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
PKG_LICENSE:=LGPL-2.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://people.seas.harvard.edu/~apw/stress/
-PKG_MD5SUM:=a607afa695a511765b40993a64c6e2f4
+PKG_HASH:=369c997f65e8426ae8b318d4fdc8e6f07a311cfa77cc4b25dace465c582163c0
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-src-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/sumo
-PKG_MD5SUM:=0bb98ab7339aea15b14b633e1b74691f
+PKG_HASH:=4494190bd6570646df7a020befe25bc66355377273d922753685737c0d38bfdf
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-3.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_MD5SUM:=7fff46c84b8c630ede5b0f0827e3d90a
+PKG_HASH:=06dc8816a225667ce1eee545af3caf87e1bbaa379c32838d4cea53152514348d
PKG_INSTALL:=1
PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://perso.orange.fr/sebastien.godard/
-PKG_MD5SUM:=df1ed75656eb06320088d54247f0e803
+PKG_HASH:=9a721992e70883c1b9a09d9977501662587b909a014ac0eaa397d30a963acc53
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
-PKG_MD5SUM:=955cd533955acb1804b83fd70218da51
+PKG_HASH:=236b11190c0a3a6885bdb8d61424f2b36a5872869aa3f7f695dea4b4843ae2f2
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-3.0
PKG_SOURCE:=task-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.taskwarrior.org/download/
-PKG_MD5SUM:=517450c4a23a5842df3e9905b38801b3
+PKG_HASH:=7ff406414e0be480f91981831507ac255297aab33d8246f98dbfd2b1b2df8e3b
PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
PKG_BUILD_DIR:=$(BUILD_DIR)/task-$(PKG_VERSION)
http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/old/ \
ftp://ftp.astron.com/pub/tcsh/ \
ftp://ftp.astron.com/pub/tcsh/old
-PKG_MD5SUM:=59d40ef40a68e790d95e182069431834
+PKG_HASH:=b89de7064ab54dac454a266cfe5d8bf66940cb5ed048d0c30674ea62e7ecef9d
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=Copyright
PKG_SOURCE_VERSION:=28d0bb9a10a0b56b4964e3256135cfd152075a59
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=aac4f73d7d606b54e58f0ebc4b1cd1d86b29914d8c924c97c81501a677d91451
PKG_INSTALL:=1
PKG_SOURCE:=unrarsrc-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.rarlab.com/rar
-PKG_MD5SUM:=588b3fadc04eea7372cbfe98e4709aee
+PKG_HASH:=e470c584332422893fb52e049f2cbd99e24dc6c6da971008b4e2ae4284f8796c
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=UnRAR
PKG_SOURCE:=$(PKG_NAME)$(PKG_REV).tar.gz
PKG_SOURCE_URL:=@SF/infozip
-PKG_MD5SUM:=62b490407489521db863b523a7f86375
+PKG_HASH:=036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=BSD-4-Clause
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=35e5d48f29ae03b2b9686109e4ed9ab8b9677ce8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=7c0d8ea230570344fbc0183c0171689c74baf3d75fff33bbdfca2d1775a4d62d
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE:=libwebcam-src-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/libwebcam
-PKG_MD5SUM:=31dbb5713e95a699c5fc4dbe1493f764
+PKG_HASH:=91741aca11f079eb6d043e31b7da6fe1f7927c28d7496590386928f8466b4297
PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
PKG_BUILD_DIR:=$(BUILD_DIR)/libwebcam-src-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.vim.org/pub/vim/unix/
-PKG_MD5SUM:=457543a7754b0d3c1c0aa4d4c3bb4070
+PKG_HASH:=2e179182814715c3c77010c7300a4abcb964ba8a99a470640f9f2f03884b2ccb
PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)$(VIMVER)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/lzmautils \
http://tukaani.org/xz
-PKG_MD5SUM:=fd9ca16de1052aac899ad3495ad20dfa906c27b4a5070102a2ec35ca3a4740c1
+PKG_HASH:=fd9ca16de1052aac899ad3495ad20dfa906c27b4a5070102a2ec35ca3a4740c1
PKG_LICENSE:=Public-Domain LGPL-2.1+ GPL-2.0+ GPL-3.0+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=f2042052115e71ad2c91f77e78d21db8275fcdd6
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_HASH:=367db3667c6d2d8e20a0a214895e1bf2546918b008d084c3e7ca1adba9527dda
PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
PKG_LICENSE:=GPL-2.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/zile
-PKG_MD5SUM:=fe77d801ba69e0fb9b4914a04b9ff506
+PKG_HASH:=218bb2af414c6a168101656631a5b2da92f20a965895e1006658cc658b0b7e89
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-3.0+
PKG_SOURCE:=$(PKG_NAME)$(PKG_REV).tar.gz
PKG_SOURCE_URL:=@SF/infozip
-PKG_MD5SUM:=7b74551e63f8ee6aab6fbc86676c0d37
+PKG_HASH:=f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=BSD-4-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/zip$(PKG_REV)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)/zip$(PKG_REV)
PKG_CHECK_FORMAT_SECURITY:=0
+include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/zip
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
endef
+define Host/Compile
+ +$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) -I. -f unix/Makefile generic
+endef
+
+define Host/Install
+ $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/zip $(STAGING_DIR_HOSTPKG)/bin/
+endef
+
+$(eval $(call HostBuild))
$(eval $(call BuildPackage,zip))
PKG_SOURCE:=tzdata$(PKG_VERSION).tar.gz
PKG_SOURCE_CODE:=tzcode$(PKG_VERSION_CODE).tar.gz
PKG_SOURCE_URL:=http://www.iana.org/time-zones/repository/releases
-PKG_MD5SUM:=50dc0dc50c68644c1f70804f2e7a1625
+PKG_HASH:=f8242a522ea3496b0ce4ff4f2e75a049178da21001a08b8e666d8cbe07d18086
include $(INCLUDE_DIR)/package.mk
define Download/tzcode
FILE=$(PKG_SOURCE_CODE)
URL=$(PKG_SOURCE_URL)
- MD5SUM:=afaf15deb13759e8b543d86350385b16
+ HASH:=4d1735bb54e22b8d7443d4d1f1a13d007ae11be79a35e51f8e8322fb8e292d40
endef
$(eval $(call Download,tzcode))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@SF/zsh
-PKG_MD5SUM:=afe96fde08b70e23c1cab1ca7a68fb34
+PKG_HASH:=f17916320ffaa844bbd7ce48ceeb5945fc5f3eff64b149b4229bbfbdf3795a9d
PKG_MAINTAINER:=Vadim A. Misbakh-Soloviov <openwrt-zsh@mva.name>
PKG_LICENSE:=ZSH