summaryrefslogtreecommitdiffstats
path: root/funtools/filter
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2016-10-26 21:13:00 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2016-10-26 21:13:00 (GMT)
commitda2e3d212171bbe64c1af39114fd067308656990 (patch)
tree9601f7ed15fa1394762124630c12a792bc073ec2 /funtools/filter
parent76b109ad6d97d19ab835596dc70149ef379f3733 (diff)
downloadblt-da2e3d212171bbe64c1af39114fd067308656990.zip
blt-da2e3d212171bbe64c1af39114fd067308656990.tar.gz
blt-da2e3d212171bbe64c1af39114fd067308656990.tar.bz2
rm funtools for update
Diffstat (limited to 'funtools/filter')
-rw-r--r--funtools/filter/Imakefile18
-rw-r--r--funtools/filter/Makefile.in282
-rw-r--r--funtools/filter/ZHTODO4
-rw-r--r--funtools/filter/ac_c_long_long.m436
-rw-r--r--funtools/filter/aclocal.m41
-rw-r--r--funtools/filter/addld1
-rw-r--r--funtools/filter/column.c36
-rw-r--r--funtools/filter/column.h29
-rwxr-xr-xfuntools/filter/compat/install-sh238
-rw-r--r--funtools/filter/conf.h.in62
-rw-r--r--funtools/filter/config.guess1435
-rw-r--r--funtools/filter/config.sub1807
-rwxr-xr-xfuntools/filter/configure-failsafe6399
-rw-r--r--funtools/filter/configure.ac202
-rw-r--r--funtools/filter/dl.c57
-rw-r--r--funtools/filter/dl.h23
-rw-r--r--funtools/filter/events_c.h1
-rw-r--r--funtools/filter/events_py.h1
-rw-r--r--funtools/filter/evfilter.c266
-rw-r--r--funtools/filter/evfilter.py156
-rw-r--r--funtools/filter/evregions.c1532
-rw-r--r--funtools/filter/evregions_c.h1
-rw-r--r--funtools/filter/evregions_c.tmpl1532
-rw-r--r--funtools/filter/filt.l3228
-rw-r--r--funtools/filter/filter.c1041
-rw-r--r--funtools/filter/filter.h380
-rw-r--r--funtools/filter/filter_pyh.py22
-rw-r--r--funtools/filter/filtprog.c351
-rw-r--r--funtools/filter/filtprog_c.c1033
-rw-r--r--funtools/filter/idx.h166
-rw-r--r--funtools/filter/idx.l559
-rw-r--r--funtools/filter/idx.output1007
-rw-r--r--funtools/filter/idx.tab.c2177
-rw-r--r--funtools/filter/idx.tab.h83
-rw-r--r--funtools/filter/idx.y77
-rw-r--r--funtools/filter/idxacts.c2368
-rw-r--r--funtools/filter/image_c.h1
-rw-r--r--funtools/filter/imfilter.c335
-rw-r--r--funtools/filter/imregions.c2585
-rw-r--r--funtools/filter/imregions_c.h1
-rw-r--r--funtools/filter/imregions_c.tmpl2585
-rwxr-xr-xfuntools/filter/inc.sed13
-rwxr-xr-xfuntools/filter/install-sh276
-rw-r--r--funtools/filter/lex.filt.c8941
-rw-r--r--funtools/filter/lex.idx.c2829
-rw-r--r--funtools/filter/regions.h408
-rw-r--r--funtools/filter/regions_h.h1
-rw-r--r--funtools/filter/sample.c83
-rw-r--r--funtools/filter/swap.c92
-rw-r--r--funtools/filter/swap_c.h1
-rw-r--r--funtools/filter/symbols.c323
-rw-r--r--funtools/filter/tfilt.c527
-rw-r--r--funtools/filter/tfilt.ex24
-rw-r--r--funtools/filter/tl.c190
-rw-r--r--funtools/filter/tl.h25
-rw-r--r--funtools/filter/xalloc_c.h1
56 files changed, 0 insertions, 45852 deletions
diff --git a/funtools/filter/Imakefile b/funtools/filter/Imakefile
deleted file mode 100644
index a1aa8c7..0000000
--- a/funtools/filter/Imakefile
+++ /dev/null
@@ -1,18 +0,0 @@
-XCOMM #########################################################################
-XCOMM
-XCOMM Fake Imakefile for xpa for use in saord
-XCOMM Its only necessary to have the Makefiles target
-XCOMM
-XCOMM #########################################################################
-
-Makefiles::
- @(x=""; \
- for i in $(CC); do \
- if [ "$$i" = "gcc" ] ; then \
- echo "X uses gcc ... and so shall we"; \
- x="--enable-gcc"; \
- fi; \
- done; \
- rm -f config.cache; \
- ./configure --enable-saord --prefix=$(TOP) --exec-prefix=$(TOP) --with-alt-libdir=$(TOP)/lib $$x)
-
diff --git a/funtools/filter/Makefile.in b/funtools/filter/Makefile.in
deleted file mode 100644
index 6b625f1..0000000
--- a/funtools/filter/Makefile.in
+++ /dev/null
@@ -1,282 +0,0 @@
-#
-# This file is a Makefile for Filter. If it has the name "Makefile.in"
-# then it is a template for a Makefile; to generate the actual Makefile,
-# run "./configure", which is a configuration script generated by the
-# "autoconf" program (constructs like "@foo@" will get replaced in the
-# actual Makefile.
-#
-
-# Current FILT version; used in various names.
-PACKAGE = @PACKAGE_NAME@
-VERSION = @PACKAGE_VERSION@
-
-DISTNAME = filter-${VERSION}
-DISTDIR = ../export/${DISTNAME}
-FTPDIR = ../ftp
-
-#----------------------------------------------------------------
-# Things you can change to personalize the Makefile for your own
-# site (you can make these changes in either Makefile.in or
-# Makefile, but changes to Makefile will get lost if you re-run
-# the configuration script).
-#----------------------------------------------------------------
-
-# Default top-level directories in which to install architecture-
-# specific files (exec_prefix) and machine-independent files such
-# as scripts (prefix). The values specified here may be overridden
-# at configure-time with the --exec-prefix and --prefix options
-# to the "configure" script.
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-# The following definition can be set to non-null for special systems
-# like AFS with replication. It allows the pathnames used for installation
-# to be different than those used for actually reference files at
-# run-time. INSTALL_ROOT is prepended to $prefix and $exec_prefix
-# when installing files.
-INSTALL_ROOT =
-
-# Directory in which to install the .a, .so, and .o files:
-LIB_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/lib
-
-# Directory in which to install the programs:
-BIN_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/bin
-
-# Directory in which to install the include files:
-INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/include
-
-# util files are in the util directory at same level
-UTIL_INC = -I../util
-#UTIL_LIBS = -L../util -lutil
-
-# fitsy files are in the fitsy directory at same level
-FITSY_INC = -I../fitsy
-#FITSY_LIBS = -L../fitsy
-
-# wcs files are in the wcs subdirectory
-WCS_INC = -I../wcs
-#WCS_LIBS = -L../wcs -lwcs
-
-# extra includes for compiling
-INCLUDES = $(UTIL_INC) $(FITSY_INC) $(WCS_INC)
-
-# extra libs
-EXTRA_LIBS = -L.. -lfuntools @EXTRA_LIBS@
-
-# the full set of libraries for linking
-LIBS = $(WCS_LIBS) $(FITSY_LIBS) $(EXTRA_LIBS) -lm
-
-# To change the compiler switches, for example to change from -O
-# to -g, change the following line:
-CFLAGS = @CFLAGS@
-
-# To add ld switches, change the following line:
-LDFLAGS = @LDFLAGS@
-
-# whether to set the FPU in double round mode
-FPU_DOUBLE = @USE_FPU_DOUBLE@
-
-# Some versions of make, like SGI's, use the following variable to
-# determine which shell to use for executing commands:
-SHELL = /bin/sh
-
-# extra modules added by configure.in to fix OS bugs
-EXTRA_OBJS = @EXTRA_OBJS@
-
-# special definitions for filtering
-OBJPATH = \"$(LIB_INSTALL_DIR):.\"
-FILTER_CC = @FILTER_CC@
-FILTER_CFLAGS = @FILTER_CFLAGS@
-
-# There are just too many different versions of "install" around;
-# better to use the install-sh script that comes with the distribution,
-# which is slower but guaranteed to work.
-
-INSTALL = ./install-sh -c
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_DATA = ${INSTALL} -m 644
-
-#----------------------------------------------------------------
-# The information below is modified by the configure script when
-# Makefile is generated from Makefile.in. You shouldn't normally
-# modify any of this stuff by hand.
-#----------------------------------------------------------------
-
-AC_FLAGS = @DEFS@
-RANLIB = @RANLIB@
-
-#----------------------------------------------------------------
-# The information below should be usable as is. The configure
-# script won't modify it and you shouldn't need to modify it
-# either.
-#----------------------------------------------------------------
-
-CC = @CC@
-
-CC_SWITCHES = -I. ${CFLAGS} ${CPPFLAGS} -DFILT_VERSION="\"$(VERSION)\"" @USE_DL@ \
- ${INCLUDES} ${AC_FLAGS}
-
-DEPEND_SWITCHES = -I. ${CFLAGS} -I. ${INCLUDES} ${AC_FLAGS}
-
-SRCS = evregions.c filter.c filtprog.c filtprog_c.c \
- imregions.c symbols.c lex.filt.c column.c dl.c tl.c \
- lex.idx.c idx.tab.c idxacts.c
-
-OBJS = evregions.o filter.o filtprog.o filtprog_c.o \
- imregions.o symbols.o lex.filt.o column.o dl.o tl.o \
- lex.idx.o idx.tab.o idxacts.o
-
-# these are all the modules going into the "normal" filt library
-LIBOBJS = ${OBJS}
-
-# the default library for this package
-DEFLIB = @DEFLIB@
-# the actual library we are building (if this is a subpackage)
-LIB = @LIB@
-
-TESTPROGS = tfilt
-
-all: $(LIB) $(PROGS)
-
-testall: $(TESTPROGS)
-
-All: all testall
-
-install: install-binaries
-
-$(LIB): $(LIBOBJS)
- ar cruv $(LIB) $(LIBOBJS)
- $(RANLIB) $(LIB)
-
-tfilt: $(LIB) tfilt.o
- $(CC) $(LDFLAGS) tfilt.o -o tfilt $(LIB) ${LIBS}
-
-# Note: before running ranlib below, must cd to target directory because
-# some ranlibs write to current directory, and this might not always be
-# possible (e.g. if installing as root).
-
-install-binaries: $(LIB) $(PROGS)
- @for i in $(LIB_INSTALL_DIR) $(INCLUDE_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
- do \
- if [ ! -d $$i ] ; then \
- echo "Making directory $$i"; \
- mkdir $$i; \
- chmod 755 $$i; \
- else true; \
- fi; \
- done;
- @if [ "$(LIB)" = "$(DEFLIB)" ] ; then \
- XLIB=`basename $(LIB)`; \
- echo "Installing $$XLIB"; \
- $(INSTALL_DATA) $$XLIB $(LIB_INSTALL_DIR)/$$XLIB; \
- (cd $(LIB_INSTALL_DIR); $(RANLIB) $$XLIB); \
- chmod 555 $(LIB_INSTALL_DIR)/$$XLIB; \
- fi;
-# @for i in imregions.o evregions.o ; \
-# do \
-# if [ -f $$i ] ; then \
-# echo "Installing $$i" ; \
-# $(INSTALL_DATA) $$i $(LIB_INSTALL_DIR)/$$i ; \
-# fi; \
-# done;
- @for i in filter.h column.h dl.h tl.h idx.h; \
- do \
- if [ -f $$i ] ; then \
- echo "Installing $$i" ; \
- $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR)/$$i ; \
- fi; \
- done;
-
-Makefile: Makefile.in
- $(SHELL) config.status
-
-RM = rm -f
-
-clean:
- $(RM) *.a *.so *.o *.exe core errs *pure* .nfs* \
- foo* *~ *.log \#* TAGS *.E a.out errors \
- $(PROGS) $(TESTPROGS) \
- gmon.out *.pg *.bak \
- config.info config.log \
- doc/*~
- $(RM) -r autom4te.cache
-
-distclean: clean
- $(RM) Makefile config.status config.cache config.log
-
-depend:
- makedepend -- $(DEPEND_SWITCHES) -- $(SRCS)
-
-.c.o:
- $(CC) -c $(CC_SWITCHES) $<
-
-filtprog_c.o: filtprog_c.c regions_h.h xalloc_c.h swap_c.h \
- events_c.h image_c.h evregions_c.h imregions_c.h filter.h
- $(CC) -c $(CC_SWITCHES) -DOBJPATH="$(OBJPATH)" \
- -DFILTER_CC="$(FILTER_CC)" -DFILTER_CFLAGS="$(FILTER_CFLAGS)" \
- filtprog_c.c
-
-# header and source include files for program generation
-regions_h.h: regions.h inc.sed
- $(RM) regions_h.h
- ./inc.sed REGIONS_H < regions.h > regions_h.h
-
-xalloc_c.h: ../util/xalloc.c inc.sed
- $(RM) xalloc_c.h
- ./inc.sed XALLOC_C < ../util/xalloc.c > xalloc_c.h
-
-swap_c.h: swap.c inc.sed
- $(RM) swap_c.h
- ./inc.sed SWAP_C < swap.c > swap_c.h
-
-events_c.h: evfilter.c inc.sed
- $(RM) events_c.h
- ./inc.sed EVENTS_C < evfilter.c > events_c.h
-
-image_c.h: imfilter.c inc.sed
- $(RM) image_c.h
- ./inc.sed IMAGE_C < imfilter.c > image_c.h
-
-evregions.c: evregions_c.tmpl Makefile
- $(RM) evregions.c
- sed 's/_FPUDBL_/$(FPU_DOUBLE)/' < evregions_c.tmpl > evregions.c
-
-imregions.c: imregions_c.tmpl Makefile
- $(RM) imregions.c
- sed 's/_FPUDBL_/$(FPU_DOUBLE)/' < imregions_c.tmpl > imregions.c
-
-evregions_c.h: evregions.c inc.sed
- $(RM) evregions_c.h
- ./inc.sed EVREGIONS_C < evregions.c > evregions_c.h
-
-imregions_c.h: imregions.c inc.sed
- $(RM) imregions_c.h
- ./inc.sed IMREGIONS_C < imregions.c > imregions_c.h
-
-headers: regions_h.h xalloc_c.h swap_c.h \
- events_c.h image_c.h evregions_c.h imregions_c.h
-
-# remake the parser
-LEX = flex -i
-parser: filt.l
- @($(LEX) -Pfilt filt.l; \
- sed "s/yytext_ptr/filttext_ptr/g" < lex.filt.c > nlex.filt.c; \
- mv nlex.filt.c lex.filt.c)
-
-iparser: idx.l
- @($(LEX) -Pidx idx.l; \
- sed "s/yytext_ptr/idxtext_ptr/g" < lex.idx.c > nlex.idx.c; \
- mv nlex.idx.c lex.idx.c)
-
-YACC = bison -d -v
-igrammar: idx.y
- $(YACC) -p idx idx.y
-
-pure: tfilt.pure
-
-tfilt.pure: $(FILDLIB) tfilt.o
- purify $(CC) $(LDFLAGS) tfilt.o -o tfilt.pure \
- $(LIB) $(LIBS)
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/funtools/filter/ZHTODO b/funtools/filter/ZHTODO
deleted file mode 100644
index 6dce830..0000000
--- a/funtools/filter/ZHTODO
+++ /dev/null
@@ -1,4 +0,0 @@
-1. segments should be full statements
-2. reverse order of segments
-3. excludes are not moved to the end
-4. allow specification of region id
diff --git a/funtools/filter/ac_c_long_long.m4 b/funtools/filter/ac_c_long_long.m4
deleted file mode 100644
index fb6df1e..0000000
--- a/funtools/filter/ac_c_long_long.m4
+++ /dev/null
@@ -1,36 +0,0 @@
-##### http://autoconf-archive.cryp.to/ac_c_long_long.html
-#
-# SYNOPSIS
-#
-# AC_C_LONG_LONG
-#
-# DESCRIPTION
-#
-# Provides a test for the existance of the long long int type and
-# defines HAVE_LONG_LONG if it is found.
-#
-# LAST MODIFICATION
-#
-# 2006-10-30
-#
-# COPYLEFT
-#
-# Copyright (c) 2006 Caolan McNamara <caolan@skynet.ie>
-#
-# Copying and distribution of this file, with or without
-# modification, are permitted in any medium without royalty provided
-# the copyright notice and this notice are preserved.
-
-AC_DEFUN([AC_C_LONG_LONG],
-[AC_CACHE_CHECK(for long long int, ac_cv_c_long_long,
-[if test "$GCC" = yes; then
- ac_cv_c_long_long=yes
- else
- AC_TRY_COMPILE(,[long long int i;],
- ac_cv_c_long_long=yes,
- ac_cv_c_long_long=no)
- fi])
- if test $ac_cv_c_long_long = yes; then
- AC_DEFINE(HAVE_LONG_LONG, 1, [compiler understands long long])
- fi
-])
diff --git a/funtools/filter/aclocal.m4 b/funtools/filter/aclocal.m4
deleted file mode 100644
index 65f68be..0000000
--- a/funtools/filter/aclocal.m4
+++ /dev/null
@@ -1 +0,0 @@
-builtin(include,ac_c_long_long.m4)
diff --git a/funtools/filter/addld b/funtools/filter/addld
deleted file mode 100644
index 5591871..0000000
--- a/funtools/filter/addld
+++ /dev/null
@@ -1 +0,0 @@
-setenv LD_LIBRARY_PATH "..:${LD_LIBRARY_PATH}"
diff --git a/funtools/filter/column.c b/funtools/filter/column.c
deleted file mode 100644
index a1ad027..0000000
--- a/funtools/filter/column.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory
- */
-#include <column.h>
-
-#ifdef ANSI_FUNC
-void
-ColumnLoad(char *ibuf, int size, int n, int convert, void *obuf)
-#else
-void ColumnLoad(ibuf, size, n, convert, obuf)
- char *ibuf;
- int size;
- int n;
- int convert;
- void *obuf;
-#endif
-{
- register char *iptr;
- register char *optr;
- int i, j;
-
- if( convert ){
- optr = (char *)obuf;
- iptr = (char *)ibuf;
- for(i=0; i<n; i++){
- for(j=size-1; j>=0; j--){
- *optr++ = *(iptr+j);
- }
- iptr += size;
- }
- }
- else{
- memcpy(obuf, ibuf, n*size);
- }
-}
-
diff --git a/funtools/filter/column.h b/funtools/filter/column.h
deleted file mode 100644
index ffe9b0f..0000000
--- a/funtools/filter/column.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory
- */
-
-/*
- *
- * column.h -- declarations for column processing
- *
- */
-
-#ifndef __column_h
-#define __column_h
-
-#if HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include "prsetup.h"
-_PRbeg
-
-void ColumnLoad _PRx((char *ibuf, int size, int n, int convert, void *obuf));
-
-_PRend
-
-#endif
diff --git a/funtools/filter/compat/install-sh b/funtools/filter/compat/install-sh
deleted file mode 100755
index ab74c88..0000000
--- a/funtools/filter/compat/install-sh
+++ /dev/null
@@ -1,238 +0,0 @@
-#!/bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-#
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-tranformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-else
- true
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- else
- instcmd=mkdir
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f $src -o -d $src ]
- then
- true
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- true
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d $dst ]
- then
- dst="$dst"/`basename $src`
- else
- true
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
- shift
-
- if [ ! -d "${pathcomp}" ] ;
- then
- $mkdirprog "${pathcomp}"
- else
- true
- fi
-
- pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename $dst`
- else
- dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename $dst`
- else
- true
- fi
-
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
-
-fi &&
-
-
-exit 0
diff --git a/funtools/filter/conf.h.in b/funtools/filter/conf.h.in
deleted file mode 100644
index 12c728f..0000000
--- a/funtools/filter/conf.h.in
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Define as 1 if this compiler supports long long. */
-#undef HAVE_LONG_LONG
-
-/* Define as 1 if you have string.h */
-#undef HAVE_STRING_H
-
-/* Define as 1 if you have stdlib.h */
-#undef HAVE_STDLIB_H
-
-/* Define as 1 if you have malloc.h */
-#undef HAVE_MALLOC_H
-
-/* Define as 1 if you have unistd.h */
-#undef HAVE_UNISTD_H
-
-/* Define as 1 if you have getopt.h */
-#undef HAVE_GETOPT_H
-
-/* Define as 1 if you have values.h */
-#undef HAVE_VALUES_H
-
-/* Define as 1 if you have dlfcn.h */
-#undef HAVE_DLFCN_H
-
-/* Define as 1 if you have sys/un.h */
-#undef HAVE_SYS_UN_H
-
-/* Define as 1 if you have sys/shm.h */
-#undef HAVE_SYS_SHM_H
-
-/* Define as 1 if you have sys/mman.h */
-#undef HAVE_SYS_MMAN_H
-
-/* Define as 1 if you have sys/ipc.h */
-#undef HAVE_SYS_IPC_H
-
-/* Define as 1 if you have socklen_t */
-#undef HAVE_SOCKLEN_T
-
-/* Define as 1 if you have strchr */
-#undef HAVE_STRCHR
-
-/* Define as 1 if you have memcpy */
-#undef HAVE_MEMCPY
-
-/* Define as 1 if you have snprintf */
-#undef HAVE_SNPRINTF
-
-/* Define as 1 if you have Tcl */
-#undef HAVE_TCL
-
-/* Define as 1 if you have Xt */
-#undef HAVE_XT
-
-/* Define as 1 if you are running Cygwin. */
-#undef HAVE_CYGWIN
-
-/* Define as 1 if you are running MinGW. */
-#undef HAVE_MINGW32
-
-/* Define if you have inline */
-#undef inline
diff --git a/funtools/filter/config.guess b/funtools/filter/config.guess
deleted file mode 100644
index 44290b8..0000000
--- a/funtools/filter/config.guess
+++ /dev/null
@@ -1,1435 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright 1992-2015 Free Software Foundation, Inc.
-
-timestamp='2015-02-23'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-#
-# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
-#
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-#
-# Please send patches to <config-patches@gnu.org>.
-
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright 1992-2015 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-case "${UNAME_SYSTEM}" in
-Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
-
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
- #include <features.h>
- #if defined(__UCLIBC__)
- LIBC=uclibc
- #elif defined(__dietlibc__)
- LIBC=dietlibc
- #else
- LIBC=gnu
- #endif
- EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
- ;;
-esac
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
- /sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || \
- echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
- earmv*)
- arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
- endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
- machine=${arch}${endian}-unknown
- ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ELF__
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # Determine ABI tags.
- case "${UNAME_MACHINE_ARCH}" in
- earm*)
- expr='s/^earmv[0-9]/-eabi/;s/eb$//'
- abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}${abi}"
- exit ;;
- *:Bitrig:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
- exitcode=$?
- trap '' 0
- exit $exitcode ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm*:riscos:*:*|arm*:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
- exit ;;
- i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
- # If there is a compiler, see if it is configured for 64-bit objects.
- # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
- # This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- SUN_ARCH="x86_64"
- fi
- fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit ;;
- *:AIX:*:[4567])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/lslpp ] ; then
- IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
- awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep -q __LP64__
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- case ${UNAME_PROCESSOR} in
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
- *:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
- exit ;;
- *:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- *:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- *:Interix*:*)
- case ${UNAME_MACHINE} in
- x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
- esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
- aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- aarch64_be:Linux:*:*)
- UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arm*:Linux:*:*)
- eval $set_cc_for_build
- if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_EABI__
- then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- else
- if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_PCS_VFP
- then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
- else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
- fi
- fi
- exit ;;
- avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
- crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
- frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
- exit ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
- ;;
- openrisc*:Linux:*:*)
- echo or1k-unknown-linux-${LIBC}
- exit ;;
- or32:Linux:*:* | or1k*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
- exit ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
- esac
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
- exit ;;
- ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
- exit ;;
- ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
- exit ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
- exit ;;
- x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i586.
- # Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
- # this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- NCR*:*:4.2:* | MPRAS*:*:4.2:*)
- OS_REL='.3'
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
- x86_64:Haiku:*:*)
- echo x86_64-unknown-haiku
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
- fi
- if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
- fi
- elif test "$UNAME_PROCESSOR" = i386 ; then
- # Avoid executing cc on OS X 10.9, as it ships with a stub
- # that puts up a graphical alert prompting to install
- # developer tools. Any system running Mac OS X 10.7 or
- # later (Darwin 11 and later) is required to have a 64-bit
- # processor. This is not true of the ARM version of Darwin
- # that Apple uses in portable devices.
- UNAME_PROCESSOR=x86_64
- fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
- exit ;;
- x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
- exit ;;
-esac
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/funtools/filter/config.sub b/funtools/filter/config.sub
deleted file mode 100644
index bc855a2..0000000
--- a/funtools/filter/config.sub
+++ /dev/null
@@ -1,1807 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright 1992-2015 Free Software Foundation, Inc.
-
-timestamp='2015-02-22'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-
-
-# Please send patches to <config-patches@gnu.org>.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright 1992-2015 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze*)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*178)
- os=-lynxos178
- ;;
- -lynx*5)
- os=-lynxos5
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | be32 | be64 \
- | bfin \
- | c4x | c8051 | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | epiphany \
- | fido | fr30 | frv | ft32 \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | k1om \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa32r6 | mipsisa32r6el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64r6 | mipsisa64r6el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 | or1k | or1knd | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pyramid \
- | riscv32 | riscv64 \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | visium \
- | we32k \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- leon|leon[3-9])
- basic_machine=sparc-$basic_machine
- ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
- ;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- xscaleeb)
- basic_machine=armeb-unknown
- ;;
-
- xscaleel)
- basic_machine=armel-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | c8051-* | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | k1om-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa32r6-* | mipsisa32r6el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64r6-* | mipsisa64r6el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | or1k*-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pyramid-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | visium-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- leon-*|leon[3-9]-*)
- basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze*)
- basic_machine=microblaze-xilinx
- ;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
- mingw32)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- moxiebox)
- basic_machine=moxie-unknown
- os=-moxiebox
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i686-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc | ppcbe) basic_machine=powerpc-unknown
- ;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
- ;;
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -dicos*)
- os=-dicos
- ;;
- -nacl*)
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- c8051-*)
- os=-elf
- ;;
- hexagon-*)
- os=-elf
- ;;
- tic54x-*)
- os=-coff
- ;;
- tic55x-*)
- os=-coff
- ;;
- tic6x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mep-*)
- os=-elf
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -cnk*|-aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/funtools/filter/configure-failsafe b/funtools/filter/configure-failsafe
deleted file mode 100755
index 2017281..0000000
--- a/funtools/filter/configure-failsafe
+++ /dev/null
@@ -1,6399 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for filter 1.1.
-#
-# Report bugs to <saord@cfa.harvard.edu>.
-#
-# Copyright (C) 2003 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-exec 6>&1
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_config_libobj_dir=.
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete. It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
-# Identity of this package.
-PACKAGE_NAME='filter'
-PACKAGE_TARNAME='filter'
-PACKAGE_VERSION='1.1'
-PACKAGE_STRING='filter 1.1'
-PACKAGE_BUGREPORT='saord@cfa.harvard.edu'
-
-ac_unique_file="./filter.h"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# if HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#if HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT RANLIB ac_ct_RANLIB CPP EGREP FILTER_CC FILTER_CFLAGS LIB DEFLIB DOSHARED LLIB USE_FPU_DOUBLE USE_DL EXTRA_LIBS EXTRA_OBJS LIBOBJS LTLIBOBJS'
-ac_subst_files=''
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-ac_prev=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_option in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval "enable_$ac_feature=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_$ac_feature='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "with_$ac_package='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/-/_/g'`
- eval "with_$ac_package=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
- eval "$ac_envvar='$ac_optarg'"
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
- { (exit 1); exit 1; }; }
- else
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
- fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
- { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures filter 1.1 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-_ACEOF
-
- cat <<_ACEOF
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --infodir=DIR info documentation [PREFIX/info]
- --mandir=DIR man documentation [PREFIX/man]
-_ACEOF
-
- cat <<\_ACEOF
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of filter 1.1:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-shared build shared libraries
- --enable-dl allow use of dynamic loading if available
- --enable-fpu_double set FPU in double round mode
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-filter-cc=CC compiler
- --with-filter-cflags=CFLAGS compiler flags
- --with-altlib=LIB library name
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
- headers in a nonstandard directory <include dir>
- CPP C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to <saord@cfa.harvard.edu>.
-_ACEOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- ac_popdir=`pwd`
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d $ac_dir || continue
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
- cd $ac_dir
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- echo
- $SHELL $ac_srcdir/configure.gnu --help=recursive
- elif test -f $ac_srcdir/configure; then
- echo
- $SHELL $ac_srcdir/configure --help=recursive
- elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
- echo
- $ac_configure --help
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi
- cd $ac_popdir
- done
-fi
-
-test -n "$ac_init_help" && exit 0
-if $ac_init_version; then
- cat <<\_ACEOF
-filter configure 1.1
-generated by GNU Autoconf 2.59
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit 0
-fi
-exec 5>config.log
-cat >&5 <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by filter $as_me 1.1, which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_sep=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- # Get rid of the leading space.
- ac_sep=" "
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-{
- (set) 2>&1 |
- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
- ;;
- *)
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-}
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- sed "/^$/d" confdefs.h | sort
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core &&
- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
- ' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . $cache_file;;
- *) . ./$cache_file;;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
- eval ac_new_val="\$ac_env_${ac_var}_value"
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ac_config_headers="$ac_config_headers conf.h"
-
-
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f $ac_dir/shtool; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
- { (exit 1); exit 1; }; }
-fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
-
-# Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
- { (exit 1); exit 1; }; }
-
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
- ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
-build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
- ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
-host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-
-#
-# checks that we use in most projects
-#
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$ac_ct_CC" && break
-done
-
- CC=$ac_ct_CC
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
- "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
- (eval $ac_compiler --version </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
- (eval $ac_compiler -v </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
- (eval $ac_compiler -V </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
- (eval $ac_link_default) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Find the output, starting from the most likely. This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
- conftest.$ac_ext )
- # This is the source file.
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
- break;;
- * )
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std1 is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std1. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX 10.20 and later -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_stdc=$ac_arg
-break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
- x|xno)
- echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
- *)
- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
- CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-# Some people use a C++ compiler to compile C. Since we use `exit',
-# in C++ we need to declare it. In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
- choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- for ac_declaration in \
- '' \
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);'
-do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-if test x"${EXEEXT}" = "xno"; then
- EXEEXT=""
-fi
-
-
-echo "$as_me:$LINENO: checking for long long int" >&5
-echo $ECHO_N "checking for long long int... $ECHO_C" >&6
-if test "${ac_cv_c_long_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$GCC" = yes; then
- ac_cv_c_long_long=yes
- else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-long long int i;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_c_long_long=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_c_long_long=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_long_long" >&5
-echo "${ECHO_T}$ac_cv_c_long_long" >&6
- if test $ac_cv_c_long_long = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LONG_LONG 1
-_ACEOF
-
- fi
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- RANLIB=$ac_ct_RANLIB
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether non-existent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether non-existent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
- fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
-
-
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_header_stdc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_header_stdc=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
- :
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ctype.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- exit(2);
- exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_header in malloc.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to saord@cfa.harvard.edu ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in getopt.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to saord@cfa.harvard.edu ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in values.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to saord@cfa.harvard.edu ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in dlfcn.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to saord@cfa.harvard.edu ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in sys/un.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to saord@cfa.harvard.edu ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in sys/mman.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to saord@cfa.harvard.edu ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in sys/ipc.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to saord@cfa.harvard.edu ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-case $host_os in
- *cygwin*|*Cygwin* )
- ;;
- * )
-
-for ac_header in sys/shm.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------ ##
-## Report this to saord@cfa.harvard.edu ##
-## ------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
- ;;
-esac
-
-echo "$as_me:$LINENO: checking for socklen_t" >&5
-echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6
-if test "${ac_cv_type_socklen_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/socket.h>
-
-int
-main ()
-{
-if ((socklen_t *) 0)
- return 0;
-if (sizeof (socklen_t))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_type_socklen_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_type_socklen_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5
-echo "${ECHO_T}$ac_cv_type_socklen_t" >&6
-if test $ac_cv_type_socklen_t = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SOCKLEN_T 1
-_ACEOF
-
-
-fi
-
-
-echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
-if test "${ac_cv_c_const+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
- /* Ultrix mips cc rejects this. */
- typedef int charset[2];
- const charset x;
- /* SunOS 4.1.1 cc rejects this. */
- char const *const *ccp;
- char **p;
- /* NEC SVR4.0.2 mips cc rejects this. */
- struct point {int x, y;};
- static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in
- an arm of an if-expression whose if-part is not a constant
- expression */
- const char *g = "string";
- ccp = &g + (g ? g-g : 0);
- /* HPUX 7.0 cc rejects these. */
- ++ccp;
- p = (char**) ccp;
- ccp = (char const *const *) p;
- { /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
- }
- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
- }
- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
- }
- { /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
- }
- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
- }
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_c_const=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_c_const=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6
-if test $ac_cv_c_const = no; then
-
-cat >>confdefs.h <<\_ACEOF
-#define const
-_ACEOF
-
-fi
-
-
-
-
-
-for ac_func in strchr memcpy snprintf
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-echo "$as_me:$LINENO: checking for connect" >&5
-echo $ECHO_N "checking for connect... $ECHO_C" >&6
-if test "${ac_cv_func_connect+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define connect to an innocuous variant, in case <limits.h> declares connect.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define connect innocuous_connect
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char connect (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef connect
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char connect ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_connect) || defined (__stub___connect)
-choke me
-#else
-char (*f) () = connect;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != connect;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_connect=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_connect=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
-echo "${ECHO_T}$ac_cv_func_connect" >&6
-
-if test $ac_cv_func_connect = no; then
- echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
-echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
-if test "${ac_cv_lib_socket_connect+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char connect ();
-int
-main ()
-{
-connect ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_socket_connect=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_socket_connect=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
-if test $ac_cv_lib_socket_connect = yes; then
- EXTRA_LIBS="$EXTRA_LIBS -lsocket"
-fi
-
-fi
-echo "$as_me:$LINENO: checking for gethostbyname" >&5
-echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
-if test "${ac_cv_func_gethostbyname+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define gethostbyname innocuous_gethostbyname
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char gethostbyname (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef gethostbyname
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gethostbyname ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
-choke me
-#else
-char (*f) () = gethostbyname;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != gethostbyname;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_gethostbyname=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_gethostbyname=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
-
-if test $ac_cv_func_gethostbyname = no; then
- echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
-echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
-if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gethostbyname ();
-int
-main ()
-{
-gethostbyname ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_nsl_gethostbyname=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_nsl_gethostbyname=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
-if test $ac_cv_lib_nsl_gethostbyname = yes; then
- EXTRA_LIBS="$EXTRA_LIBS -lnsl"
-fi
-
-fi
-# AC_CHECK_LIB(db, snprintf, EXTRA_LIBS="$EXTRA_LIBS -ldb")
-
-#
-# checks specific to this project
-#
-echo "$as_me:$LINENO: checking for inline" >&5
-echo $ECHO_N "checking for inline... $ECHO_C" >&6
-if test "${ac_cv_c_inline+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_c_inline=$ac_kw; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
-echo "${ECHO_T}$ac_cv_c_inline" >&6
-
-
-case $ac_cv_c_inline in
- inline | yes) ;;
- *)
- case $ac_cv_c_inline in
- no) ac_val=;;
- *) ac_val=$ac_cv_c_inline;;
- esac
- cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
- ;;
-esac
-
-
-echo "$as_me:$LINENO: checking for filter cc" >&5
-echo $ECHO_N "checking for filter cc... $ECHO_C" >&6
-
-# Check whether --with-filter-cc or --without-filter-cc was given.
-if test "${with_filter_cc+set}" = set; then
- withval="$with_filter_cc"
- FILTER_CC=\\\"$withval\\\"
-else
- FILTER_CC=NULL
-fi;
-echo "$as_me:$LINENO: result: $FILTER_CC" >&5
-echo "${ECHO_T}$FILTER_CC" >&6
-
-
-echo "$as_me:$LINENO: checking for filter cflags" >&5
-echo $ECHO_N "checking for filter cflags... $ECHO_C" >&6
-
-# Check whether --with-filter-cflags or --without-filter-cflags was given.
-if test "${with_filter_cflags+set}" = set; then
- withval="$with_filter_cflags"
- FILTER_CFLAGS=\\\"$withval\\\"
-else
- FILTER_CFLAGS=NULL
-fi;
-echo "$as_me:$LINENO: result: $FILTER_CFLAGS" >&5
-echo "${ECHO_T}$FILTER_CFLAGS" >&6
-
-
-DEFLIB="libfilter.a"
-echo "$as_me:$LINENO: checking for alternate target library" >&5
-echo $ECHO_N "checking for alternate target library... $ECHO_C" >&6
-
-# Check whether --with-altlib or --without-altlib was given.
-if test "${with_altlib+set}" = set; then
- withval="$with_altlib"
- alt_lib=yes LIB=$withval
-else
- alt_lib=no LIB=$DEFLIB
-fi;
-echo "$as_me:$LINENO: result: $alt_lib ($LIB)" >&5
-echo "${ECHO_T}$alt_lib ($LIB)" >&6
-
-
-
-echo "$as_me:$LINENO: checking for shared library build" >&5
-echo $ECHO_N "checking for shared library build... $ECHO_C" >&6
-# Check whether --enable-shared or --disable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval="$enable_shared"
- fun_ok=$enableval
-else
- fun_ok=no
-fi;
-if test "$fun_ok" != "no"; then
- fpic="yes"
- DOSHARED=shlib
-
- if test "$fun_ok" = "link"; then
- LLIB="-L. -l$PACKAGE_NAME"
- else
- LLIB='$(LIB)'
- fi
-else
- LLIB='$(LIB)'
-fi
-
-echo "$as_me:$LINENO: result: $fun_ok" >&5
-echo "${ECHO_T}$fun_ok" >&6
-
-# Check whether --enable-dl or --disable-dl was given.
-if test "${enable_dl+set}" = set; then
- enableval="$enable_dl"
- fun_ok=$enableval
-else
- fun_ok=no
-fi;
-if test "$fun_ok" = "yes"; then
-echo "$as_me:$LINENO: checking for dynamic loading (with gcc) " >&5
-echo $ECHO_N "checking for dynamic loading (with gcc) ... $ECHO_C" >&6
-if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
- using_dl="yes"
- echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dl_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
- have_dl=yes
-else
- have_dl=no
-fi
-
- if test "$have_dl" = yes; then
- USE_DL="-DUSE_DL=1"
- fpic="yes"
- EXTRA_LIBS="$EXTRA_LIBS -ldl"
- if test `$CC -v -rdynamic 2>&1 | grep -c unrecognized` = "0" ; then
- LDFLAGS="$LDFLAGS -rdynamic"
- fi
- else
- echo "$as_me:$LINENO: checking for dlopen in -lc" >&5
-echo $ECHO_N "checking for dlopen in -lc... $ECHO_C" >&6
-if test "${ac_cv_lib_c_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_c_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_c_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_c_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_c_dlopen" >&6
-if test $ac_cv_lib_c_dlopen = yes; then
- have_dl=yes
-else
- have_dl=no
-fi
-
- if test "$have_dl" = yes; then
- USE_DL="-DUSE_DL=1"
- fpic="yes"
- if test `$CC -v -rdynamic 2>&1 | grep -c unrecognized` = "0" ; then
- LDFLAGS="$LDFLAGS -rdynamic"
- fi
- else
- using_dl="no"
- fi
- fi
-else
- using_dl="no"
-fi
-echo "$as_me:$LINENO: result: $using_dl ($CC)" >&5
-echo "${ECHO_T}$using_dl ($CC)" >&6
-fi
-
-# Check whether --enable-fpu_double or --disable-fpu_double was given.
-if test "${enable_fpu_double+set}" = set; then
- enableval="$enable_fpu_double"
- fun_ok=$enableval
-else
- fun_ok=no
-fi;
-if test "$fun_ok" = "yes"; then
-echo "$as_me:$LINENO: checking for setting fpu in double rounding mode (with gcc) " >&5
-echo $ECHO_N "checking for setting fpu in double rounding mode (with gcc) ... $ECHO_C" >&6
-if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
- using_fpu_double="yes"
- USE_FPU_DOUBLE="1"
-else
- using_fpu_double="no"
- USE_FPU_DOUBLE="0"
-fi
-echo "$as_me:$LINENO: result: $using_fpu_double" >&5
-echo "${ECHO_T}$using_fpu_double" >&6
-else
- USE_FPU_DOUBLE="0"
-fi
-
-
-echo "$as_me:$LINENO: checking $host_os configuration" >&5
-echo $ECHO_N "checking $host_os configuration... $ECHO_C" >&6
-PRE=""
-POST="|\& cat"
-case $host_os in
- *cygwin*|*Cygwin* )
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CYGWIN
-_ACEOF
-
- echo "$as_me:$LINENO: result: flagging Cygwin" >&5
-echo "${ECHO_T}flagging Cygwin" >&6
- PRE="sh -c {"
- POST="}"
- ;;
- *mingw32*|*Mingw32*)
- CFLAGS="$CFLAGS -mconsole -D_WSTRING_DEFINED=1"
- EXTRA_LIBS="$EXTRA_LIBS -lwsock32"
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MINGW32
-_ACEOF
-
- echo "$as_me:$LINENO: result: flagging MinGW" >&5
-echo "${ECHO_T}flagging MinGW" >&6
- ;;
- *osf*|*Osf*)
- echo "$as_me:$LINENO: checking for snprintf in -ldb" >&5
-echo $ECHO_N "checking for snprintf in -ldb... $ECHO_C" >&6
-if test "${ac_cv_lib_db_snprintf+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldb $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char snprintf ();
-int
-main ()
-{
-snprintf ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_db_snprintf=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_db_snprintf=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_db_snprintf" >&5
-echo "${ECHO_T}$ac_cv_lib_db_snprintf" >&6
-if test $ac_cv_lib_db_snprintf = yes; then
- EXTRA_LIBS="$EXTRA_LIBS -ldb"
-fi
-
- ;;
- *darwin*|*Darwin*)
- LDFLAGS="$LDFLAGS $CFLAGS"
- G=`$CC -v 2>&1 | grep version | awk '{print $3}' | awk -F. '{print $1$2}'`
- if test x"$G" != x -a "$G" -lt 42; then
- CFLAGS="$CFLAGS -no-cpp-precomp"
- fi
- CFLAGS="$CFLAGS -fno-common"
- if test x"$fpic" = x"yes" ; then
- CFLAGS="$CFLAGS -fPIC"
- echo "$as_me:$LINENO: result: adding -fno-common, -fPIC to CFLAGS" >&5
-echo "${ECHO_T}adding -fno-common, -fPIC to CFLAGS" >&6
- else
- echo "$as_me:$LINENO: result: adding -fno-common to CFLAGS" >&5
-echo "${ECHO_T}adding -fno-common to CFLAGS" >&6
- fi
- ;;
- * )
- if test x"$fpic" = x"yes" ; then
- if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
- CFLAGS="$CFLAGS -fPIC"
- echo "$as_me:$LINENO: result: adding -fPIC to gcc" >&5
-echo "${ECHO_T}adding -fPIC to gcc" >&6
- else
- echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6
- fi
- else
- echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6
- fi
- ;;
-esac
-
-
-
-
-
-
- ac_config_files="$ac_config_files Makefile"
-
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-{
- (set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-} |
- sed '
- t clear
- : clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
- if test -w $cache_file; then
- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
- cat confcache >$cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[ ]*$//;
-}'
-fi
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling. Logging --version etc. is OK.
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by filter $as_me 1.1, which was
-generated by GNU Autoconf 2.59. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-_ACEOF
-
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-filter config.status 1.1
-configured by $0, generated by GNU Autoconf 2.59,
- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2003 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "x$1" : 'x\([^=]*\)='`
- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- -*)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- *) # This is not an option, so the user has probably given explicit
- # arguments.
- ac_option=$1
- ac_need_defaults=false;;
- esac
-
- case $ac_option in
- # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --vers* | -V )
- echo "$ac_cs_version"; exit 0 ;;
- --he | --h)
- # Conflict between --help and --header
- { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1" ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-
-
-
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_config_target in $ac_config_targets
-do
- case "$ac_config_target" in
- # Handling of arguments.
- "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "conf.h" ) CONFIG_HEADERS="$CONFIG_HEADERS conf.h" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./confstat$$-$RANDOM
- (umask 077 && mkdir $tmp)
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
-#
-# CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
- # Protect against being on the right side of a sed subst in config.status.
- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@build@,$build,;t t
-s,@build_cpu@,$build_cpu,;t t
-s,@build_vendor@,$build_vendor,;t t
-s,@build_os@,$build_os,;t t
-s,@host@,$host,;t t
-s,@host_cpu@,$host_cpu,;t t
-s,@host_vendor@,$host_vendor,;t t
-s,@host_os@,$host_os,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@RANLIB@,$RANLIB,;t t
-s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s,@CPP@,$CPP,;t t
-s,@EGREP@,$EGREP,;t t
-s,@FILTER_CC@,$FILTER_CC,;t t
-s,@FILTER_CFLAGS@,$FILTER_CFLAGS,;t t
-s,@LIB@,$LIB,;t t
-s,@DEFLIB@,$DEFLIB,;t t
-s,@DOSHARED@,$DOSHARED,;t t
-s,@LLIB@,$LLIB,;t t
-s,@USE_FPU_DOUBLE@,$USE_FPU_DOUBLE,;t t
-s,@USE_DL@,$USE_DL,;t t
-s,@EXTRA_LIBS@,$EXTRA_LIBS,;t t
-s,@EXTRA_OBJS@,$EXTRA_OBJS,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
- cat >>$CONFIG_STATUS <<\_ACEOF
- # Split the substitutions into bite-sized pieces for seds with
- # small command number limits, like on Digital OSF/1 and HP-UX.
- ac_max_sed_lines=48
- ac_sed_frag=1 # Number of current file.
- ac_beg=1 # First line for current file.
- ac_end=$ac_max_sed_lines # Line after last line for current file.
- ac_more_lines=:
- ac_sed_cmds=
- while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- else
- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- fi
- if test ! -s $tmp/subs.frag; then
- ac_more_lines=false
- else
- # The purpose of the label and of the branching condition is to
- # speed up the sed processing (if there are no `@' at all, there
- # is no need to browse any of the substitutions).
- # These are the two extra sed commands mentioned above.
- (echo ':t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
- fi
- ac_sed_frag=`expr $ac_sed_frag + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_lines`
- fi
- done
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
- fi
-fi # test -n "$CONFIG_FILES"
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
- esac
-
- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
-
-
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- configure_input=
- else
- configure_input="$ac_file. "
- fi
- configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
- rm -f $tmp/stdin
- if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
- else
- cat $tmp/out
- rm -f $tmp/out
- fi
-
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='[ ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
- esac
-
- test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- # Do quote $f, to prevent DOS paths from being IFS'd.
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
- # Remove the trailing spaces.
- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
-
-_ACEOF
-
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h. The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status. Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless. Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
-
-# This sed command replaces #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
-
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo ' :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
-do
- # Write a limited-size here document to $tmp/defines.sed.
- echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
- # Speed up: don't consider the non `#define' lines.
- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
- # Work around the forget-to-reset-the-flag bug.
- echo 't clr' >>$CONFIG_STATUS
- echo ': clr' >>$CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
- echo 'CEOF
- sed -f $tmp/defines.sed $tmp/in >$tmp/out
- rm -f $tmp/in
- mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
- rm -f conftest.defines
- mv conftest.tail conftest.defines
-done
-rm -f conftest.defines
-echo ' fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
-
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
- # Write a limited-size here document to $tmp/undefs.sed.
- echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
- # Speed up: don't consider the non `#undef'
- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
- # Work around the forget-to-reset-the-flag bug.
- echo 't clr' >>$CONFIG_STATUS
- echo ': clr' >>$CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
- echo 'CEOF
- sed -f $tmp/undefs.sed $tmp/in >$tmp/out
- rm -f $tmp/in
- mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
- rm -f conftest.undefs
- mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
-
-cat >>$CONFIG_STATUS <<\_ACEOF
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- echo "/* Generated by configure. */" >$tmp/config.h
- else
- echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
- fi
- cat $tmp/in >>$tmp/config.h
- rm -f $tmp/in
- if test x"$ac_file" != x-; then
- if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
- else
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- rm -f $ac_file
- mv $tmp/config.h $ac_file
- fi
- else
- cat $tmp/config.h
- rm -f $tmp/config.h
- fi
-done
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
-
diff --git a/funtools/filter/configure.ac b/funtools/filter/configure.ac
deleted file mode 100644
index ae2a3db..0000000
--- a/funtools/filter/configure.ac
+++ /dev/null
@@ -1,202 +0,0 @@
-# This file is an input file used by the GNU "autoconf" program to
-# generate the file "configure", which is run during XPA installation
-# to configure the system for the local environment.
-AC_INIT(filter, 1.1, saord@cfa.harvard.edu, filter)
-
-AC_CONFIG_HEADERS([conf.h])
-AC_CONFIG_SRCDIR(./filter.h)
-AC_CANONICAL_HOST
-
-#
-# checks that we use in most projects
-#
-AC_PROG_CC
-
-AC_EXEEXT
-if test x"${EXEEXT}" = "xno"; then
- EXEEXT=""
-fi
-
-AC_C_LONG_LONG
-
-AC_PROG_RANLIB
-
-AC_HEADER_STDC
-AC_CHECK_HEADERS(malloc.h)
-AC_CHECK_HEADERS(getopt.h)
-AC_CHECK_HEADERS(values.h)
-AC_CHECK_HEADERS(dlfcn.h)
-AC_CHECK_HEADERS(sys/un.h)
-AC_CHECK_HEADERS(sys/mman.h)
-AC_CHECK_HEADERS(sys/ipc.h)
-case $host_os in
- *cygwin*|*Cygwin* )
- ;;
- * )
- AC_CHECK_HEADERS(sys/shm.h)
- ;;
-esac
-
-AC_CHECK_TYPES([socklen_t], [], [], [#include <sys/socket.h>])
-
-AC_C_CONST
-
-AC_CHECK_FUNCS(strchr memcpy snprintf)
-
-AC_CHECK_FUNC(connect)
-if test $ac_cv_func_connect = no; then
- AC_CHECK_LIB(socket, connect, EXTRA_LIBS="$EXTRA_LIBS -lsocket")
-fi
-AC_CHECK_FUNC(gethostbyname)
-if test $ac_cv_func_gethostbyname = no; then
- AC_CHECK_LIB(nsl, gethostbyname, EXTRA_LIBS="$EXTRA_LIBS -lnsl")
-fi
-# AC_CHECK_LIB(db, snprintf, EXTRA_LIBS="$EXTRA_LIBS -ldb")
-
-#
-# checks specific to this project
-#
-AC_C_INLINE
-
-AC_MSG_CHECKING(for filter cc)
-AC_ARG_WITH(filter-cc, [ --with-filter-cc=CC compiler],
- FILTER_CC=\\\"$withval\\\", FILTER_CC=NULL)
-AC_MSG_RESULT($FILTER_CC)
-AC_SUBST(FILTER_CC)
-
-AC_MSG_CHECKING(for filter cflags)
-AC_ARG_WITH(filter-cflags, [ --with-filter-cflags=CFLAGS compiler flags],
- FILTER_CFLAGS=\\\"$withval\\\", FILTER_CFLAGS=NULL)
-AC_MSG_RESULT($FILTER_CFLAGS)
-AC_SUBST(FILTER_CFLAGS)
-
-DEFLIB="libfilter.a"
-AC_MSG_CHECKING(for alternate target library)
-AC_ARG_WITH(altlib, [ --with-altlib=LIB library name],
- alt_lib=yes LIB=$withval, alt_lib=no LIB=$DEFLIB)
-AC_MSG_RESULT($alt_lib ($LIB))
-AC_SUBST(LIB)
-AC_SUBST(DEFLIB)
-
-AC_MSG_CHECKING(for shared library build)
-AC_ARG_ENABLE(shared, [ --enable-shared build shared libraries],
- [fun_ok=$enableval], [fun_ok=no])
-if test "$fun_ok" != "no"; then
- fpic="yes"
- DOSHARED=shlib
- AC_SUBST(DOSHARED)
- if test "$fun_ok" = "link"; then
- LLIB="-L. -l$PACKAGE_NAME"
- else
- LLIB='$(LIB)'
- fi
-else
- LLIB='$(LIB)'
-fi
-AC_SUBST(LLIB)
-AC_MSG_RESULT($fun_ok)
-
-AC_ARG_ENABLE(dl, [ --enable-dl allow use of dynamic loading if available],
- [fun_ok=$enableval], [fun_ok=no])
-if test "$fun_ok" = "yes"; then
-AC_MSG_CHECKING([for dynamic loading (with gcc) ])
-if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
- using_dl="yes"
- AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
- if test "$have_dl" = yes; then
- USE_DL="-DUSE_DL=1"
- fpic="yes"
- EXTRA_LIBS="$EXTRA_LIBS -ldl"
- if test `$CC -v -rdynamic 2>&1 | grep -c unrecognized` = "0" ; then
- LDFLAGS="$LDFLAGS -rdynamic"
- fi
- else
- AC_CHECK_LIB(c, dlopen, have_dl=yes, have_dl=no)
- if test "$have_dl" = yes; then
- USE_DL="-DUSE_DL=1"
- fpic="yes"
- if test `$CC -v -rdynamic 2>&1 | grep -c unrecognized` = "0" ; then
- LDFLAGS="$LDFLAGS -rdynamic"
- fi
- else
- using_dl="no"
- fi
- fi
-else
- using_dl="no"
-fi
-AC_MSG_RESULT([$using_dl ($CC)])
-fi
-
-AC_ARG_ENABLE(fpu_double, [ --enable-fpu_double set FPU in double round mode],
- [fun_ok=$enableval], [fun_ok=no])
-if test "$fun_ok" = "yes"; then
-AC_MSG_CHECKING([for setting fpu in double rounding mode (with gcc) ])
-if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
- using_fpu_double="yes"
- USE_FPU_DOUBLE="1"
-else
- using_fpu_double="no"
- USE_FPU_DOUBLE="0"
-fi
-AC_MSG_RESULT([$using_fpu_double])
-else
- USE_FPU_DOUBLE="0"
-fi
-AC_SUBST(USE_FPU_DOUBLE)
-
-AC_MSG_CHECKING([$host_os configuration])
-PRE=""
-POST="|\& cat"
-case $host_os in
- *cygwin*|*Cygwin* )
- AC_DEFINE([HAVE_CYGWIN])
- AC_MSG_RESULT(flagging Cygwin)
- PRE="sh -c {"
- POST="}"
- ;;
- *mingw32*|*Mingw32*)
- CFLAGS="$CFLAGS -mconsole -D_WSTRING_DEFINED=1"
- EXTRA_LIBS="$EXTRA_LIBS -lwsock32"
- AC_DEFINE([HAVE_MINGW32])
- AC_MSG_RESULT(flagging MinGW)
- ;;
- *osf*|*Osf*)
- AC_CHECK_LIB(db, snprintf, EXTRA_LIBS="$EXTRA_LIBS -ldb")
- ;;
- *darwin*|*Darwin*)
- LDFLAGS="$LDFLAGS $CFLAGS"
- G=`$CC -v 2>&1 | grep version | awk '{print $3}' | awk -F. '{print $1$2}'`
- if test x"$G" != x -a "$G" -lt 42; then
- CFLAGS="$CFLAGS -no-cpp-precomp"
- fi
- CFLAGS="$CFLAGS -fno-common"
- if test x"$fpic" = x"yes" ; then
- CFLAGS="$CFLAGS -fPIC"
- AC_MSG_RESULT([adding -fno-common, -fPIC to CFLAGS])
- else
- AC_MSG_RESULT([adding -fno-common to CFLAGS])
- fi
- ;;
- * )
- if test x"$fpic" = x"yes" ; then
- if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
- CFLAGS="$CFLAGS -fPIC"
- AC_MSG_RESULT(adding -fPIC to gcc)
- else
- AC_MSG_RESULT(none)
- fi
- else
- AC_MSG_RESULT(none)
- fi
- ;;
-esac
-
-AC_SUBST(USE_DL)
-
-AC_SUBST(EXTRA_LIBS)
-AC_SUBST(EXTRA_OBJS)
-
-AC_CONFIG_FILES(Makefile)
-
-AC_OUTPUT
diff --git a/funtools/filter/dl.c b/funtools/filter/dl.c
deleted file mode 100644
index 8e914f2..0000000
--- a/funtools/filter/dl.c
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifdef USE_DL
-
-#include <stdio.h>
-#include <dl.h>
-#include <gio.h>
-#include <prsetup.h>
-
-int have_dl = 1;
-
-#ifdef ANSI_FUNC
-void *
-DLOpen(char *name)
-#else
-void *DLOpen(name)
- char *name;
-#endif
-{
- void *d;
- if( !(d=dlopen(name, RTLD_LAZY)) )
- gerror(stderr, "%s\n", dlerror());
- return d;
-}
-
-#ifdef ANSI_FUNC
-void *
-DLSym(void *dl, char *name)
-#else
-void *DLSym(dl, name)
- void *dl;
- char *name;
-#endif
-{
- void *d;
- if( !(d=dlsym(dl, name)) )
- gerror(stderr, "%s\n", dlerror());
- return d;
-}
-
-#ifdef ANSI_FUNC
-int
-DLClose(void *dl)
-#else
-int DLClose(dl)
- void *dl;
-#endif
-{
- if( dl )
- return dlclose(dl);
- else
- return -1;
-}
-
-#else
-
-int have_dl = 0;
-
-#endif
diff --git a/funtools/filter/dl.h b/funtools/filter/dl.h
deleted file mode 100644
index e3f1b09..0000000
--- a/funtools/filter/dl.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef __dl_h
-#define __dl_h
-
-#if HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-#ifdef HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include "prsetup.h"
-
-_PRbeg
-
-void *DLOpen _PRx((char *name));
-void *DLSym _PRx((void *dl, char *name));
-int DLClose _PRx((void *dl));
-
-
-_PRend
-
-#endif
diff --git a/funtools/filter/events_c.h b/funtools/filter/events_c.h
deleted file mode 100644
index 74f180e..0000000
--- a/funtools/filter/events_c.h
+++ /dev/null
@@ -1 +0,0 @@
-static char *EVENTS_C="\n\n#ifdef TEST\n#include <math.h>\n#define EVFILTRTN _FilterEvents\n#define NSHAPE 1\n#define NREGION 1\n#define _X_ X\n#define _Y_ Y\n#define FILTER ((circle(g,1,1,1,_X_,_Y_,1,2,3)))\n#define EVSIZE 4\n#define X *((short *)(eptr+0))\n#define Y *((short *)(eptr+2))\n#include \"regions.h\"\n#endif\n\nstatic char __abuf[EVSIZE+1];\nstatic char *acopy(void *s, int n)\n{\n memset(__abuf, 0, n+1);\n memmove(__abuf, s, n);\n return __abuf;\n}\n\nvoid *EVFILTRTN(void *tg, char *ebuf, int ne, int esize, int *rbuf)\n{\n int i, j;\n int *rptr;\n char *eptr;\n Scan scan, tscan;\n GFilt g = (GFilt)tg;\n\n \n \n eptr = ebuf;\n\n if( !g ){\n g = (GFilt)calloc(1, sizeof(GFiltRec));\n#if NSHAPE\n \n g->nshapes = NSHAPE;\n g->maxshapes = (NSHAPE*(XSNO+1))+1;\n g->shapes = (Shape)calloc(g->maxshapes, sizeof(ShapeRec));\n#endif\n#ifdef EVSECT\n \n g->evsect = EVSECT;\n sscanf(g->evsect, \"%d %d %d %d %d\",\n &g->xmin, &g->xmax, &g->ymin, &g->ymax, &g->block);\n \n g->x0 = 1;\n g->y0 = 1;\n g->x1 = (g->xmax-g->xmin)/g->block+1;\n g->y1 = (g->ymax-g->ymin)/g->block+1;\n \n g->ybuf = (int *)calloc(g->y1+1, sizeof(int));\n g->x0s = (int *)calloc(g->y1+1, sizeof(int));\n g->x1s = (int *)calloc(g->y1+1, sizeof(int));\n \n for(i=0; i<=g->y1; i++) g->x0s[i] = g->x0;\n for(i=0; i<=g->y1; i++) g->x1s[i] = g->x1;\n \n if( NMASK ){\n g->nmask = NMASK; \n g->maskdim = MASKDIM;\n g->masks = _masks;\n }\n \n#if DO_FILTER_SWAP\n memset(_swf, 0, EVSIZE);\n#endif\n if( eptr ) FINIT;\n \n g->tlminx = TLMINX;\n g->tlminy = TLMINY;\n g->usebinsiz = USEBINSIZ;\n if( BINSIZX > 0.0 )\n g->binsizx = BINSIZX;\n else\n g->binsizx = 1.0;\n if( BINSIZY > 0.0 )\n g->binsizy = BINSIZY;\n else\n g->binsizy = 1.0;\n g->tloff = TLOFF;\n#endif\n }\n\n \n if( !ebuf && !rbuf && (ne<0) ){\n#if NSHAPE\n \n for(i=0; i<g->maxshapes; i++){\n if( g->shapes[i].scanlist ){\n for(j=0; j<g->y1; j++){\n if( g->shapes[i].scanlist[j] ){\n for(scan=g->shapes[i].scanlist[j]; scan; ){\n tscan = scan->next;\n if( scan ) free(scan);\n scan = tscan;\n }\n }\n }\n if( g->shapes[i].scanlist ) free(g->shapes[i].scanlist);\n }\n if( g->shapes[i].pts ) free(g->shapes[i].pts);\n if( g->shapes[i].xv ) free(g->shapes[i].xv);\n }\n if( g->masks ) free(g->masks);\n if( g->shapes ) free(g->shapes);\n if( g->ybuf ) free(g->ybuf);\n if( g->x0s ) free(g->x0s);\n if( g->x1s ) free(g->x1s);\n if( g ) free(g);\n#endif\n return NULL;\n }\n else{\n \n for(rptr=rbuf, eptr=ebuf; ne--; rptr++, eptr += esize){\n g->rid = 0;\n#if DO_FILTER_SWAP\n memset(_swf, 0, EVSIZE);\n#endif\n *rptr = ((FILTER) ? (g->rid ? g->rid : -1) : 0);\n }\n return (void *)g;\n }\n}\n\nint main(int argc, char **argv)\n{\n int i;\n#if HAVE_MINGW32==0\n int pipes[4];\n#endif\n int get, got;\n#if DO_FILTER_SWAP\n int sgot;\n#endif\n int n;\n int *rbuf;\n char *ebuf, *etop;\n char *s=NULL, *t=NULL, *u=NULL;\n void *g=NULL;\n#if USE_WIN32\n HANDLE hStdin, hStdout; \n DWORD dwRead, dwWritten; \n#endif\n\n \n#if HAVE_MINGW32==0\n if( (s=getenv(\"LAUNCH_PIPES\")) ){\n t = (char *)strdup(s);\n for(i=0, u=(char *)strtok(t, \",\"); i<4 && u; \n i++, u=(char *)strtok(NULL,\",\")){\n pipes[i] = atoi(u);\n }\n if( t ) free(t);\n if( i < 4 ) return(1);\n close(pipes[0]);\n close(pipes[3]);\n dup2(pipes[2], 0); close(pipes[2]);\n dup2(pipes[1], 1); close(pipes[1]);\n }\n#endif\n\n#if USE_WIN32\n hStdout = GetStdHandle(STD_OUTPUT_HANDLE); \n hStdin = GetStdHandle(STD_INPUT_HANDLE); \n if( (hStdout == INVALID_HANDLE_VALUE) || (hStdin == INVALID_HANDLE_VALUE) ){\n unlink(argv[0]);\n return 0;\n }\n#endif\n\n \n#if USE_WIN32\n while((ReadFile(hStdin, &get, sizeof(int), &dwRead, NULL) >0) && \n (dwRead == sizeof(int)) ){\n#else\n while( read(0, &get, sizeof(int)) == sizeof(int) ){\n#endif\n#if DO_FILTER_SWAP\n switch(sizeof(int)){\n case 2:\n _sw2((char *)&get,2,NULL,0);\n break;\n case 4:\n _sw4((char *)&get,4,NULL,0);\n break;\n case 8:\n _sw8((char *)&get,8,NULL,0);\n break;\n }\n#endif\n ebuf = (char *)calloc(get, sizeof(char));\n#if USE_WIN32\n for(n=0, etop=ebuf; get>0; etop += got, get -= dwRead){\n if((ReadFile(hStdin, etop, get, &dwRead, NULL)==FALSE) || (dwRead==0))\n break;\n n += dwRead;\n }\n#else\n for(n=0, etop=ebuf; get>0; etop += got, get -= got){\n if( (got=read(0, etop, get)) <=0 ) \n break;\n n += got;\n }\n#endif\n n /= EVSIZE;\n \n rbuf = (int *)calloc(n, sizeof(int));\n \n g = EVFILTRTN(g, ebuf, n, EVSIZE, rbuf);\n \n got = n*sizeof(int);\n#if DO_FILTER_SWAP\n sgot = got;\n switch(sizeof(int)){\n case 2:\n _sw2((char *)&sgot,2,NULL,0);\n break;\n case 4:\n _sw4((char *)&sgot,4,NULL,0);\n break;\n case 8:\n _sw8((char *)&sgot,8,NULL,0);\n break;\n }\n#if USE_WIN32\n WriteFile(hStdout, &sgot, sizeof(int), &dwWritten, NULL); \n#else\n write(1, &sgot, sizeof(int));\n#endif\n#else\n#if USE_WIN32\n WriteFile(hStdout, &got, sizeof(int), &dwWritten, NULL); \n#else\n write(1, &got, sizeof(int));\n#endif\n#endif\n#if DO_FILTER_SWAP\n switch(sizeof(int)){\n case 2:\n _sw2((char *)rbuf,got,NULL,0);\n break;\n case 4:\n _sw4((char *)rbuf,got,NULL,0);\n break;\n case 8:\n _sw8((char *)rbuf,got,NULL,0);\n break;\n }\n#endif\n#if USE_WIN32\n WriteFile(hStdout, rbuf, got, &dwWritten, NULL); \n#else\n write(1, rbuf, got);\n#endif\n if( ebuf) free(ebuf);\n if( rbuf ) free(rbuf);\n }\n EVFILTRTN(g, NULL, -1, 0, NULL);\n unlink(argv[0]);\n return 0;\n}\n";
diff --git a/funtools/filter/events_py.h b/funtools/filter/events_py.h
deleted file mode 100644
index fdf775b..0000000
--- a/funtools/filter/events_py.h
+++ /dev/null
@@ -1 +0,0 @@
-static char *EVENTS_PY="\n# load the funtools routines\n_libname = './libfuntools.so.1.0'\nlibfuntools=cdll.LoadLibrary(_libname)\nlibc=cdll.LoadLibrary(None)\n\n# region definitions\nimannulusi=libfuntools.imannulusi\nimboxi=libfuntools.imboxi\nimcirclei=libfuntools.imcirclei\nimellipsei=libfuntools.imellipsei\nimfieldi=libfuntools.imfieldi\nimlinei=libfuntools.imlinei\nimpiei=libfuntools.impiei\nimqtpiei=libfuntools.imqtpiei\nimpointi=libfuntools.impointi\nimpandai=libfuntools.impandai\nimnannulusi=libfuntools.imnannulusi\nimnboxi=libfuntools.imnboxi\nimnellipsei=libfuntools.imnellipsei\nimnpiei=libfuntools.imnpiei\nimpolygoni=libfuntools.impolygoni\nimvannulusi=libfuntools.imvannulusi\nimvboxi=libfuntools.imvboxi\nimvellipsei=libfuntools.imvellipsei\nimvpiei=libfuntools.imvpiei\nimvpointi=libfuntools.imvpointi\nimannulus=libfuntools.imannulus\nimbox=libfuntools.imbox\nimcircle=libfuntools.imcircle\nimellipse=libfuntools.imellipse\nimfield=libfuntools.imfield\nimline=libfuntools.imline\nimpie=libfuntools.impie\nimqtpie=libfuntools.imqtpie\nimpoint=libfuntools.impoint\nimpanda=libfuntools.impanda\nimnannulus=libfuntools.imnannulus\nimnbox=libfuntools.imnbox\nimnellipse=libfuntools.imnellipse\nimnpie=libfuntools.imnpie\nimpolygon=libfuntools.impolygon\nimvannulus=libfuntools.imvannulus\nimvbox=libfuntools.imvbox\nimvellipse=libfuntools.imvellipse\nimvpie=libfuntools.imvpie\nimvpoint=libfuntools.imvpoint\n\nevannulus=libfuntools.evannulus\nevbox=libfuntools.evbox\nevcircle=libfuntools.evcircle\nevellipse=libfuntools.evellipse\nevfield=libfuntools.evfield\nevline=libfuntools.evline\nevpie=libfuntools.evpie\nevqtpie=libfuntools.evqtpie\nevpoint=libfuntools.evpoint\nevnannulus=libfuntools.evnannulus\nevnbox=libfuntools.evnbox\nevnellipse=libfuntools.evnellipse\nevnpie=libfuntools.evnpie\nevpanda=libfuntools.evpanda\nevpolygon=libfuntools.evpolygon\nevvannulus=libfuntools.evvannulus\nevvbox=libfuntools.evvbox\nevvellipse=libfuntools.evvellipse\nevvpie=libfuntools.evvpie\nevvpoint=libfuntools.evvpoint\n\nevvcircle=libfuntools.evvannulus\nevncircle=libfuntools.evnannulus\nevcpanda=libfuntools.evpanda\n\nimvcirclei=libfuntools.imvannulusi\nimncirclei=libfuntools.imnannulusi\nimvcircle=libfuntools.imvannulus\nimncircle=libfuntools.imnannulus\nimcpandai=libfuntools.impandai\nimcpanda=libfuntools.impanda\n\n# from regions.h -- no idea what it is ...\nxsno=3\n\n# ... but its important!\nmaxshapes=(nshape*(xsno+1))+1\n\n# ctypes struct definitions (taken from filter.h)\nclass filtmask(Structure):\n _fields_ = [('region', c_int), ('y', c_int), ('xstart', c_int), ('xstop', c_int)]\n\nclass scanrec(Structure):\n pass\n\n# this is how you add a forward pointer\nscanrec._fields_ = [ ('next', POINTER(scanrec)), ('x', c_int) ]\n\nclass shaperec(Structure):\n _fields_ = [ ('init', c_int), ('ystart', c_double), ('ystop', c_double), ('scanlist', c_void_p), ('nv', c_int), ('xv', c_void_p), ('r1sq', c_double), ('r2sq', c_double), ('angl', c_double), ('sinangl', c_double), ('cosangl', c_double), ('cossq', c_double), ('sinsq', c_double), ('xradsq', c_double), ('yradsq', c_double), ('a', c_double), ('npt', c_int), ('pts', c_void_p), ('xonly', c_int), ('x1', c_double), ('x2', c_double), ('y1', c_double), ('invslope', c_double)]\n\nclass gfiltrec(Structure):\n _fields_ = [('nshapes', c_int), ('maxshapes', c_int), ('shapes', POINTER(shaperec * maxshapes)), ('rid', c_int), ('usebinsiz', c_int), ('evsect', c_char_p), ('tlminx', c_double), ('tlminy', c_double), ('binsizx', c_double), ('binsizy', c_double), ('tloff', c_double), ('xmin', c_int), ('xmax', c_int), ('ymin', c_int), ('ymax', c_int), ('block', c_int), ('x0', c_int), ('x1', c_int), ('y0', c_int), ('y1', c_int), ('ybuf', POINTER(c_int)), ('x0s', POINTER(c_int)), ('x1s', POINTER(c_int)), ('nmask', c_int), ('maskdim', c_int), ('masks', POINTER(filtmask))]\n\n# taken from the code in evfilter.c that initializes the g struct\n# allocate shape record\nshapearr = (shaperec * maxshapes)()\n# allocate g record\ngrec = gfiltrec()\n# fill in g record\ngrec.nshapes = nshape\ngrec.maxshapes = maxshapes\ngrec.shapes = pointer(shapearr)\n# pointer to g record\ng=pointer(grec)\n\n# # processing loop\n# while True:\n# rvals = ''\n# buf = sys.stdin.read(4)\n# if not buf: break\n# vals = struct.unpack('=i', buf)\n# nev = vals[0]/evsize\n# for i in range(nev):\n# evbuf = sys.stdin.read(evsize)\n# rvals += struct.pack('=i', xfilter(evdef, evbuf))\n# sys.stdout.write(struct.pack('=i', nev*4))\n# sys.stdout.write(rvals)\n# sys.stdout.flush()\n\n# processing loop\nobytes = 0\nwhile True:\n # get byte count\n nval = c_int(0)\n if libc.read(0, byref(nval), 4) != 4: break\n bytes = nval.value\n nev = bytes / evsize\n\n # create a new data buffer, if necessary\n if obytes != bytes:\n evbuf = create_string_buffer(bytes)\n pevbuf = addressof(evbuf)\n rvals = (c_int * nev)()\n obytes = bytes\n\n # read data\n if libc.read(0, evbuf, bytes) != bytes: break\n\n # process data\n ioff = 0\n for i in range(nev):\n rvals[i] = xfilter(evdef, evbuf[ioff:ioff+evsize])\n ioff += evsize\n\n # write result byte count and result data\n nval = c_int(nev*4)\n libc.write(1, byref(nval), 4)\n libc.write(1, rvals, nval)\n";
diff --git a/funtools/filter/evfilter.c b/funtools/filter/evfilter.c
deleted file mode 100644
index 58add93..0000000
--- a/funtools/filter/evfilter.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/* gcc -g -o foo event.body.c -lm */
-#ifdef TEST
-#include <math.h>
-#define EVFILTRTN _FilterEvents
-#define NSHAPE 1
-#define NREGION 1
-#define _X_ X
-#define _Y_ Y
-#define FILTER ((circle(g,1,1,1,_X_,_Y_,1,2,3)))
-#define EVSIZE 4
-#define X *((short *)(eptr+0))
-#define Y *((short *)(eptr+2))
-#include "regions.h"
-#endif
-
-static char __abuf[EVSIZE+1];
-static char *acopy(void *s, int n)
-{
- memset(__abuf, 0, n+1);
- memmove(__abuf, s, n);
- return __abuf;
-}
-
-void *EVFILTRTN(void *tg, char *ebuf, int ne, int esize, int *rbuf)
-{
- int i, j;
- int *rptr;
- char *eptr;
- Scan scan, tscan;
- GFilt g = (GFilt)tg;
-
- /* set eptr to ebuf -- this must be done before FINIT, because the latter */
- /*passes X and Y to shape init routines, and these defines use eptr */
- eptr = ebuf;
-
- if( !g ){
- g = (GFilt)calloc(1, sizeof(GFiltRec));
-#if NSHAPE
- /* allocate space for the globals */
- g->nshapes = NSHAPE;
- g->maxshapes = (NSHAPE*(XSNO+1))+1;
- g->shapes = (Shape)calloc(g->maxshapes, sizeof(ShapeRec));
-#endif
-#ifdef EVSECT
- /* if evsect is defined, we are filtering an image section */
- g->evsect = EVSECT;
- sscanf(g->evsect, "%d %d %d %d %d",
- &g->xmin, &g->xmax, &g->ymin, &g->ymax, &g->block);
- /* get x and y limits on subsection */
- g->x0 = 1;
- g->y0 = 1;
- g->x1 = (g->xmax-g->xmin)/g->block+1;
- g->y1 = (g->ymax-g->ymin)/g->block+1;
- /* allocate a buffer for valid y row flags */
- g->ybuf = (int *)calloc(g->y1+1, sizeof(int));
- g->x0s = (int *)calloc(g->y1+1, sizeof(int));
- g->x1s = (int *)calloc(g->y1+1, sizeof(int));
- /* seed impossible values for x limits */
- for(i=0; i<=g->y1; i++) g->x0s[i] = g->x0;
- for(i=0; i<=g->y1; i++) g->x1s[i] = g->x1;
- /* save image mask values */
- if( NMASK ){
- g->nmask = NMASK;
- g->maskdim = MASKDIM;
- g->masks = _masks;
- }
- /* initialize shapes -- but check to make sure eptr is OK */
-#if DO_FILTER_SWAP
- memset(_swf, 0, EVSIZE);
-#endif
- if( eptr ) FINIT;
- /* these also must be defined if EVSECT is being used */
- g->tlminx = TLMINX;
- g->tlminy = TLMINY;
- g->usebinsiz = USEBINSIZ;
- if( BINSIZX > 0.0 )
- g->binsizx = BINSIZX;
- else
- g->binsizx = 1.0;
- if( BINSIZY > 0.0 )
- g->binsizy = BINSIZY;
- else
- g->binsizy = 1.0;
- g->tloff = TLOFF;
-#endif
- }
-
- /* if we have negative events, we free the structs */
- if( !ebuf && !rbuf && (ne<0) ){
-#if NSHAPE
- /* free polygon records */
- for(i=0; i<g->maxshapes; i++){
- if( g->shapes[i].scanlist ){
- for(j=0; j<g->y1; j++){
- if( g->shapes[i].scanlist[j] ){
- for(scan=g->shapes[i].scanlist[j]; scan; ){
- tscan = scan->next;
- if( scan ) free(scan);
- scan = tscan;
- }
- }
- }
- if( g->shapes[i].scanlist ) free(g->shapes[i].scanlist);
- }
- if( g->shapes[i].pts ) free(g->shapes[i].pts);
- if( g->shapes[i].xv ) free(g->shapes[i].xv);
- }
- if( g->masks ) free(g->masks);
- if( g->shapes ) free(g->shapes);
- if( g->ybuf ) free(g->ybuf);
- if( g->x0s ) free(g->x0s);
- if( g->x1s ) free(g->x1s);
- if( g ) free(g);
-#endif
- return NULL;
- }
- else{
- /* do the filtering on each event */
- for(rptr=rbuf, eptr=ebuf; ne--; rptr++, eptr += esize){
- g->rid = 0;
-#if DO_FILTER_SWAP
- memset(_swf, 0, EVSIZE);
-#endif
- *rptr = ((FILTER) ? (g->rid ? g->rid : -1) : 0);
- }
- return (void *)g;
- }
-}
-
-int main(int argc, char **argv)
-{
- int i;
-#if HAVE_MINGW32==0
- int pipes[4];
-#endif
- int get, got;
-#if DO_FILTER_SWAP
- int sgot;
-#endif
- int n;
- int *rbuf;
- char *ebuf, *etop;
- char *s=NULL, *t=NULL, *u=NULL;
- void *g=NULL;
-#if USE_WIN32
- HANDLE hStdin, hStdout;
- DWORD dwRead, dwWritten;
-#endif
-
- /* Launch() sometimes rearranges passed pipes to be stdin/stdout */
-#if HAVE_MINGW32==0
- if( (s=getenv("LAUNCH_PIPES")) ){
- t = (char *)strdup(s);
- for(i=0, u=(char *)strtok(t, ","); i<4 && u;
- i++, u=(char *)strtok(NULL,",")){
- pipes[i] = atoi(u);
- }
- if( t ) free(t);
- if( i < 4 ) return(1);
- close(pipes[0]);
- close(pipes[3]);
- dup2(pipes[2], 0); close(pipes[2]);
- dup2(pipes[1], 1); close(pipes[1]);
- }
-#endif
-
-#if USE_WIN32
- hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
- hStdin = GetStdHandle(STD_INPUT_HANDLE);
- if( (hStdout == INVALID_HANDLE_VALUE) || (hStdin == INVALID_HANDLE_VALUE) ){
- unlink(argv[0]);
- return 0;
- }
-#endif
-
- /* read and filter events */
-#if USE_WIN32
- while((ReadFile(hStdin, &get, sizeof(int), &dwRead, NULL) >0) &&
- (dwRead == sizeof(int)) ){
-#else
- while( read(0, &get, sizeof(int)) == sizeof(int) ){
-#endif
-#if DO_FILTER_SWAP
- switch(sizeof(int)){
- case 2:
- _sw2((char *)&get,2,NULL,0);
- break;
- case 4:
- _sw4((char *)&get,4,NULL,0);
- break;
- case 8:
- _sw8((char *)&get,8,NULL,0);
- break;
- }
-#endif
- ebuf = (char *)calloc(get, sizeof(char));
-#if USE_WIN32
- for(n=0, etop=ebuf; get>0; etop += got, get -= dwRead){
- if((ReadFile(hStdin, etop, get, &dwRead, NULL)==FALSE) || (dwRead==0))
- break;
- n += dwRead;
- }
-#else
- for(n=0, etop=ebuf; get>0; etop += got, get -= got){
- if( (got=read(0, etop, get)) <=0 )
- break;
- n += got;
- }
-#endif
- n /= EVSIZE;
- /* allocate return value buffer */
- rbuf = (int *)calloc(n, sizeof(int));
- /* filter events, with results going into rbuf */
- g = EVFILTRTN(g, ebuf, n, EVSIZE, rbuf);
- /* write results */
- got = n*sizeof(int);
-#if DO_FILTER_SWAP
- sgot = got;
- switch(sizeof(int)){
- case 2:
- _sw2((char *)&sgot,2,NULL,0);
- break;
- case 4:
- _sw4((char *)&sgot,4,NULL,0);
- break;
- case 8:
- _sw8((char *)&sgot,8,NULL,0);
- break;
- }
-#if USE_WIN32
- WriteFile(hStdout, &sgot, sizeof(int), &dwWritten, NULL);
-#else
- write(1, &sgot, sizeof(int));
-#endif
-#else
-#if USE_WIN32
- WriteFile(hStdout, &got, sizeof(int), &dwWritten, NULL);
-#else
- write(1, &got, sizeof(int));
-#endif
-#endif
-#if DO_FILTER_SWAP
- switch(sizeof(int)){
- case 2:
- _sw2((char *)rbuf,got,NULL,0);
- break;
- case 4:
- _sw4((char *)rbuf,got,NULL,0);
- break;
- case 8:
- _sw8((char *)rbuf,got,NULL,0);
- break;
- }
-#endif
-#if USE_WIN32
- WriteFile(hStdout, rbuf, got, &dwWritten, NULL);
-#else
- write(1, rbuf, got);
-#endif
- if( ebuf) free(ebuf);
- if( rbuf ) free(rbuf);
- }
- EVFILTRTN(g, NULL, -1, 0, NULL);
- unlink(argv[0]);
- return 0;
-}
diff --git a/funtools/filter/evfilter.py b/funtools/filter/evfilter.py
deleted file mode 100644
index 70e617c..0000000
--- a/funtools/filter/evfilter.py
+++ /dev/null
@@ -1,156 +0,0 @@
-# load the funtools routines
-_libname = './libfuntools.so.1.0'
-libfuntools=cdll.LoadLibrary(_libname)
-libc=cdll.LoadLibrary(None)
-
-# region definitions
-imannulusi=libfuntools.imannulusi
-imboxi=libfuntools.imboxi
-imcirclei=libfuntools.imcirclei
-imellipsei=libfuntools.imellipsei
-imfieldi=libfuntools.imfieldi
-imlinei=libfuntools.imlinei
-impiei=libfuntools.impiei
-imqtpiei=libfuntools.imqtpiei
-impointi=libfuntools.impointi
-impandai=libfuntools.impandai
-imnannulusi=libfuntools.imnannulusi
-imnboxi=libfuntools.imnboxi
-imnellipsei=libfuntools.imnellipsei
-imnpiei=libfuntools.imnpiei
-impolygoni=libfuntools.impolygoni
-imvannulusi=libfuntools.imvannulusi
-imvboxi=libfuntools.imvboxi
-imvellipsei=libfuntools.imvellipsei
-imvpiei=libfuntools.imvpiei
-imvpointi=libfuntools.imvpointi
-imannulus=libfuntools.imannulus
-imbox=libfuntools.imbox
-imcircle=libfuntools.imcircle
-imellipse=libfuntools.imellipse
-imfield=libfuntools.imfield
-imline=libfuntools.imline
-impie=libfuntools.impie
-imqtpie=libfuntools.imqtpie
-impoint=libfuntools.impoint
-impanda=libfuntools.impanda
-imnannulus=libfuntools.imnannulus
-imnbox=libfuntools.imnbox
-imnellipse=libfuntools.imnellipse
-imnpie=libfuntools.imnpie
-impolygon=libfuntools.impolygon
-imvannulus=libfuntools.imvannulus
-imvbox=libfuntools.imvbox
-imvellipse=libfuntools.imvellipse
-imvpie=libfuntools.imvpie
-imvpoint=libfuntools.imvpoint
-
-evannulus=libfuntools.evannulus
-evbox=libfuntools.evbox
-evcircle=libfuntools.evcircle
-evellipse=libfuntools.evellipse
-evfield=libfuntools.evfield
-evline=libfuntools.evline
-evpie=libfuntools.evpie
-evqtpie=libfuntools.evqtpie
-evpoint=libfuntools.evpoint
-evnannulus=libfuntools.evnannulus
-evnbox=libfuntools.evnbox
-evnellipse=libfuntools.evnellipse
-evnpie=libfuntools.evnpie
-evpanda=libfuntools.evpanda
-evpolygon=libfuntools.evpolygon
-evvannulus=libfuntools.evvannulus
-evvbox=libfuntools.evvbox
-evvellipse=libfuntools.evvellipse
-evvpie=libfuntools.evvpie
-evvpoint=libfuntools.evvpoint
-
-evvcircle=libfuntools.evvannulus
-evncircle=libfuntools.evnannulus
-evcpanda=libfuntools.evpanda
-
-imvcirclei=libfuntools.imvannulusi
-imncirclei=libfuntools.imnannulusi
-imvcircle=libfuntools.imvannulus
-imncircle=libfuntools.imnannulus
-imcpandai=libfuntools.impandai
-imcpanda=libfuntools.impanda
-
-# from regions.h -- no idea what it is ...
-xsno=3
-
-# ... but its important!
-maxshapes=(nshape*(xsno+1))+1
-
-# ctypes struct definitions (taken from filter.h)
-class filtmask(Structure):
- _fields_ = [('region', c_int), ('y', c_int), ('xstart', c_int), ('xstop', c_int)]
-
-class scanrec(Structure):
- pass
-
-# this is how you add a forward pointer
-scanrec._fields_ = [ ('next', POINTER(scanrec)), ('x', c_int) ]
-
-class shaperec(Structure):
- _fields_ = [ ('init', c_int), ('ystart', c_double), ('ystop', c_double), ('scanlist', c_void_p), ('nv', c_int), ('xv', c_void_p), ('r1sq', c_double), ('r2sq', c_double), ('angl', c_double), ('sinangl', c_double), ('cosangl', c_double), ('cossq', c_double), ('sinsq', c_double), ('xradsq', c_double), ('yradsq', c_double), ('a', c_double), ('npt', c_int), ('pts', c_void_p), ('xonly', c_int), ('x1', c_double), ('x2', c_double), ('y1', c_double), ('invslope', c_double)]
-
-class gfiltrec(Structure):
- _fields_ = [('nshapes', c_int), ('maxshapes', c_int), ('shapes', POINTER(shaperec * maxshapes)), ('rid', c_int), ('usebinsiz', c_int), ('evsect', c_char_p), ('tlminx', c_double), ('tlminy', c_double), ('binsizx', c_double), ('binsizy', c_double), ('tloff', c_double), ('xmin', c_int), ('xmax', c_int), ('ymin', c_int), ('ymax', c_int), ('block', c_int), ('x0', c_int), ('x1', c_int), ('y0', c_int), ('y1', c_int), ('ybuf', POINTER(c_int)), ('x0s', POINTER(c_int)), ('x1s', POINTER(c_int)), ('nmask', c_int), ('maskdim', c_int), ('masks', POINTER(filtmask))]
-
-# taken from the code in evfilter.c that initializes the g struct
-# allocate shape record
-shapearr = (shaperec * maxshapes)()
-# allocate g record
-grec = gfiltrec()
-# fill in g record
-grec.nshapes = nshape
-grec.maxshapes = maxshapes
-grec.shapes = pointer(shapearr)
-# pointer to g record
-g=pointer(grec)
-
-# # processing loop
-# while True:
-# rvals = ''
-# buf = sys.stdin.read(4)
-# if not buf: break
-# vals = struct.unpack('=i', buf)
-# nev = vals[0]/evsize
-# for i in range(nev):
-# evbuf = sys.stdin.read(evsize)
-# rvals += struct.pack('=i', xfilter(evdef, evbuf))
-# sys.stdout.write(struct.pack('=i', nev*4))
-# sys.stdout.write(rvals)
-# sys.stdout.flush()
-
-# processing loop
-obytes = 0
-while True:
- # get byte count
- nval = c_int(0)
- if libc.read(0, byref(nval), 4) != 4: break
- bytes = nval.value
- nev = bytes / evsize
-
- # create a new data buffer, if necessary
- if obytes != bytes:
- evbuf = create_string_buffer(bytes)
- pevbuf = addressof(evbuf)
- rvals = (c_int * nev)()
- obytes = bytes
-
- # read data
- if libc.read(0, evbuf, bytes) != bytes: break
-
- # process data
- ioff = 0
- for i in range(nev):
- rvals[i] = xfilter(evdef, evbuf[ioff:ioff+evsize])
- ioff += evsize
-
- # write result byte count and result data
- nval = c_int(nev*4)
- libc.write(1, byref(nval), 4)
- libc.write(1, rvals, nval)
diff --git a/funtools/filter/evregions.c b/funtools/filter/evregions.c
deleted file mode 100644
index 2b28152..0000000
--- a/funtools/filter/evregions.c
+++ /dev/null
@@ -1,1532 +0,0 @@
-/*
- NB: MAKE SURE YOU EDIT THE TEMPLATE FILE!!!!
-*/
-
-#ifndef FILTER_PTYPE
-#include <regions.h>
-#endif
-
-
-#ifndef UNUSED
-#ifdef __GNUC__
-# define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
-#else
-# define UNUSED(x) UNUSED_ ## x
-#endif
-#endif
-
-/* panda and pie incorrectly used astronomical angles. fixed 4/2004 */
-#define USE_ASTRO_ANGLE 0
-
-/* we might want to avoid (x86) extended precision problems */
-#define USE_FPU_DOUBLE 0
-#if USE_FPU_DOUBLE
-#include <fpu_control.h>
-static fpu_control_t _cw;
-#define FPU_DOUBLE {fpu_control_t _cw2; _FPU_GETCW(_cw); _cw2 = _cw & ~_FPU_EXTENDED; _cw2 |= _FPU_DOUBLE; _FPU_SETCW(_cw2);}
-#define FPU_RESTORE {_FPU_SETCW(_cw);}
-#else
-#define FPU_DOUBLE
-#define FPU_RESTORE
-#endif
-
-/* alternate method of avoiding (x86) extended precision problems */
-#define USE_FLOAT_COMPARE 0
-
-/* add this to FilterOpen to cause this module to be loaded for dynamic linking */
-static int evregno=0;
-void initevregions(void)
-{
- evregno++;
- return;
-}
-
-static int polypt(double x, double y, double* poly, int count,
- double UNUSED(xstart), double ystart, int flag)
-{
- /* x-- x value of point being tested */
- /* y-- y value of point being tested */
- /* poly-- bounding polygon, array of length (count*2) */
- /* count-- number of edges of bounding polygon */
-
- /* This algorithm is from "An Introduction to Ray Tracing", Academic Press, */
- /* 1989, edited by Andrew Glassner, pg 53 */
- /* a point lies in a polygon if a line is extended from the point to infinite */
- /* in any direction and the number of intersections with the polygon is odd. */
- /* This is valid for both concave and convex polygons. */
- /* Points on a vertex are considered inside. */
- /* Points on a edge are considered inside. */
-
- /* number of crossings */
- int crossings = 0;
-
- /* init sign for first vertice */
- int sign = ((poly[1] - y)>=0) ? 1 : -1;
-
- /* for all edges */
- int i;
-
- /* if flag is set, we check x, y against first point */
- if( flag && (x == poly[0]) && (y == poly[1]) ) return 1;
-
- for(i=0; i<count; i++) {
- int j = (i!=(count-1)) ? i+1 : 0;
-
- /* Vertex 1 */
- double x1 = poly[i*2] - x;
- double y1 = poly[i*2+1] - y;
-
- /* Vertex 2 */
- double x2 = poly[j*2] - x;
- double y2 = poly[j*2+1] - y;
-
- /* sign holder for p2 */
- int nextSign = (y2>=0) ? 1 : -1;
-
- /* horiz line */
- if( (y1==0) && (y2==0) ){
- if( ((x2>=0) && (x1<=0)) || ((x1>=0) && (x2<=0)) ){
- /* we always return true for ystart horiz lines */
- if( y == ystart )
- return 1;
- else
- return fmod((double)crossings+1,2.0) ? 1 : 0;
- }
- }
- /* vertical line */
- else if( (x1==0) && (x2==0) ){
- if( ((y2>=0) && (y1<=0)) || ((y1>=0) && (y2<=0)) ){
- return fmod((double)crossings+1,2.0) ? 1 : 0;
- }
- }
- /* point on line */
- else if( feq((y1*(x2-x1)),(x1*(y2-y1))) ){
- if( (((x2>=0) && (x1<=0)) || ((x1>=0) && (x2<=0))) &&
- (((y2>=0) && (y1<=0)) || ((y1>=0) && (y2<=0))) ){
- return fmod((double)crossings+1,2.0) ? 1 : 0;
- }
- }
-#if 0
- /* horiz line */
- if( (y1==0) && (y2==0) ){
- if( ((x2>=0) && (x1<=0)) || ((x1>=0) && (x2<=0)) ){
- if( y == ystart ){
- return 1;
- }
- }
- }
- /* vertical line */
- else if( (x1==0) && (x2==0) ){
- if( ((y2>=0) && (y1<=0)) || ((y1>=0) && (y2<=0)) ){
- if( x == xstart ){
- return 1;
- }
- }
- }
- /* point on line */
- else if( feq((y1*(x2-x1)),(x1*(y2-y1))) ){
- if( (((x2>=0) && (x1<=0)) || ((x1>=0) && (x2<=0))) &&
- (((y2>=0) && (y1<=0)) || ((y1>=0) && (y2<=0))) ){
- return 0;
- }
- }
-#endif
- if (sign != nextSign) {
- if (x1>0 && x2>0)
- crossings++;
- else if (x1>0 || x2>0) {
- if (x1-(y1*(x2-x1)/(y2-y1)) > 0)
- crossings++;
- }
- sign = nextSign;
- }
- }
-
- return crossings%2 ? 1 : 0; /* if odd, point is inside */
-}
-
-static void quadeq(double a, double b, double c,
- double *x1, double *x2, int *nr, int *nc)
-{
- double dis, q;
- if( feq(a,0.0) ){
- *nc = 0;
- if( feq(b,0.0) ){
- *nr = 0; *x1 = 0.0;
- }
- else{
- *nr = 1; *x1 = -c / b;
- }
- *x2 = *x1;
- }
- else{
- dis = b*b - 4.0 * a * c;
- if( dis > 0.0 ){
- *nr = 2; *nc = 0;
- dis = sqrt(dis);
- if( b < 0.0 ) dis = -dis;
- q = -0.5 * (b + dis);
- *x1 = q/a; *x2 = c/q;
- if(*x1 > *x2){
- q = *x1; *x1 = *x2; *x2 = q;
- }
- }
- else if( feq(dis,0.0) ){
- *nr = 1; *nc = 0; *x1 = - 0.5 * b / a; *x2 = *x1;
- }
- else{
- *nr = 0; *nc = 2; *x1 = - 0.5 * b / a; *x2 = 0.5 * sqrt(-dis) / a;
- }
- }
-}
-
-static int corner_vertex(int index, int width, int height,
- double *x, double *y)
-{
- switch (index) {
- case 1:
- *x = 0.0;
- *y = height + 1;
- break;
- case 2:
- *x = 0.0;
- *y = 0.0;
- break;
- case 3:
- *x = width + 1;
- *y = 0.0;
- break;
- case 4:
- *x = width + 1;
- *y = height + 1;
- default:
- break;
- }
- index = index + 1;
- if(index > 4) index = 1;
- return(index);
-}
-
-static int pie_intercept(double width, double height, double xcen, double ycen,
- double angle, double *xcept, double *ycept)
-{
- double angl, slope; /* l: angle and slope of ray */
- angl = angle;
- /* put angles in normal range */
- while (angl < 0.0)
- angl = angl + 360.0;
- while (angl >= 360.0)
- angl = angl - 360.0;
- /* check for a horizontal angle */
-#if USE_ASTRO_ANGLE
- if(fabs(angl - 90.0) < SMALL_NUMBER) {
-#else
- if(fabs(angl - 180.0) < SMALL_NUMBER) {
-#endif
- *xcept = 0.0;
- *ycept = ycen;
- return(2);
- }
-#if USE_ASTRO_ANGLE
- if(fabs(angl - 270.0) < SMALL_NUMBER) {
-#else
- if(fabs(angl - 0.0) < SMALL_NUMBER) {
-#endif
- *xcept = width + 1;
- *ycept = ycen;
- return(4);
- }
- /* convert to a Cartesian angle */
-#if USE_ASTRO_ANGLE
- angl = angl + 90.0;
-#endif
- if(angl >= 360.0)
- angl = angl - 360.0;
- if(angl < 180.0) {
- *ycept = height + 1;
- /* rule out vertical line */
- if(fabs(angl - 90.0) < SMALL_NUMBER) {
- *xcept = xcen;
- return(1);
- }
- } else {
- *ycept = 0.0;
- /* rule out vertical line */
- if(fabs(angl - 270.0) < SMALL_NUMBER) {
- *xcept = xcen;
- return(3);
- }
- }
- /* convert to radians */
- angl = (angl / 180.0) * M_PI;
- /* calculate slope */
- slope = tan(angl);
- /* calculate intercept with designated y edge */
- *xcept = xcen + ((*ycept - ycen) / slope);
- if(*xcept < 0) {
- *ycept = (ycen - (xcen * slope));
- *xcept = 0.0;
- return(2);
- } else if(*xcept > (width + 1)) {
- *ycept = (ycen + ((width + 1 - xcen) * slope));
- *xcept = width + 1;
- return(4);
- } else {
- if(*ycept < height)
- return(3);
- else
- return(1);
- }
-}
-
-/* ***************************** shapes ********************************** */
-
-int evannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double ri, double ro)
-{
- /* use circle if possible */
- if( ri == 0 ){
- return(evcircle(g, rno, sno, flag, type, x, y, xcen, ycen, ro));
- }
-
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
- g->shapes[sno].ystart = ycen - ro;
- g->shapes[sno].ystop = ycen + ro;
- g->shapes[sno].r1sq = ri * ri;
- g->shapes[sno].r2sq = ro * ro;
- }
-
- if((((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- (((xcen-x)*(xcen-x))+((ycen-y)*(ycen-y))<=g->shapes[sno].r2sq) &&
- (((xcen-x)*(xcen-x))+((ycen-y)*(ycen-y))>g->shapes[sno].r1sq)) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else{
- return 0;
- }
-}
-
-int evbox(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y,
- double xcen, double ycen, double xwidth, double yheight,
- double angle)
-{
- int i;
- double angl; /* l: Cartesian angle in radians */
- double half_width, half_height;/* l: radii (1/2 width and height) */
- double cosangl, sinangl; /* l: sine, cosine of the Cartesian angle */
- double hw_cos, hw_sin; /* l: products of half_width with sin, cos */
- double hh_cos, hh_sin; /* l: products of half_height with sin, cos */
- double xstart=0.0;
-
- if( (xwidth == 0) && (yheight==0) ){
- return(!flag);
- }
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
-#if USE_ASTRO_ANGLE
- /* convert to a Cartesian angle; save angle for use in multi or slices */
- angl = angle + 90.0;
-#else
- angl = angle;
-#endif
- while (angl >= 360.0) angl = angl - 360.0;
- /* convert to radians */
- angl = (angl / 180.0) * M_PI;
- sinangl = sin (angl);
- cosangl = cos (angl);
-#if USE_ASTRO_ANGLE
- /* since we rotate by 90.0 degrees to get from astro angle to cartesian, */
- /* we also need to switch the width and height. we do this secretly so */
- /* that the display will turn out right, by doing it in the half terms */
- half_width = yheight / 2.0;
- half_height = xwidth / 2.0;
-#else
- half_width = xwidth / 2.0;
- half_height = yheight / 2.0;
-#endif
- hw_cos = half_width * cosangl;
- hw_sin = half_width * sinangl;
- hh_cos = half_height * cosangl;
- hh_sin = half_height * sinangl;
- g->shapes[sno].pts = (double *)calloc(8, sizeof(double));
-#if USE_ASTRO_ANGLE
- g->shapes[sno].pts[0] = xcen - hw_cos - hh_sin;
- g->shapes[sno].pts[1] = ycen - hw_sin + hh_cos;
- g->shapes[sno].pts[2] = xcen + hw_cos - hh_sin;
- g->shapes[sno].pts[3] = ycen + hw_sin + hh_cos;
- g->shapes[sno].pts[4] = xcen + hw_cos + hh_sin;
- g->shapes[sno].pts[5] = ycen + hw_sin - hh_cos;
- g->shapes[sno].pts[6] = xcen - hw_cos + hh_sin;
- g->shapes[sno].pts[7] = ycen - hw_sin - hh_cos;
-#else
- g->shapes[sno].pts[0] = xcen - hw_cos + hh_sin;
- g->shapes[sno].pts[1] = ycen - hh_cos - hw_sin;
- g->shapes[sno].pts[2] = xcen - hw_cos - hh_sin;
- g->shapes[sno].pts[3] = ycen + hh_cos - hw_sin;
- g->shapes[sno].pts[4] = xcen + hw_cos - hh_sin;
- g->shapes[sno].pts[5] = ycen + hh_cos + hw_sin;
- g->shapes[sno].pts[6] = xcen + hw_cos + hh_sin;
- g->shapes[sno].pts[7] = ycen - hh_cos + hw_sin;
-#endif
- g->shapes[sno].npt = 8;
- /* now find the y limits */
- if( g->shapes[sno].npt ){
- xstart = g->shapes[sno].pts[0];
- g->shapes[sno].ystart = g->shapes[sno].pts[1];
- g->shapes[sno].ystop = g->shapes[sno].ystart;
- for(i=1; i<g->shapes[sno].npt; i+=2){
- if(g->shapes[sno].pts[i-1] < xstart)
- xstart = g->shapes[sno].pts[i-1];
- if(g->shapes[sno].pts[i] > g->shapes[sno].ystop)
- g->shapes[sno].ystop = g->shapes[sno].pts[i];
- if(g->shapes[sno].pts[i] < g->shapes[sno].ystart)
- g->shapes[sno].ystart = g->shapes[sno].pts[i];
- }
- }
- }
- if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- polypt(x, y, g->shapes[sno].pts, g->shapes[sno].npt/2,
- xstart, g->shapes[sno].ystart, 0)) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-int evcircle(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y,
- double xcen, double ycen, double radius)
-{
- if( radius == 0 ){
- return(!flag);
- }
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
- g->shapes[sno].ystart = ycen - radius;
- g->shapes[sno].ystop = ycen + radius;
- g->shapes[sno].r1sq = radius * radius;
- }
- if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- (((xcen-x)*(xcen-x))+((ycen-y)*(ycen-y))<=g->shapes[sno].r1sq)) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-int evellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double xrad, double yrad, double angle)
-{
- double yhi, yoff;
- double b, c;
- double b_partial, c_partial;
- double xboff, xfoff;
- int nr, nc;
-
- /* use circle if possible */
- if( xrad == yrad ){
- return(evcircle(g, rno, sno, flag, type, x, y, xcen, ycen, xrad));
- }
-
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
- /* set worst case limits (xrad axis parallel to vertical axis) */
-#if USE_ASTRO_ANGLE
- /* convert to a Cartesian angle; save "angle" for use by other routines */
- g->shapes[sno].angl = angle + 90.0;
-#else
- g->shapes[sno].angl = angle;
-#endif
- while( g->shapes[sno].angl >= 360.0 )
- g->shapes[sno].angl = g->shapes[sno].angl - 360.0;
- /* convert to radians */
- g->shapes[sno].angl = (g->shapes[sno].angl / 180.0) * M_PI;
- g->shapes[sno].sinangl = sin(g->shapes[sno].angl);
- g->shapes[sno].cosangl = cos(g->shapes[sno].angl);
- /* calculate approximate y limits */
- /* choose lesser of containing rotbox and circle */
-#if USE_ASTRO_ANGLE
- yhi = fabs(g->shapes[sno].sinangl * yrad) +
- fabs(g->shapes[sno].cosangl * xrad);
-#else
- yhi = fabs(g->shapes[sno].sinangl * xrad) +
- fabs(g->shapes[sno].cosangl * yrad);
-#endif
- yhi = min(yhi, max(yrad, xrad));
- g->shapes[sno].ystart = ycen - yhi;
- g->shapes[sno].ystop = ycen + yhi;
- /* prepare partials for quadratic equation solutions to coordinates */
- g->shapes[sno].cossq = g->shapes[sno].cosangl * g->shapes[sno].cosangl;
- g->shapes[sno].sinsq = g->shapes[sno].sinangl * g->shapes[sno].sinangl;
-#if USE_ASTRO_ANGLE
- /* because we rotate by 90.0 degrees to get from astro angle to */
- /* cartesian, we also need to switch the x and y axes. we do this */
- /* secretly so that the display will turn out right, by doing it in */
- /* the sq terms */
- g->shapes[sno].xradsq = yrad * yrad;
- g->shapes[sno].yradsq = xrad * xrad;
-#else
- g->shapes[sno].xradsq = xrad * xrad;
- g->shapes[sno].yradsq = yrad * yrad;
-#endif
- /* fill in as much of a,b,c as we can */
- g->shapes[sno].a = (g->shapes[sno].cossq / g->shapes[sno].xradsq) +
- (g->shapes[sno].sinsq / g->shapes[sno].yradsq);
- }
- if( ((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) ){
- b_partial = (2.0 * g->shapes[sno].sinangl) *
- ((g->shapes[sno].cosangl / g->shapes[sno].xradsq) -
- (g->shapes[sno].cosangl / g->shapes[sno].yradsq));
- c_partial = (g->shapes[sno].sinsq / g->shapes[sno].xradsq) +
- (g->shapes[sno].cossq / g->shapes[sno].yradsq);
- yoff = y - ycen;
- b = b_partial * yoff;
- c = (c_partial * yoff * yoff) - 1.0;
- /* solve quadratic */
- quadeq (g->shapes[sno].a, b, c, &xboff, &xfoff, &nr, &nc);
- /* if real roots */
- if( nr != 0 ) {
- FPU_DOUBLE
-#if USE_FLOAT_COMPARE
- if( (((float)x>=(float)(xcen+xboff)) &&
- ((float)x<=(float)(xcen+xfoff))) == flag ){
-#else
- if( ((x>=(xcen+xboff)) && (x<=(xcen+xfoff))) == flag ){
-#endif
- if( rno && flag ) g->rid = rno;
- FPU_RESTORE
- return 1;
- }
- else{
- FPU_RESTORE
- return 0;
- }
- }
- else
- return !flag;
- }
- return !flag;
-}
-
-int evfield(GFilt g, int rno, int UNUSED(sno), int flag, int UNUSED(type),
- double UNUSED(x), double UNUSED(y))
-{
- if( flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-int evline(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y,
- double x1, double y1, double x2, double y2)
-{
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
- g->shapes[sno].ystart = min(y1,y2);
- g->shapes[sno].ystop = max(y1,y2);
- g->shapes[sno].x1 = x1;
- g->shapes[sno].x2 = x2;
- g->shapes[sno].y1 = y1;
- if( feq(y1,y2) ){
- g->shapes[sno].xonly = 1;
- g->shapes[sno].invslope = 0;
- }
- else{
- g->shapes[sno].xonly = 0;
- g->shapes[sno].invslope = (x1 - x2) / (y1 - y2);
- }
- }
- if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- ((!g->shapes[sno].xonly &&
- feq((((y-g->shapes[sno].y1)*g->shapes[sno].invslope)+g->shapes[sno].x1),x)) ||
- (g->shapes[sno].xonly &&
- ((x>=g->shapes[sno].x1)&&(x<=g->shapes[sno].x2))))) == flag){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-int evpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2)
-{
- int i;
- int width, height; /* l: image mask width and height */
- double sweep; /* l: sweep between cut angles */
- int intrcpt1, intrcpt2; /* l: side intercepted by each cut */
- double x2, y2; /* l: coordinates of second intercept */
- double xstart=0.0;
-
- /* use field if possible */
- if( (angle1==0) && (angle2==360) ){
- return(evfield(g, rno, sno, flag, type, x, y));
- }
-
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
- /* we have to fake width and height, since we do not know them! */
- width = LARGE_NUMBER;
- height = LARGE_NUMBER;
- /* start listing vertices of polygon */
- g->shapes[sno].pts = (double *)calloc(14, sizeof(double));
- g->shapes[sno].pts[0] = xcen;
- g->shapes[sno].pts[1] = ycen;
- sweep = angle2 - angle1;
- /* if sweep is too small to be noticed, don't bother */
- if(fabs(sweep) < SMALL_NUMBER)
- return !flag;
- if (sweep < 0.0) sweep = sweep + 360.0;
- intrcpt1 = pie_intercept((double)width, (double)height, xcen, ycen, angle1,
- &(g->shapes[sno].pts[2]),
- &(g->shapes[sno].pts[3]));
- intrcpt2 = pie_intercept((double)width, (double)height, xcen, ycen, angle2,
- &x2, &y2);
- g->shapes[sno].npt = 4;
- /* if angles intercept same side and slice is between them, no corners */
- /* else, mark corners until reaching side with second angle intercept */
- if((intrcpt1 != intrcpt2) || (sweep > 180.0)){
- do{
- intrcpt1 = corner_vertex(intrcpt1, width, height,
- &(g->shapes[sno].pts[g->shapes[sno].npt]),
- &(g->shapes[sno].pts[g->shapes[sno].npt+1]));
- g->shapes[sno].npt = g->shapes[sno].npt + 2;
- }while(intrcpt1 != intrcpt2);
- }
- g->shapes[sno].pts[g->shapes[sno].npt] = x2;
- g->shapes[sno].pts[g->shapes[sno].npt+1] = y2;
- g->shapes[sno].npt = g->shapes[sno].npt + 2;
- /* now find the y limits */
- if( g->shapes[sno].npt ){
- xstart = g->shapes[sno].pts[0];
- g->shapes[sno].ystart = g->shapes[sno].pts[1];
- g->shapes[sno].ystop = g->shapes[sno].ystart;
- for(i=1; i<g->shapes[sno].npt; i+=2){
- if(g->shapes[sno].pts[i-1] < xstart)
- xstart = g->shapes[sno].pts[i-1];
- if(g->shapes[sno].pts[i] > g->shapes[sno].ystop)
- g->shapes[sno].ystop = g->shapes[sno].pts[i];
- if(g->shapes[sno].pts[i] < g->shapes[sno].ystart)
- g->shapes[sno].ystart = g->shapes[sno].pts[i];
- }
- }
- }
- if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- polypt(x, y, g->shapes[sno].pts, g->shapes[sno].npt/2,
- xstart, g->shapes[sno].ystart, 1)) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else{
- return 0;
- }
-}
-
-int evqtpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2)
-{
- return evpie(g, rno, sno, flag, type, x, y, xcen, ycen, angle1, angle2);
-}
-
-int evpoint(GFilt g, int rno, int UNUSED(sno), int flag, int UNUSED(type),
- double x, double y,
- double xcen, double ycen)
-{
- if( ((x==xcen) && (y==ycen)) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-#ifdef __STDC__
-int
-evpolygon(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y, ...)
-{
- int i, maxpts;
- double xstart=0.0;
- va_list args;
- va_start(args, y);
-#else
-int evpolygon(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xstart=0.0;
- int i, maxpts;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
-#endif
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
- /* allocate space for x,y arguments */
- maxpts = MASKINC;
- g->shapes[sno].pts = (double *)calloc(maxpts, sizeof(double));
- /* gather up arguments */
- g->shapes[sno].npt = 0;
- while( 1 ){
- if( g->shapes[sno].npt >= maxpts ){
- maxpts += MASKINC;
- g->shapes[sno].pts = (double *)realloc(g->shapes[sno].pts,
- maxpts*sizeof(double));
- }
- g->shapes[sno].pts[g->shapes[sno].npt] = va_arg(args, double);
- /* two negatives in a row means we are at end of args */
- if( feq(g->shapes[sno].pts[g->shapes[sno].npt],PSTOP) &&
- feq(g->shapes[sno].pts[g->shapes[sno].npt-1],PSTOP) ){
- g->shapes[sno].npt--;
- break;
- }
- g->shapes[sno].npt++;
- }
- va_end(args);
- /* realloc to actual size */
- g->shapes[sno].pts = (double *)realloc(g->shapes[sno].pts,
- g->shapes[sno].npt*sizeof(double));
- /* now find the y limits */
- if( g->shapes[sno].npt ){
- xstart = g->shapes[sno].pts[0];
- g->shapes[sno].ystart = g->shapes[sno].pts[1];
- g->shapes[sno].ystop = g->shapes[sno].ystart;
- for(i=1; i<g->shapes[sno].npt; i+=2){
- if(g->shapes[sno].pts[i-1] < xstart)
- xstart = g->shapes[sno].pts[i-1];
- if(g->shapes[sno].pts[i] > g->shapes[sno].ystop)
- g->shapes[sno].ystop = g->shapes[sno].pts[i];
- if(g->shapes[sno].pts[i] < g->shapes[sno].ystart)
- g->shapes[sno].ystart = g->shapes[sno].pts[i];
- }
- }
- }
- if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- polypt(x, y, g->shapes[sno].pts, g->shapes[sno].npt/2,
- xstart, g->shapes[sno].ystart, 0)) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-/* accelerator regions -- lower and upper limits are given for n regions */
-
-int evnannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lo, double hi, int n)
-{
- int i;
- int xsno;
- double dinc;
-
- /* get limits */
- dinc = (hi - lo)/(double)n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( evannulus(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc)) ){
- return(1);
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, lo, hi) ){
- return(1);
- }
- return(0);
- }
-}
-
-int evnbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double ang)
-{
- int i;
- int xsno;
- double dincx;
- double dincy;
-
- /* get limits */
- dincx = (hix - lox)/n;
- dincy = (hiy - loy)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evbox(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( evbox(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( evbox(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evbox(g, 0, xsno, 1, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- if( evbox(g, 0, xsno+1, 1, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-int evnellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double ang)
-{
- int i;
- int xsno;
- double dincx;
- double dincy;
-
- /* get limits */
- dincx = (hix - lox)/n;
- dincy = (hiy - loy)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( evellipse(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( evellipse(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- if( evellipse(g, 0, xsno+1, 1, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-int evnpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lo, double hi, int n)
-{
- int i;
- int xsno;
- double dinc;
-
- /* get limits */
- while( lo > hi ) lo -= 360.0;
- dinc = (hi - lo)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* check limits */
- if( !evpie(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( evpie(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc)) ){
- return(1);
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evpie(g, 0, xsno, 1, type, x, y, xcen, ycen, lo, hi) ){
- return(1);
- }
- return(0);
- }
-}
-
-int evpanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double radlo, double radhi, double radn)
-{
-
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, rinc;
-
- /* get limits */
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- rinc = (radhi - radlo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, radlo, radhi) ||
- !evpie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(a=1; a<=ahi; a++){
- for(r=1; r<=rhi; r++){
- if( evannulus(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, radlo+((r-1)*rinc), radlo+(r*rinc)) &&
- evpie(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+((a-1)*ainc), anglo+(a*ainc)) ){
- return(1);
- }
- n++;
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, radlo, radhi) )
- return(1);
- else if( !evpie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){
- return(1);
- }
- else{
- return(0);
- }
- }
-}
-
-int evbpanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double xlo, double ylo, double xhi, double yhi, double radn,
- double ang)
-{
-
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, xinc, yinc;
-
- /* get limits */
- anglo += ang;
- anghi += ang;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- xinc = (xhi - xlo)/radn;
- yinc = (yhi - ylo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evbox(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi,
- ang) ){
- return(0);
- }
- /* but if its in the inner region we lose */
- else if( evbox(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo,
- ang) ){
- return(0);
- }
- /* its in the box .. must also be in the pie */
- else if( !evpie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi)){
- return(0);
- }
- /* look through all of them to find the right one */
- for(a=0; a<ahi; a++){
- for(r=1; r<=rhi; r++){
- if( evbox(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang) &&
- evqtpie(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc)) ){
- return(1);
- }
- n++;
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evbox(g, 0, xsno, 1, type, x, y, xcen, ycen, xhi, yhi, ang) )
- return(1);
- /* if its in the inner region we win */
- else if( !evbox(g, 0, xsno+2, 1, type, x, y, xcen, ycen, xlo, ylo,
- ang) )
- return(1);
- /* if its not in the pie, we win */
- else if( !evpie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){
- return(1);
- }
- else{
- return(0);
- }
- }
-}
-
-int evepanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double xlo, double ylo, double xhi, double yhi, double radn,
- double ang)
-{
-
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, xinc, yinc;
-
- /* get limits */
- anglo += ang;
- anghi += ang;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- xinc = (xhi - xlo)/radn;
- yinc = (yhi - ylo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi,
- ang) ){
- return(0);
- }
- /* but if its in the inner region we lose */
- else if( evellipse(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo,
- ang) ){
- return(0);
- }
- /* its in the ellipse .. must also be in the pie */
- else if( !evpie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi)){
- return(0);
- }
- /* look through all of them to find the right one */
- for(a=0; a<ahi; a++){
- for(r=1; r<=rhi; r++){
- if( evellipse(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang) &&
- evqtpie(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc)) ){
- return(1);
- }
- n++;
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, xhi, yhi, ang) )
- return(1);
- /* if its in the inner region we win */
- else if( !evellipse(g, 0, xsno+2, 1, type, x, y, xcen, ycen, xlo, ylo,
- ang) )
- return(1);
- /* if its not in the pie, we win */
- else if( !evpie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){
- return(1);
- }
- else{
- return(0);
- }
- }
-}
-
-/* varargs regions -- a series of lower and upper limits is specified */
-
-#ifdef __STDC__
-int
-evvannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int evvannulus(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double *xv;
- int i, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* this should be impossible ... */
- if( n == 2 ){
- return(evannulus(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1]));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( evannulus(g, rno+i, sno+i, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1]) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(1);
- }
- return(0);
- }
-}
-
-#ifdef __STDC__
-int
-evvbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double ang;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int evvbox(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- ang = xv[--n];
- /* this should be impossible ... */
- if( n == 2 ){
- return(evbox(g, rno, sno, flag, type, x, y,
- xcen, ycen, xv[0], xv[1], ang));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evbox(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1],
- ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( evbox(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=2, j=0; i<n; i+=2, j++){
- if( evbox(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1], ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evbox(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[n-2], xv[n-1], ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- else if( evbox(g, 0, xsno+1, 1, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-
-#ifdef __STDC__
-int
-evvellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double ang;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int evvellipse(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- ang = xv[--n];
- /* this should be impossible ... */
- if( n == 2 ){
- return(evellipse(g, rno, sno, flag, type, x, y,
- xcen, ycen, xv[0], xv[1], ang));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1],
- ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( evellipse(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1],
- ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=2, j=0; i<n; i+=2, j++){
- if( evellipse(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1], ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we lose ... */
- if( !evellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[n-2], xv[n-1],
- ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- if( evellipse(g, 0, xsno+1, 1, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-#ifdef __STDC__
-int
-evvpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int evvpie(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double *xv;
- int i, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* this should be impossible ... */
- if( n == 2 ){
- return(evpie(g, rno, sno, flag, type, x, y,
- xcen, ycen, xv[0], xv[1]));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evpie(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( evpie(g, rno+i, sno+i, flag, type, x, y, xcen, ycen, xv[i], xv[i+1]) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we lose ... */
- if( !evpie(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(1);
- }
- return(1);
- }
-}
-
-#ifdef __STDC__
-int
-evvpoint(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, y);
-#else
-int evvpoint(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* look through all of them to find the right one */
- for(i=0, j=0; i<n; i+=2, j++){
- if( evpoint(g, rno+j, sno+j, flag, type, x, y, xv[i], xv[i+1]) ){
- return(1);
- }
- }
- return(0);
-}
-
-
diff --git a/funtools/filter/evregions_c.h b/funtools/filter/evregions_c.h
deleted file mode 100644
index 1ecd201..0000000
--- a/funtools/filter/evregions_c.h
+++ /dev/null
@@ -1 +0,0 @@
-static char *EVREGIONS_C="\n/*\n NB: MAKE SURE YOU EDIT THE TEMPLATE FILE!!!!\n*/\n\n#ifndef FILTER_PTYPE\n#include <regions.h>\n#endif\n\n\n#ifndef UNUSED\n#ifdef __GNUC__\n# define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))\n#else\n# define UNUSED(x) UNUSED_ ## x\n#endif\n#endif\n\n\n#define USE_ASTRO_ANGLE 0\n\n\n#define USE_FPU_DOUBLE 0\n#if USE_FPU_DOUBLE\n#include <fpu_control.h>\nstatic fpu_control_t _cw;\n#define FPU_DOUBLE {fpu_control_t _cw2; _FPU_GETCW(_cw); _cw2 = _cw & ~_FPU_EXTENDED; _cw2 |= _FPU_DOUBLE; _FPU_SETCW(_cw2);}\n#define FPU_RESTORE {_FPU_SETCW(_cw);}\n#else\n#define FPU_DOUBLE\n#define FPU_RESTORE\n#endif\n\n\n#define USE_FLOAT_COMPARE 0\n\n\nstatic int evregno=0;\nvoid initevregions(void)\n{\n evregno++;\n return;\n}\n\nstatic int polypt(double x, double y, double* poly, int count,\n double UNUSED(xstart), double ystart, int flag)\n{\n \n \n \n \n\n \n \n \n \n \n \n \n\n \n int crossings = 0;\n\n \n int sign = ((poly[1] - y)>=0) ? 1 : -1;\n\n \n int i;\n\n \n if( flag && (x == poly[0]) && (y == poly[1]) ) return 1;\n\n for(i=0; i<count; i++) {\n int j = (i!=(count-1)) ? i+1 : 0;\n\n \n double x1 = poly[i*2] - x;\n double y1 = poly[i*2+1] - y;\n\n \n double x2 = poly[j*2] - x;\n double y2 = poly[j*2+1] - y;\n\n \n int nextSign = (y2>=0) ? 1 : -1;\n\n \n if( (y1==0) && (y2==0) ){\n if( ((x2>=0) && (x1<=0)) || ((x1>=0) && (x2<=0)) ){\n \n if( y == ystart )\n return 1;\n else\n return fmod((double)crossings+1,2.0) ? 1 : 0;\n }\n }\n \n else if( (x1==0) && (x2==0) ){\n if( ((y2>=0) && (y1<=0)) || ((y1>=0) && (y2<=0)) ){\n return fmod((double)crossings+1,2.0) ? 1 : 0;\n }\n }\n \n else if( feq((y1*(x2-x1)),(x1*(y2-y1))) ){\n if( (((x2>=0) && (x1<=0)) || ((x1>=0) && (x2<=0))) &&\n (((y2>=0) && (y1<=0)) || ((y1>=0) && (y2<=0))) ){\n return fmod((double)crossings+1,2.0) ? 1 : 0;\n }\n }\n#if 0\n \n if( (y1==0) && (y2==0) ){\n if( ((x2>=0) && (x1<=0)) || ((x1>=0) && (x2<=0)) ){\n if( y == ystart ){\n return 1;\n }\n }\n }\n \n else if( (x1==0) && (x2==0) ){\n if( ((y2>=0) && (y1<=0)) || ((y1>=0) && (y2<=0)) ){\n if( x == xstart ){\n return 1;\n }\n }\n }\n \n else if( feq((y1*(x2-x1)),(x1*(y2-y1))) ){\n if( (((x2>=0) && (x1<=0)) || ((x1>=0) && (x2<=0))) &&\n (((y2>=0) && (y1<=0)) || ((y1>=0) && (y2<=0))) ){\n return 0;\n }\n }\n#endif\n if (sign != nextSign) {\n if (x1>0 && x2>0)\n crossings++;\n else if (x1>0 || x2>0) {\n if (x1-(y1*(x2-x1)/(y2-y1)) > 0)\n crossings++;\n }\n sign = nextSign;\n }\n }\n\n return crossings%2 ? 1 : 0; \n}\n\nstatic void quadeq(double a, double b, double c,\n double *x1, double *x2, int *nr, int *nc)\n{\n double dis, q;\n if( feq(a,0.0) ){\n *nc = 0;\n if( feq(b,0.0) ){\n *nr = 0; *x1 = 0.0;\n }\n else{\n *nr = 1; *x1 = -c / b;\n }\n *x2 = *x1;\n }\n else{\n dis = b*b - 4.0 * a * c;\n if( dis > 0.0 ){\n *nr = 2; *nc = 0;\n dis = sqrt(dis);\n if( b < 0.0 ) dis = -dis;\n q = -0.5 * (b + dis);\n *x1 = q/a; *x2 = c/q;\n if(*x1 > *x2){\n q = *x1; *x1 = *x2; *x2 = q;\n }\n } \n else if( feq(dis,0.0) ){\n *nr = 1; *nc = 0; *x1 = - 0.5 * b / a; *x2 = *x1;\n }\n else{\n *nr = 0; *nc = 2; *x1 = - 0.5 * b / a; *x2 = 0.5 * sqrt(-dis) / a;\n }\n }\n}\n\nstatic int corner_vertex(int index, int width, int height,\n double *x, double *y)\n{\n switch (index) {\n case 1:\n *x = 0.0;\n *y = height + 1;\n break;\n case 2:\n *x = 0.0;\n *y = 0.0;\n break;\n case 3:\n *x = width + 1;\n *y = 0.0;\n break;\n case 4:\n *x = width + 1;\n *y = height + 1;\n default:\n break;\n }\n index = index + 1;\n if(index > 4) index = 1;\n return(index);\n}\n\nstatic int pie_intercept(double width, double height, double xcen, double ycen,\n double angle, double *xcept, double *ycept)\n{\n double angl, slope; \n angl = angle;\n \n while (angl < 0.0)\n angl = angl + 360.0;\n while (angl >= 360.0)\n angl = angl - 360.0;\n \n#if USE_ASTRO_ANGLE\n if(fabs(angl - 90.0) < SMALL_NUMBER) {\n#else\n if(fabs(angl - 180.0) < SMALL_NUMBER) {\n#endif\n *xcept = 0.0;\n *ycept = ycen;\n return(2);\n }\n#if USE_ASTRO_ANGLE\n if(fabs(angl - 270.0) < SMALL_NUMBER) {\n#else\n if(fabs(angl - 0.0) < SMALL_NUMBER) {\n#endif\n *xcept = width + 1;\n *ycept = ycen;\n return(4);\n }\n \n#if USE_ASTRO_ANGLE\n angl = angl + 90.0;\n#endif\n if(angl >= 360.0)\n angl = angl - 360.0;\n if(angl < 180.0) {\n *ycept = height + 1;\n \n if(fabs(angl - 90.0) < SMALL_NUMBER) {\n *xcept = xcen;\n return(1);\n }\n } else {\n *ycept = 0.0;\n \n if(fabs(angl - 270.0) < SMALL_NUMBER) {\n *xcept = xcen;\n return(3);\n }\n }\n \n angl = (angl / 180.0) * M_PI;\n \n slope = tan(angl);\n \n *xcept = xcen + ((*ycept - ycen) / slope);\n if(*xcept < 0) {\n *ycept = (ycen - (xcen * slope));\n *xcept = 0.0;\n return(2);\n } else if(*xcept > (width + 1)) {\n *ycept = (ycen + ((width + 1 - xcen) * slope));\n *xcept = width + 1;\n return(4);\n } else {\n if(*ycept < height)\n return(3);\n else\n return(1);\n }\n}\n\n\n\nint evannulus(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double ri, double ro)\n{\n \n if( ri == 0 ){\n return(evcircle(g, rno, sno, flag, type, x, y, xcen, ycen, ro));\n }\n\n if( !g->shapes[sno].init ){\n g->shapes[sno].init = 1;\n g->shapes[sno].ystart = ycen - ro;\n g->shapes[sno].ystop = ycen + ro;\n g->shapes[sno].r1sq = ri * ri;\n g->shapes[sno].r2sq = ro * ro;\n }\n\n if((((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&\n (((xcen-x)*(xcen-x))+((ycen-y)*(ycen-y))<=g->shapes[sno].r2sq) &&\n (((xcen-x)*(xcen-x))+((ycen-y)*(ycen-y))>g->shapes[sno].r1sq)) == flag ){\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else{\n return 0;\n }\n}\n\nint evbox(GFilt g, int rno, int sno, int flag, int UNUSED(type),\n double x, double y,\n double xcen, double ycen, double xwidth, double yheight,\n double angle)\n{\n int i;\n double angl; \n double half_width, half_height;\n double cosangl, sinangl; \n double hw_cos, hw_sin; \n double hh_cos, hh_sin; \n double xstart=0.0;\n\n if( (xwidth == 0) && (yheight==0) ){\n return(!flag);\n }\n if( !g->shapes[sno].init ){\n g->shapes[sno].init = 1;\n#if USE_ASTRO_ANGLE\n \n angl = angle + 90.0;\n#else\n angl = angle;\n#endif\n while (angl >= 360.0) angl = angl - 360.0;\n \n angl = (angl / 180.0) * M_PI;\n sinangl = sin (angl);\n cosangl = cos (angl);\n#if USE_ASTRO_ANGLE\n \n \n \n half_width = yheight / 2.0;\n half_height = xwidth / 2.0;\n#else\n half_width = xwidth / 2.0;\n half_height = yheight / 2.0;\n#endif\n hw_cos = half_width * cosangl;\n hw_sin = half_width * sinangl;\n hh_cos = half_height * cosangl;\n hh_sin = half_height * sinangl;\n g->shapes[sno].pts = (double *)calloc(8, sizeof(double));\n#if USE_ASTRO_ANGLE\n g->shapes[sno].pts[0] = xcen - hw_cos - hh_sin;\n g->shapes[sno].pts[1] = ycen - hw_sin + hh_cos;\n g->shapes[sno].pts[2] = xcen + hw_cos - hh_sin;\n g->shapes[sno].pts[3] = ycen + hw_sin + hh_cos;\n g->shapes[sno].pts[4] = xcen + hw_cos + hh_sin;\n g->shapes[sno].pts[5] = ycen + hw_sin - hh_cos;\n g->shapes[sno].pts[6] = xcen - hw_cos + hh_sin;\n g->shapes[sno].pts[7] = ycen - hw_sin - hh_cos;\n#else\n g->shapes[sno].pts[0] = xcen - hw_cos + hh_sin;\n g->shapes[sno].pts[1] = ycen - hh_cos - hw_sin;\n g->shapes[sno].pts[2] = xcen - hw_cos - hh_sin;\n g->shapes[sno].pts[3] = ycen + hh_cos - hw_sin;\n g->shapes[sno].pts[4] = xcen + hw_cos - hh_sin;\n g->shapes[sno].pts[5] = ycen + hh_cos + hw_sin;\n g->shapes[sno].pts[6] = xcen + hw_cos + hh_sin;\n g->shapes[sno].pts[7] = ycen - hh_cos + hw_sin;\n#endif\n g->shapes[sno].npt = 8;\n \n if( g->shapes[sno].npt ){\n xstart = g->shapes[sno].pts[0];\n g->shapes[sno].ystart = g->shapes[sno].pts[1];\n g->shapes[sno].ystop = g->shapes[sno].ystart;\n for(i=1; i<g->shapes[sno].npt; i+=2){\n if(g->shapes[sno].pts[i-1] < xstart)\n xstart = g->shapes[sno].pts[i-1];\n if(g->shapes[sno].pts[i] > g->shapes[sno].ystop)\n g->shapes[sno].ystop = g->shapes[sno].pts[i];\n if(g->shapes[sno].pts[i] < g->shapes[sno].ystart)\n g->shapes[sno].ystart = g->shapes[sno].pts[i];\n }\n }\n }\n if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&\n polypt(x, y, g->shapes[sno].pts, g->shapes[sno].npt/2,\n xstart, g->shapes[sno].ystart, 0)) == flag ){\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else\n return 0;\n}\n\nint evcircle(GFilt g, int rno, int sno, int flag, int UNUSED(type),\n double x, double y,\n double xcen, double ycen, double radius)\n{\n if( radius == 0 ){\n return(!flag);\n }\n if( !g->shapes[sno].init ){\n g->shapes[sno].init = 1;\n g->shapes[sno].ystart = ycen - radius;\n g->shapes[sno].ystop = ycen + radius;\n g->shapes[sno].r1sq = radius * radius;\n }\n if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&\n (((xcen-x)*(xcen-x))+((ycen-y)*(ycen-y))<=g->shapes[sno].r1sq)) == flag ){\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else\n return 0;\n}\n\nint evellipse(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double xrad, double yrad, double angle)\n{\n double yhi, yoff;\n double b, c;\n double b_partial, c_partial;\n double xboff, xfoff;\n int nr, nc;\n\n \n if( xrad == yrad ){\n return(evcircle(g, rno, sno, flag, type, x, y, xcen, ycen, xrad));\n }\n\n if( !g->shapes[sno].init ){\n g->shapes[sno].init = 1;\n \n#if USE_ASTRO_ANGLE\n \n g->shapes[sno].angl = angle + 90.0;\n#else\n g->shapes[sno].angl = angle;\n#endif\n while( g->shapes[sno].angl >= 360.0 )\n g->shapes[sno].angl = g->shapes[sno].angl - 360.0;\n \n g->shapes[sno].angl = (g->shapes[sno].angl / 180.0) * M_PI;\n g->shapes[sno].sinangl = sin(g->shapes[sno].angl);\n g->shapes[sno].cosangl = cos(g->shapes[sno].angl);\n \n \n#if USE_ASTRO_ANGLE\n yhi = fabs(g->shapes[sno].sinangl * yrad) + \n fabs(g->shapes[sno].cosangl * xrad);\n#else\n yhi = fabs(g->shapes[sno].sinangl * xrad) + \n fabs(g->shapes[sno].cosangl * yrad);\n#endif\n yhi = min(yhi, max(yrad, xrad));\n g->shapes[sno].ystart = ycen - yhi;\n g->shapes[sno].ystop = ycen + yhi;\n \n g->shapes[sno].cossq = g->shapes[sno].cosangl * g->shapes[sno].cosangl;\n g->shapes[sno].sinsq = g->shapes[sno].sinangl * g->shapes[sno].sinangl;\n#if USE_ASTRO_ANGLE\n \n \n \n \n g->shapes[sno].xradsq = yrad * yrad;\n g->shapes[sno].yradsq = xrad * xrad;\n#else\n g->shapes[sno].xradsq = xrad * xrad;\n g->shapes[sno].yradsq = yrad * yrad;\n#endif\n \n g->shapes[sno].a = (g->shapes[sno].cossq / g->shapes[sno].xradsq) + \n (g->shapes[sno].sinsq / g->shapes[sno].yradsq);\n }\n if( ((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) ){\n b_partial = (2.0 * g->shapes[sno].sinangl) * \n ((g->shapes[sno].cosangl / g->shapes[sno].xradsq) - \n (g->shapes[sno].cosangl / g->shapes[sno].yradsq));\n c_partial = (g->shapes[sno].sinsq / g->shapes[sno].xradsq) + \n (g->shapes[sno].cossq / g->shapes[sno].yradsq);\n yoff = y - ycen;\n b = b_partial * yoff;\n c = (c_partial * yoff * yoff) - 1.0;\n \n quadeq (g->shapes[sno].a, b, c, &xboff, &xfoff, &nr, &nc);\n \n if( nr != 0 ) {\n FPU_DOUBLE\n#if USE_FLOAT_COMPARE\n if( (((float)x>=(float)(xcen+xboff)) && \n ((float)x<=(float)(xcen+xfoff))) == flag ){\n#else\n if( ((x>=(xcen+xboff)) && (x<=(xcen+xfoff))) == flag ){\n#endif\n if( rno && flag ) g->rid = rno;\n FPU_RESTORE\n return 1;\n }\n else{\n FPU_RESTORE\n return 0;\n }\n }\n else\n return !flag;\n }\n return !flag;\n}\n\nint evfield(GFilt g, int rno, int UNUSED(sno), int flag, int UNUSED(type),\n double UNUSED(x), double UNUSED(y))\n{\n if( flag ){\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else\n return 0;\n}\n\nint evline(GFilt g, int rno, int sno, int flag, int UNUSED(type),\n double x, double y,\n double x1, double y1, double x2, double y2)\n{\n if( !g->shapes[sno].init ){\n g->shapes[sno].init = 1;\n g->shapes[sno].ystart = min(y1,y2);\n g->shapes[sno].ystop = max(y1,y2);\n g->shapes[sno].x1 = x1;\n g->shapes[sno].x2 = x2;\n g->shapes[sno].y1 = y1;\n if( feq(y1,y2) ){\n g->shapes[sno].xonly = 1;\n g->shapes[sno].invslope = 0;\n }\n else{\n g->shapes[sno].xonly = 0;\n g->shapes[sno].invslope = (x1 - x2) / (y1 - y2);\n }\n }\n if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&\n ((!g->shapes[sno].xonly &&\n feq((((y-g->shapes[sno].y1)*g->shapes[sno].invslope)+g->shapes[sno].x1),x)) ||\n (g->shapes[sno].xonly &&\n ((x>=g->shapes[sno].x1)&&(x<=g->shapes[sno].x2))))) == flag){\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else\n return 0;\n}\n\nint evpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double angle1, double angle2)\n{\n int i;\n int width, height; \n double sweep; \n int intrcpt1, intrcpt2; \n double x2, y2; \n double xstart=0.0;\n\n \n if( (angle1==0) && (angle2==360) ){\n return(evfield(g, rno, sno, flag, type, x, y));\n }\n\n if( !g->shapes[sno].init ){\n g->shapes[sno].init = 1;\n \n width = LARGE_NUMBER;\n height = LARGE_NUMBER;\n \n g->shapes[sno].pts = (double *)calloc(14, sizeof(double));\n g->shapes[sno].pts[0] = xcen;\n g->shapes[sno].pts[1] = ycen;\n sweep = angle2 - angle1;\n \n if(fabs(sweep) < SMALL_NUMBER)\n return !flag;\n if (sweep < 0.0) sweep = sweep + 360.0;\n intrcpt1 = pie_intercept((double)width, (double)height, xcen, ycen, angle1,\n &(g->shapes[sno].pts[2]),\n &(g->shapes[sno].pts[3]));\n intrcpt2 = pie_intercept((double)width, (double)height, xcen, ycen, angle2,\n &x2, &y2);\n g->shapes[sno].npt = 4;\n \n \n if((intrcpt1 != intrcpt2) || (sweep > 180.0)){\n do{\n intrcpt1 = corner_vertex(intrcpt1, width, height, \n &(g->shapes[sno].pts[g->shapes[sno].npt]),\n &(g->shapes[sno].pts[g->shapes[sno].npt+1]));\n g->shapes[sno].npt = g->shapes[sno].npt + 2;\n }while(intrcpt1 != intrcpt2);\n }\n g->shapes[sno].pts[g->shapes[sno].npt] = x2;\n g->shapes[sno].pts[g->shapes[sno].npt+1] = y2;\n g->shapes[sno].npt = g->shapes[sno].npt + 2;\n \n if( g->shapes[sno].npt ){\n xstart = g->shapes[sno].pts[0];\n g->shapes[sno].ystart = g->shapes[sno].pts[1];\n g->shapes[sno].ystop = g->shapes[sno].ystart;\n for(i=1; i<g->shapes[sno].npt; i+=2){\n if(g->shapes[sno].pts[i-1] < xstart)\n xstart = g->shapes[sno].pts[i-1];\n if(g->shapes[sno].pts[i] > g->shapes[sno].ystop)\n g->shapes[sno].ystop = g->shapes[sno].pts[i];\n if(g->shapes[sno].pts[i] < g->shapes[sno].ystart)\n g->shapes[sno].ystart = g->shapes[sno].pts[i];\n }\n }\n }\n if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&\n polypt(x, y, g->shapes[sno].pts, g->shapes[sno].npt/2,\n xstart, g->shapes[sno].ystart, 1)) == flag ){\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else{\n return 0;\n }\n}\n\nint evqtpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double angle1, double angle2)\n{\n return evpie(g, rno, sno, flag, type, x, y, xcen, ycen, angle1, angle2);\n}\n\nint evpoint(GFilt g, int rno, int UNUSED(sno), int flag, int UNUSED(type),\n double x, double y,\n double xcen, double ycen)\n{\n if( ((x==xcen) && (y==ycen)) == flag ){\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else\n return 0;\n}\n\n#ifdef __STDC__\nint\nevpolygon(GFilt g, int rno, int sno, int flag, int UNUSED(type),\n double x, double y, ...)\n{\n int i, maxpts;\n double xstart=0.0;\n va_list args;\n va_start(args, y);\n#else\nint evpolygon(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double xstart=0.0;\n int i, maxpts;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n#endif\n if( !g->shapes[sno].init ){\n g->shapes[sno].init = 1;\n \n maxpts = MASKINC;\n g->shapes[sno].pts = (double *)calloc(maxpts, sizeof(double));\n \n g->shapes[sno].npt = 0;\n while( 1 ){\n if( g->shapes[sno].npt >= maxpts ){\n maxpts += MASKINC;\n g->shapes[sno].pts = (double *)realloc(g->shapes[sno].pts,\n maxpts*sizeof(double));\n }\n g->shapes[sno].pts[g->shapes[sno].npt] = va_arg(args, double);\n \n if( feq(g->shapes[sno].pts[g->shapes[sno].npt],PSTOP) &&\n feq(g->shapes[sno].pts[g->shapes[sno].npt-1],PSTOP) ){\n g->shapes[sno].npt--;\n break;\n }\n g->shapes[sno].npt++;\n }\n va_end(args);\n \n g->shapes[sno].pts = (double *)realloc(g->shapes[sno].pts,\n g->shapes[sno].npt*sizeof(double));\n \n if( g->shapes[sno].npt ){\n xstart = g->shapes[sno].pts[0];\n g->shapes[sno].ystart = g->shapes[sno].pts[1];\n g->shapes[sno].ystop = g->shapes[sno].ystart;\n for(i=1; i<g->shapes[sno].npt; i+=2){\n if(g->shapes[sno].pts[i-1] < xstart)\n xstart = g->shapes[sno].pts[i-1];\n if(g->shapes[sno].pts[i] > g->shapes[sno].ystop)\n g->shapes[sno].ystop = g->shapes[sno].pts[i];\n if(g->shapes[sno].pts[i] < g->shapes[sno].ystart)\n g->shapes[sno].ystart = g->shapes[sno].pts[i];\n }\n }\n }\n if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&\n polypt(x, y, g->shapes[sno].pts, g->shapes[sno].npt/2,\n xstart, g->shapes[sno].ystart, 0)) == flag ){\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else\n return 0;\n}\n\n\n\nint evnannulus(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen,\n double lo, double hi, int n)\n{\n int i;\n int xsno;\n double dinc;\n\n \n dinc = (hi - lo)/(double)n;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !evannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi) ){\n return(0);\n }\n \n for(i=0; i<n; i++){\n if( evannulus(g, rno+i, sno+i, flag, type, x, y,\n xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc)) ){\n return(1);\n }\n }\n return(0);\n }\n else{\n \n if( !evannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, lo, hi) ){\n return(1);\n }\n return(0);\n }\n}\n\nint evnbox(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen,\n double lox, double loy, double hix, double hiy, int n,\n double ang)\n{\n int i;\n int xsno;\n double dincx;\n double dincy;\n\n \n dincx = (hix - lox)/n;\n dincy = (hiy - loy)/n;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !evbox(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang) ){\n return(0);\n }\n \n if( evbox(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang) ){\n return(0);\n }\n \n for(i=0; i<n; i++){\n if( evbox(g, rno+i, sno+i, flag, type, x, y,\n xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang) ){\n return(1);\n }\n }\n return(0);\n }\n \n else{\n \n if( !evbox(g, 0, xsno, 1, type, x, y, xcen, ycen, hix, hiy, ang) ){\n return(1);\n }\n \n if( evbox(g, 0, xsno+1, 1, type, x, y, xcen, ycen, lox, loy, ang) ){\n return(1);\n }\n return(0);\n }\n}\n\nint evnellipse(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen,\n double lox, double loy, double hix, double hiy, int n,\n double ang)\n{\n int i;\n int xsno;\n double dincx;\n double dincy;\n\n \n dincx = (hix - lox)/n;\n dincy = (hiy - loy)/n;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !evellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang) ){\n return(0);\n }\n \n if( evellipse(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang) ){\n return(0);\n }\n \n for(i=0; i<n; i++){\n if( evellipse(g, rno+i, sno+i, flag, type, x, y,\n xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang) ){\n return(1);\n }\n }\n return(0);\n }\n \n else{\n \n if( !evellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, hix, hiy, ang) ){\n return(1);\n }\n \n if( evellipse(g, 0, xsno+1, 1, type, x, y, xcen, ycen, lox, loy, ang) ){\n return(1);\n }\n return(0);\n }\n}\n\nint evnpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen,\n double lo, double hi, int n)\n{\n int i;\n int xsno;\n double dinc;\n\n \n while( lo > hi ) lo -= 360.0;\n dinc = (hi - lo)/n;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !evpie(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi) ){\n return(0);\n }\n \n for(i=0; i<n; i++){\n if( evpie(g, rno+i, sno+i, flag, type, x, y,\n xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc)) ){\n return(1);\n }\n }\n return(0);\n }\n else{\n \n if( !evpie(g, 0, xsno, 1, type, x, y, xcen, ycen, lo, hi) ){\n return(1);\n }\n return(0);\n }\n}\n\nint evpanda(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double anglo, double anghi, double angn,\n double radlo, double radhi, double radn)\n{\n \n int a, r;\n int ahi, rhi;\n int xsno;\n int n=0;\n double ainc, rinc;\n\n \n ainc = (anghi - anglo)/angn;\n ahi = (int)angn;\n rinc = (radhi - radlo)/radn;\n rhi = (int)radn;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !evannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, radlo, radhi) ||\n !evpie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi) ){\n return(0);\n }\n \n for(a=1; a<=ahi; a++){\n for(r=1; r<=rhi; r++){\n if( evannulus(g, rno+n, sno+(2*n), flag, type, x, y,\n xcen, ycen, radlo+((r-1)*rinc), radlo+(r*rinc)) &&\n evpie(g, rno+n, sno+(2*n+1), flag, type, x, y,\n xcen, ycen, anglo+((a-1)*ainc), anglo+(a*ainc)) ){\n return(1);\n }\n n++;\n }\n }\n return(0);\n }\n else{\n \n if( !evannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, radlo, radhi) )\n return(1);\n else if( !evpie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){\n return(1);\n }\n else{\n return(0);\n }\n }\n}\n\nint evbpanda(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double anglo, double anghi, double angn,\n double xlo, double ylo, double xhi, double yhi, double radn,\n double ang)\n{\n \n int a, r;\n int ahi, rhi;\n int xsno;\n int n=0;\n double ainc, xinc, yinc;\n\n \n anglo += ang;\n anghi += ang;\n ainc = (anghi - anglo)/angn;\n ahi = (int)angn;\n xinc = (xhi - xlo)/radn;\n yinc = (yhi - ylo)/radn;\n rhi = (int)radn;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !evbox(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi,\n ang) ){\n return(0);\n }\n \n else if( evbox(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo,\n ang) ){\n return(0);\n }\n \n else if( !evpie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi)){\n return(0);\n }\n \n for(a=0; a<ahi; a++){\n for(r=1; r<=rhi; r++){\n if( evbox(g, rno+n, sno+(2*n), flag, type, x, y,\n xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang) &&\n evqtpie(g, rno+n, sno+(2*n+1), flag, type, x, y,\n xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc)) ){\n return(1);\n }\n n++;\n }\n }\n return(0);\n }\n else{\n \n if( !evbox(g, 0, xsno, 1, type, x, y, xcen, ycen, xhi, yhi, ang) )\n return(1);\n \n else if( !evbox(g, 0, xsno+2, 1, type, x, y, xcen, ycen, xlo, ylo,\n ang) )\n return(1);\n \n else if( !evpie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){\n return(1);\n }\n else{\n return(0);\n }\n }\n}\n\nint evepanda(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double anglo, double anghi, double angn,\n double xlo, double ylo, double xhi, double yhi, double radn,\n double ang)\n{\n \n int a, r;\n int ahi, rhi;\n int xsno;\n int n=0;\n double ainc, xinc, yinc;\n\n \n anglo += ang;\n anghi += ang;\n ainc = (anghi - anglo)/angn;\n ahi = (int)angn;\n xinc = (xhi - xlo)/radn;\n yinc = (yhi - ylo)/radn;\n rhi = (int)radn;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !evellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi,\n ang) ){\n return(0);\n }\n \n else if( evellipse(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo,\n ang) ){\n return(0);\n }\n \n else if( !evpie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi)){\n return(0);\n }\n \n for(a=0; a<ahi; a++){\n for(r=1; r<=rhi; r++){\n if( evellipse(g, rno+n, sno+(2*n), flag, type, x, y,\n xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang) &&\n evqtpie(g, rno+n, sno+(2*n+1), flag, type, x, y,\n xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc)) ){\n return(1);\n }\n n++;\n }\n }\n return(0);\n }\n else{\n \n if( !evellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, xhi, yhi, ang) )\n return(1);\n \n else if( !evellipse(g, 0, xsno+2, 1, type, x, y, xcen, ycen, xlo, ylo,\n ang) )\n return(1);\n \n else if( !evpie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){\n return(1);\n }\n else{\n return(0);\n }\n }\n}\n\n\n\n#ifdef __STDC__\nint\nevvannulus(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...)\n{\n int i, n;\n int maxpts;\n int xsno;\n double *xv;\n va_list args;\n va_start(args, ycen);\n#else\nint evvannulus(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double xcen, ycen;\n double *xv;\n int i, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n xcen = va_arg(args, double);\n ycen = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n \n if( n == 2 ){\n return(evannulus(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1]));\n }\n if( flag ){\n \n if( !evannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){\n return(0);\n }\n \n for(i=0; i<n; i++){\n if( evannulus(g, rno+i, sno+i, flag, type, x, y, xcen, ycen,\n xv[i], xv[i+1]) ){\n return(1);\n }\n }\n return(0);\n }\n \n else{\n \n if( !evannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){\n return(1);\n }\n return(0);\n }\n}\n\n#ifdef __STDC__\nint\nevvbox(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...)\n{\n int i, j, n;\n int maxpts;\n int xsno;\n double ang;\n double *xv;\n va_list args;\n va_start(args, ycen);\n#else\nint evvbox(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double xcen, ycen;\n double ang;\n double *xv;\n int i, j, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n xcen = va_arg(args, double);\n ycen = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n ang = xv[--n];\n \n if( n == 2 ){\n return(evbox(g, rno, sno, flag, type, x, y,\n xcen, ycen, xv[0], xv[1], ang));\n }\n if( flag ){\n \n if( !evbox(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1],\n ang) ){\n return(0);\n }\n \n if( evbox(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){\n return(0);\n }\n \n for(i=2, j=0; i<n; i+=2, j++){\n if( evbox(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,\n xv[i], xv[i+1], ang) ){\n return(1);\n }\n }\n return(0);\n }\n \n else{\n \n if( !evbox(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[n-2], xv[n-1], ang) ){\n return(1);\n }\n \n else if( evbox(g, 0, xsno+1, 1, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){\n return(1);\n }\n return(0);\n }\n}\n\n\n#ifdef __STDC__\nint\nevvellipse(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...)\n{\n int i, j, n;\n int maxpts;\n int xsno;\n double ang;\n double *xv;\n va_list args;\n va_start(args, ycen);\n#else\nint evvellipse(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double xcen, ycen;\n double ang;\n double *xv;\n int i, j, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n xcen = va_arg(args, double);\n ycen = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n ang = xv[--n];\n \n if( n == 2 ){\n return(evellipse(g, rno, sno, flag, type, x, y,\n xcen, ycen, xv[0], xv[1], ang));\n }\n if( flag ){\n \n if( !evellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1],\n ang) ){\n return(0);\n }\n \n if( evellipse(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1],\n ang) ){\n return(0);\n }\n \n for(i=2, j=0; i<n; i+=2, j++){\n if( evellipse(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,\n xv[i], xv[i+1], ang) ){\n return(1);\n }\n }\n return(0);\n }\n \n else{\n \n if( !evellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[n-2], xv[n-1],\n ang) ){\n return(1);\n }\n \n if( evellipse(g, 0, xsno+1, 1, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){\n return(1);\n }\n return(0);\n }\n}\n\n#ifdef __STDC__\nint\nevvpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...)\n{\n int i, n;\n int maxpts;\n int xsno;\n double *xv;\n va_list args;\n va_start(args, ycen);\n#else\nint evvpie(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double xcen, ycen;\n double *xv;\n int i, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n xcen = va_arg(args, double);\n ycen = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n \n if( n == 2 ){\n return(evpie(g, rno, sno, flag, type, x, y,\n xcen, ycen, xv[0], xv[1]));\n }\n if( flag ){\n \n if( !evpie(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){\n return(0);\n }\n \n for(i=0; i<n; i++){\n if( evpie(g, rno+i, sno+i, flag, type, x, y, xcen, ycen, xv[i], xv[i+1]) ){\n return(1);\n }\n }\n return(0);\n }\n \n else{\n \n if( !evpie(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){\n return(1);\n }\n return(1);\n }\n}\n\n#ifdef __STDC__\nint\nevvpoint(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, ...)\n{\n int i, j, n;\n int maxpts;\n int xsno;\n double *xv;\n va_list args;\n va_start(args, y);\n#else\nint evvpoint(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double *xv;\n int i, j, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n \n for(i=0, j=0; i<n; i+=2, j++){\n if( evpoint(g, rno+j, sno+j, flag, type, x, y, xv[i], xv[i+1]) ){\n return(1);\n }\n }\n return(0);\n}\n\n\n";
diff --git a/funtools/filter/evregions_c.tmpl b/funtools/filter/evregions_c.tmpl
deleted file mode 100644
index 9fe330e..0000000
--- a/funtools/filter/evregions_c.tmpl
+++ /dev/null
@@ -1,1532 +0,0 @@
-/*
- NB: MAKE SURE YOU EDIT THE TEMPLATE FILE!!!!
-*/
-
-#ifndef FILTER_PTYPE
-#include <regions.h>
-#endif
-
-
-#ifndef UNUSED
-#ifdef __GNUC__
-# define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
-#else
-# define UNUSED(x) UNUSED_ ## x
-#endif
-#endif
-
-/* panda and pie incorrectly used astronomical angles. fixed 4/2004 */
-#define USE_ASTRO_ANGLE 0
-
-/* we might want to avoid (x86) extended precision problems */
-#define USE_FPU_DOUBLE _FPUDBL_
-#if USE_FPU_DOUBLE
-#include <fpu_control.h>
-static fpu_control_t _cw;
-#define FPU_DOUBLE {fpu_control_t _cw2; _FPU_GETCW(_cw); _cw2 = _cw & ~_FPU_EXTENDED; _cw2 |= _FPU_DOUBLE; _FPU_SETCW(_cw2);}
-#define FPU_RESTORE {_FPU_SETCW(_cw);}
-#else
-#define FPU_DOUBLE
-#define FPU_RESTORE
-#endif
-
-/* alternate method of avoiding (x86) extended precision problems */
-#define USE_FLOAT_COMPARE 0
-
-/* add this to FilterOpen to cause this module to be loaded for dynamic linking */
-static int evregno=0;
-void initevregions(void)
-{
- evregno++;
- return;
-}
-
-static int polypt(double x, double y, double* poly, int count,
- double UNUSED(xstart), double ystart, int flag)
-{
- /* x-- x value of point being tested */
- /* y-- y value of point being tested */
- /* poly-- bounding polygon, array of length (count*2) */
- /* count-- number of edges of bounding polygon */
-
- /* This algorithm is from "An Introduction to Ray Tracing", Academic Press, */
- /* 1989, edited by Andrew Glassner, pg 53 */
- /* a point lies in a polygon if a line is extended from the point to infinite */
- /* in any direction and the number of intersections with the polygon is odd. */
- /* This is valid for both concave and convex polygons. */
- /* Points on a vertex are considered inside. */
- /* Points on a edge are considered inside. */
-
- /* number of crossings */
- int crossings = 0;
-
- /* init sign for first vertice */
- int sign = ((poly[1] - y)>=0) ? 1 : -1;
-
- /* for all edges */
- int i;
-
- /* if flag is set, we check x, y against first point */
- if( flag && (x == poly[0]) && (y == poly[1]) ) return 1;
-
- for(i=0; i<count; i++) {
- int j = (i!=(count-1)) ? i+1 : 0;
-
- /* Vertex 1 */
- double x1 = poly[i*2] - x;
- double y1 = poly[i*2+1] - y;
-
- /* Vertex 2 */
- double x2 = poly[j*2] - x;
- double y2 = poly[j*2+1] - y;
-
- /* sign holder for p2 */
- int nextSign = (y2>=0) ? 1 : -1;
-
- /* horiz line */
- if( (y1==0) && (y2==0) ){
- if( ((x2>=0) && (x1<=0)) || ((x1>=0) && (x2<=0)) ){
- /* we always return true for ystart horiz lines */
- if( y == ystart )
- return 1;
- else
- return fmod((double)crossings+1,2.0) ? 1 : 0;
- }
- }
- /* vertical line */
- else if( (x1==0) && (x2==0) ){
- if( ((y2>=0) && (y1<=0)) || ((y1>=0) && (y2<=0)) ){
- return fmod((double)crossings+1,2.0) ? 1 : 0;
- }
- }
- /* point on line */
- else if( feq((y1*(x2-x1)),(x1*(y2-y1))) ){
- if( (((x2>=0) && (x1<=0)) || ((x1>=0) && (x2<=0))) &&
- (((y2>=0) && (y1<=0)) || ((y1>=0) && (y2<=0))) ){
- return fmod((double)crossings+1,2.0) ? 1 : 0;
- }
- }
-#if 0
- /* horiz line */
- if( (y1==0) && (y2==0) ){
- if( ((x2>=0) && (x1<=0)) || ((x1>=0) && (x2<=0)) ){
- if( y == ystart ){
- return 1;
- }
- }
- }
- /* vertical line */
- else if( (x1==0) && (x2==0) ){
- if( ((y2>=0) && (y1<=0)) || ((y1>=0) && (y2<=0)) ){
- if( x == xstart ){
- return 1;
- }
- }
- }
- /* point on line */
- else if( feq((y1*(x2-x1)),(x1*(y2-y1))) ){
- if( (((x2>=0) && (x1<=0)) || ((x1>=0) && (x2<=0))) &&
- (((y2>=0) && (y1<=0)) || ((y1>=0) && (y2<=0))) ){
- return 0;
- }
- }
-#endif
- if (sign != nextSign) {
- if (x1>0 && x2>0)
- crossings++;
- else if (x1>0 || x2>0) {
- if (x1-(y1*(x2-x1)/(y2-y1)) > 0)
- crossings++;
- }
- sign = nextSign;
- }
- }
-
- return crossings%2 ? 1 : 0; /* if odd, point is inside */
-}
-
-static void quadeq(double a, double b, double c,
- double *x1, double *x2, int *nr, int *nc)
-{
- double dis, q;
- if( feq(a,0.0) ){
- *nc = 0;
- if( feq(b,0.0) ){
- *nr = 0; *x1 = 0.0;
- }
- else{
- *nr = 1; *x1 = -c / b;
- }
- *x2 = *x1;
- }
- else{
- dis = b*b - 4.0 * a * c;
- if( dis > 0.0 ){
- *nr = 2; *nc = 0;
- dis = sqrt(dis);
- if( b < 0.0 ) dis = -dis;
- q = -0.5 * (b + dis);
- *x1 = q/a; *x2 = c/q;
- if(*x1 > *x2){
- q = *x1; *x1 = *x2; *x2 = q;
- }
- }
- else if( feq(dis,0.0) ){
- *nr = 1; *nc = 0; *x1 = - 0.5 * b / a; *x2 = *x1;
- }
- else{
- *nr = 0; *nc = 2; *x1 = - 0.5 * b / a; *x2 = 0.5 * sqrt(-dis) / a;
- }
- }
-}
-
-static int corner_vertex(int index, int width, int height,
- double *x, double *y)
-{
- switch (index) {
- case 1:
- *x = 0.0;
- *y = height + 1;
- break;
- case 2:
- *x = 0.0;
- *y = 0.0;
- break;
- case 3:
- *x = width + 1;
- *y = 0.0;
- break;
- case 4:
- *x = width + 1;
- *y = height + 1;
- default:
- break;
- }
- index = index + 1;
- if(index > 4) index = 1;
- return(index);
-}
-
-static int pie_intercept(double width, double height, double xcen, double ycen,
- double angle, double *xcept, double *ycept)
-{
- double angl, slope; /* l: angle and slope of ray */
- angl = angle;
- /* put angles in normal range */
- while (angl < 0.0)
- angl = angl + 360.0;
- while (angl >= 360.0)
- angl = angl - 360.0;
- /* check for a horizontal angle */
-#if USE_ASTRO_ANGLE
- if(fabs(angl - 90.0) < SMALL_NUMBER) {
-#else
- if(fabs(angl - 180.0) < SMALL_NUMBER) {
-#endif
- *xcept = 0.0;
- *ycept = ycen;
- return(2);
- }
-#if USE_ASTRO_ANGLE
- if(fabs(angl - 270.0) < SMALL_NUMBER) {
-#else
- if(fabs(angl - 0.0) < SMALL_NUMBER) {
-#endif
- *xcept = width + 1;
- *ycept = ycen;
- return(4);
- }
- /* convert to a Cartesian angle */
-#if USE_ASTRO_ANGLE
- angl = angl + 90.0;
-#endif
- if(angl >= 360.0)
- angl = angl - 360.0;
- if(angl < 180.0) {
- *ycept = height + 1;
- /* rule out vertical line */
- if(fabs(angl - 90.0) < SMALL_NUMBER) {
- *xcept = xcen;
- return(1);
- }
- } else {
- *ycept = 0.0;
- /* rule out vertical line */
- if(fabs(angl - 270.0) < SMALL_NUMBER) {
- *xcept = xcen;
- return(3);
- }
- }
- /* convert to radians */
- angl = (angl / 180.0) * M_PI;
- /* calculate slope */
- slope = tan(angl);
- /* calculate intercept with designated y edge */
- *xcept = xcen + ((*ycept - ycen) / slope);
- if(*xcept < 0) {
- *ycept = (ycen - (xcen * slope));
- *xcept = 0.0;
- return(2);
- } else if(*xcept > (width + 1)) {
- *ycept = (ycen + ((width + 1 - xcen) * slope));
- *xcept = width + 1;
- return(4);
- } else {
- if(*ycept < height)
- return(3);
- else
- return(1);
- }
-}
-
-/* ***************************** shapes ********************************** */
-
-int evannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double ri, double ro)
-{
- /* use circle if possible */
- if( ri == 0 ){
- return(evcircle(g, rno, sno, flag, type, x, y, xcen, ycen, ro));
- }
-
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
- g->shapes[sno].ystart = ycen - ro;
- g->shapes[sno].ystop = ycen + ro;
- g->shapes[sno].r1sq = ri * ri;
- g->shapes[sno].r2sq = ro * ro;
- }
-
- if((((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- (((xcen-x)*(xcen-x))+((ycen-y)*(ycen-y))<=g->shapes[sno].r2sq) &&
- (((xcen-x)*(xcen-x))+((ycen-y)*(ycen-y))>g->shapes[sno].r1sq)) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else{
- return 0;
- }
-}
-
-int evbox(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y,
- double xcen, double ycen, double xwidth, double yheight,
- double angle)
-{
- int i;
- double angl; /* l: Cartesian angle in radians */
- double half_width, half_height;/* l: radii (1/2 width and height) */
- double cosangl, sinangl; /* l: sine, cosine of the Cartesian angle */
- double hw_cos, hw_sin; /* l: products of half_width with sin, cos */
- double hh_cos, hh_sin; /* l: products of half_height with sin, cos */
- double xstart=0.0;
-
- if( (xwidth == 0) && (yheight==0) ){
- return(!flag);
- }
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
-#if USE_ASTRO_ANGLE
- /* convert to a Cartesian angle; save angle for use in multi or slices */
- angl = angle + 90.0;
-#else
- angl = angle;
-#endif
- while (angl >= 360.0) angl = angl - 360.0;
- /* convert to radians */
- angl = (angl / 180.0) * M_PI;
- sinangl = sin (angl);
- cosangl = cos (angl);
-#if USE_ASTRO_ANGLE
- /* since we rotate by 90.0 degrees to get from astro angle to cartesian, */
- /* we also need to switch the width and height. we do this secretly so */
- /* that the display will turn out right, by doing it in the half terms */
- half_width = yheight / 2.0;
- half_height = xwidth / 2.0;
-#else
- half_width = xwidth / 2.0;
- half_height = yheight / 2.0;
-#endif
- hw_cos = half_width * cosangl;
- hw_sin = half_width * sinangl;
- hh_cos = half_height * cosangl;
- hh_sin = half_height * sinangl;
- g->shapes[sno].pts = (double *)calloc(8, sizeof(double));
-#if USE_ASTRO_ANGLE
- g->shapes[sno].pts[0] = xcen - hw_cos - hh_sin;
- g->shapes[sno].pts[1] = ycen - hw_sin + hh_cos;
- g->shapes[sno].pts[2] = xcen + hw_cos - hh_sin;
- g->shapes[sno].pts[3] = ycen + hw_sin + hh_cos;
- g->shapes[sno].pts[4] = xcen + hw_cos + hh_sin;
- g->shapes[sno].pts[5] = ycen + hw_sin - hh_cos;
- g->shapes[sno].pts[6] = xcen - hw_cos + hh_sin;
- g->shapes[sno].pts[7] = ycen - hw_sin - hh_cos;
-#else
- g->shapes[sno].pts[0] = xcen - hw_cos + hh_sin;
- g->shapes[sno].pts[1] = ycen - hh_cos - hw_sin;
- g->shapes[sno].pts[2] = xcen - hw_cos - hh_sin;
- g->shapes[sno].pts[3] = ycen + hh_cos - hw_sin;
- g->shapes[sno].pts[4] = xcen + hw_cos - hh_sin;
- g->shapes[sno].pts[5] = ycen + hh_cos + hw_sin;
- g->shapes[sno].pts[6] = xcen + hw_cos + hh_sin;
- g->shapes[sno].pts[7] = ycen - hh_cos + hw_sin;
-#endif
- g->shapes[sno].npt = 8;
- /* now find the y limits */
- if( g->shapes[sno].npt ){
- xstart = g->shapes[sno].pts[0];
- g->shapes[sno].ystart = g->shapes[sno].pts[1];
- g->shapes[sno].ystop = g->shapes[sno].ystart;
- for(i=1; i<g->shapes[sno].npt; i+=2){
- if(g->shapes[sno].pts[i-1] < xstart)
- xstart = g->shapes[sno].pts[i-1];
- if(g->shapes[sno].pts[i] > g->shapes[sno].ystop)
- g->shapes[sno].ystop = g->shapes[sno].pts[i];
- if(g->shapes[sno].pts[i] < g->shapes[sno].ystart)
- g->shapes[sno].ystart = g->shapes[sno].pts[i];
- }
- }
- }
- if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- polypt(x, y, g->shapes[sno].pts, g->shapes[sno].npt/2,
- xstart, g->shapes[sno].ystart, 0)) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-int evcircle(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y,
- double xcen, double ycen, double radius)
-{
- if( radius == 0 ){
- return(!flag);
- }
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
- g->shapes[sno].ystart = ycen - radius;
- g->shapes[sno].ystop = ycen + radius;
- g->shapes[sno].r1sq = radius * radius;
- }
- if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- (((xcen-x)*(xcen-x))+((ycen-y)*(ycen-y))<=g->shapes[sno].r1sq)) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-int evellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double xrad, double yrad, double angle)
-{
- double yhi, yoff;
- double b, c;
- double b_partial, c_partial;
- double xboff, xfoff;
- int nr, nc;
-
- /* use circle if possible */
- if( xrad == yrad ){
- return(evcircle(g, rno, sno, flag, type, x, y, xcen, ycen, xrad));
- }
-
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
- /* set worst case limits (xrad axis parallel to vertical axis) */
-#if USE_ASTRO_ANGLE
- /* convert to a Cartesian angle; save "angle" for use by other routines */
- g->shapes[sno].angl = angle + 90.0;
-#else
- g->shapes[sno].angl = angle;
-#endif
- while( g->shapes[sno].angl >= 360.0 )
- g->shapes[sno].angl = g->shapes[sno].angl - 360.0;
- /* convert to radians */
- g->shapes[sno].angl = (g->shapes[sno].angl / 180.0) * M_PI;
- g->shapes[sno].sinangl = sin(g->shapes[sno].angl);
- g->shapes[sno].cosangl = cos(g->shapes[sno].angl);
- /* calculate approximate y limits */
- /* choose lesser of containing rotbox and circle */
-#if USE_ASTRO_ANGLE
- yhi = fabs(g->shapes[sno].sinangl * yrad) +
- fabs(g->shapes[sno].cosangl * xrad);
-#else
- yhi = fabs(g->shapes[sno].sinangl * xrad) +
- fabs(g->shapes[sno].cosangl * yrad);
-#endif
- yhi = min(yhi, max(yrad, xrad));
- g->shapes[sno].ystart = ycen - yhi;
- g->shapes[sno].ystop = ycen + yhi;
- /* prepare partials for quadratic equation solutions to coordinates */
- g->shapes[sno].cossq = g->shapes[sno].cosangl * g->shapes[sno].cosangl;
- g->shapes[sno].sinsq = g->shapes[sno].sinangl * g->shapes[sno].sinangl;
-#if USE_ASTRO_ANGLE
- /* because we rotate by 90.0 degrees to get from astro angle to */
- /* cartesian, we also need to switch the x and y axes. we do this */
- /* secretly so that the display will turn out right, by doing it in */
- /* the sq terms */
- g->shapes[sno].xradsq = yrad * yrad;
- g->shapes[sno].yradsq = xrad * xrad;
-#else
- g->shapes[sno].xradsq = xrad * xrad;
- g->shapes[sno].yradsq = yrad * yrad;
-#endif
- /* fill in as much of a,b,c as we can */
- g->shapes[sno].a = (g->shapes[sno].cossq / g->shapes[sno].xradsq) +
- (g->shapes[sno].sinsq / g->shapes[sno].yradsq);
- }
- if( ((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) ){
- b_partial = (2.0 * g->shapes[sno].sinangl) *
- ((g->shapes[sno].cosangl / g->shapes[sno].xradsq) -
- (g->shapes[sno].cosangl / g->shapes[sno].yradsq));
- c_partial = (g->shapes[sno].sinsq / g->shapes[sno].xradsq) +
- (g->shapes[sno].cossq / g->shapes[sno].yradsq);
- yoff = y - ycen;
- b = b_partial * yoff;
- c = (c_partial * yoff * yoff) - 1.0;
- /* solve quadratic */
- quadeq (g->shapes[sno].a, b, c, &xboff, &xfoff, &nr, &nc);
- /* if real roots */
- if( nr != 0 ) {
- FPU_DOUBLE
-#if USE_FLOAT_COMPARE
- if( (((float)x>=(float)(xcen+xboff)) &&
- ((float)x<=(float)(xcen+xfoff))) == flag ){
-#else
- if( ((x>=(xcen+xboff)) && (x<=(xcen+xfoff))) == flag ){
-#endif
- if( rno && flag ) g->rid = rno;
- FPU_RESTORE
- return 1;
- }
- else{
- FPU_RESTORE
- return 0;
- }
- }
- else
- return !flag;
- }
- return !flag;
-}
-
-int evfield(GFilt g, int rno, int UNUSED(sno), int flag, int UNUSED(type),
- double UNUSED(x), double UNUSED(y))
-{
- if( flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-int evline(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y,
- double x1, double y1, double x2, double y2)
-{
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
- g->shapes[sno].ystart = min(y1,y2);
- g->shapes[sno].ystop = max(y1,y2);
- g->shapes[sno].x1 = x1;
- g->shapes[sno].x2 = x2;
- g->shapes[sno].y1 = y1;
- if( feq(y1,y2) ){
- g->shapes[sno].xonly = 1;
- g->shapes[sno].invslope = 0;
- }
- else{
- g->shapes[sno].xonly = 0;
- g->shapes[sno].invslope = (x1 - x2) / (y1 - y2);
- }
- }
- if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- ((!g->shapes[sno].xonly &&
- feq((((y-g->shapes[sno].y1)*g->shapes[sno].invslope)+g->shapes[sno].x1),x)) ||
- (g->shapes[sno].xonly &&
- ((x>=g->shapes[sno].x1)&&(x<=g->shapes[sno].x2))))) == flag){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-int evpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2)
-{
- int i;
- int width, height; /* l: image mask width and height */
- double sweep; /* l: sweep between cut angles */
- int intrcpt1, intrcpt2; /* l: side intercepted by each cut */
- double x2, y2; /* l: coordinates of second intercept */
- double xstart=0.0;
-
- /* use field if possible */
- if( (angle1==0) && (angle2==360) ){
- return(evfield(g, rno, sno, flag, type, x, y));
- }
-
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
- /* we have to fake width and height, since we do not know them! */
- width = LARGE_NUMBER;
- height = LARGE_NUMBER;
- /* start listing vertices of polygon */
- g->shapes[sno].pts = (double *)calloc(14, sizeof(double));
- g->shapes[sno].pts[0] = xcen;
- g->shapes[sno].pts[1] = ycen;
- sweep = angle2 - angle1;
- /* if sweep is too small to be noticed, don't bother */
- if(fabs(sweep) < SMALL_NUMBER)
- return !flag;
- if (sweep < 0.0) sweep = sweep + 360.0;
- intrcpt1 = pie_intercept((double)width, (double)height, xcen, ycen, angle1,
- &(g->shapes[sno].pts[2]),
- &(g->shapes[sno].pts[3]));
- intrcpt2 = pie_intercept((double)width, (double)height, xcen, ycen, angle2,
- &x2, &y2);
- g->shapes[sno].npt = 4;
- /* if angles intercept same side and slice is between them, no corners */
- /* else, mark corners until reaching side with second angle intercept */
- if((intrcpt1 != intrcpt2) || (sweep > 180.0)){
- do{
- intrcpt1 = corner_vertex(intrcpt1, width, height,
- &(g->shapes[sno].pts[g->shapes[sno].npt]),
- &(g->shapes[sno].pts[g->shapes[sno].npt+1]));
- g->shapes[sno].npt = g->shapes[sno].npt + 2;
- }while(intrcpt1 != intrcpt2);
- }
- g->shapes[sno].pts[g->shapes[sno].npt] = x2;
- g->shapes[sno].pts[g->shapes[sno].npt+1] = y2;
- g->shapes[sno].npt = g->shapes[sno].npt + 2;
- /* now find the y limits */
- if( g->shapes[sno].npt ){
- xstart = g->shapes[sno].pts[0];
- g->shapes[sno].ystart = g->shapes[sno].pts[1];
- g->shapes[sno].ystop = g->shapes[sno].ystart;
- for(i=1; i<g->shapes[sno].npt; i+=2){
- if(g->shapes[sno].pts[i-1] < xstart)
- xstart = g->shapes[sno].pts[i-1];
- if(g->shapes[sno].pts[i] > g->shapes[sno].ystop)
- g->shapes[sno].ystop = g->shapes[sno].pts[i];
- if(g->shapes[sno].pts[i] < g->shapes[sno].ystart)
- g->shapes[sno].ystart = g->shapes[sno].pts[i];
- }
- }
- }
- if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- polypt(x, y, g->shapes[sno].pts, g->shapes[sno].npt/2,
- xstart, g->shapes[sno].ystart, 1)) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else{
- return 0;
- }
-}
-
-int evqtpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2)
-{
- return evpie(g, rno, sno, flag, type, x, y, xcen, ycen, angle1, angle2);
-}
-
-int evpoint(GFilt g, int rno, int UNUSED(sno), int flag, int UNUSED(type),
- double x, double y,
- double xcen, double ycen)
-{
- if( ((x==xcen) && (y==ycen)) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-#ifdef __STDC__
-int
-evpolygon(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y, ...)
-{
- int i, maxpts;
- double xstart=0.0;
- va_list args;
- va_start(args, y);
-#else
-int evpolygon(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xstart=0.0;
- int i, maxpts;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
-#endif
- if( !g->shapes[sno].init ){
- g->shapes[sno].init = 1;
- /* allocate space for x,y arguments */
- maxpts = MASKINC;
- g->shapes[sno].pts = (double *)calloc(maxpts, sizeof(double));
- /* gather up arguments */
- g->shapes[sno].npt = 0;
- while( 1 ){
- if( g->shapes[sno].npt >= maxpts ){
- maxpts += MASKINC;
- g->shapes[sno].pts = (double *)realloc(g->shapes[sno].pts,
- maxpts*sizeof(double));
- }
- g->shapes[sno].pts[g->shapes[sno].npt] = va_arg(args, double);
- /* two negatives in a row means we are at end of args */
- if( feq(g->shapes[sno].pts[g->shapes[sno].npt],PSTOP) &&
- feq(g->shapes[sno].pts[g->shapes[sno].npt-1],PSTOP) ){
- g->shapes[sno].npt--;
- break;
- }
- g->shapes[sno].npt++;
- }
- va_end(args);
- /* realloc to actual size */
- g->shapes[sno].pts = (double *)realloc(g->shapes[sno].pts,
- g->shapes[sno].npt*sizeof(double));
- /* now find the y limits */
- if( g->shapes[sno].npt ){
- xstart = g->shapes[sno].pts[0];
- g->shapes[sno].ystart = g->shapes[sno].pts[1];
- g->shapes[sno].ystop = g->shapes[sno].ystart;
- for(i=1; i<g->shapes[sno].npt; i+=2){
- if(g->shapes[sno].pts[i-1] < xstart)
- xstart = g->shapes[sno].pts[i-1];
- if(g->shapes[sno].pts[i] > g->shapes[sno].ystop)
- g->shapes[sno].ystop = g->shapes[sno].pts[i];
- if(g->shapes[sno].pts[i] < g->shapes[sno].ystart)
- g->shapes[sno].ystart = g->shapes[sno].pts[i];
- }
- }
- }
- if( (((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- polypt(x, y, g->shapes[sno].pts, g->shapes[sno].npt/2,
- xstart, g->shapes[sno].ystart, 0)) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-/* accelerator regions -- lower and upper limits are given for n regions */
-
-int evnannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lo, double hi, int n)
-{
- int i;
- int xsno;
- double dinc;
-
- /* get limits */
- dinc = (hi - lo)/(double)n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( evannulus(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc)) ){
- return(1);
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, lo, hi) ){
- return(1);
- }
- return(0);
- }
-}
-
-int evnbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double ang)
-{
- int i;
- int xsno;
- double dincx;
- double dincy;
-
- /* get limits */
- dincx = (hix - lox)/n;
- dincy = (hiy - loy)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evbox(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( evbox(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( evbox(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evbox(g, 0, xsno, 1, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- if( evbox(g, 0, xsno+1, 1, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-int evnellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double ang)
-{
- int i;
- int xsno;
- double dincx;
- double dincy;
-
- /* get limits */
- dincx = (hix - lox)/n;
- dincy = (hiy - loy)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( evellipse(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( evellipse(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- if( evellipse(g, 0, xsno+1, 1, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-int evnpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lo, double hi, int n)
-{
- int i;
- int xsno;
- double dinc;
-
- /* get limits */
- while( lo > hi ) lo -= 360.0;
- dinc = (hi - lo)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* check limits */
- if( !evpie(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( evpie(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc)) ){
- return(1);
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evpie(g, 0, xsno, 1, type, x, y, xcen, ycen, lo, hi) ){
- return(1);
- }
- return(0);
- }
-}
-
-int evpanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double radlo, double radhi, double radn)
-{
-
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, rinc;
-
- /* get limits */
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- rinc = (radhi - radlo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, radlo, radhi) ||
- !evpie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(a=1; a<=ahi; a++){
- for(r=1; r<=rhi; r++){
- if( evannulus(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, radlo+((r-1)*rinc), radlo+(r*rinc)) &&
- evpie(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+((a-1)*ainc), anglo+(a*ainc)) ){
- return(1);
- }
- n++;
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, radlo, radhi) )
- return(1);
- else if( !evpie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){
- return(1);
- }
- else{
- return(0);
- }
- }
-}
-
-int evbpanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double xlo, double ylo, double xhi, double yhi, double radn,
- double ang)
-{
-
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, xinc, yinc;
-
- /* get limits */
- anglo += ang;
- anghi += ang;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- xinc = (xhi - xlo)/radn;
- yinc = (yhi - ylo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evbox(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi,
- ang) ){
- return(0);
- }
- /* but if its in the inner region we lose */
- else if( evbox(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo,
- ang) ){
- return(0);
- }
- /* its in the box .. must also be in the pie */
- else if( !evpie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi)){
- return(0);
- }
- /* look through all of them to find the right one */
- for(a=0; a<ahi; a++){
- for(r=1; r<=rhi; r++){
- if( evbox(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang) &&
- evqtpie(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc)) ){
- return(1);
- }
- n++;
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evbox(g, 0, xsno, 1, type, x, y, xcen, ycen, xhi, yhi, ang) )
- return(1);
- /* if its in the inner region we win */
- else if( !evbox(g, 0, xsno+2, 1, type, x, y, xcen, ycen, xlo, ylo,
- ang) )
- return(1);
- /* if its not in the pie, we win */
- else if( !evpie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){
- return(1);
- }
- else{
- return(0);
- }
- }
-}
-
-int evepanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double xlo, double ylo, double xhi, double yhi, double radn,
- double ang)
-{
-
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, xinc, yinc;
-
- /* get limits */
- anglo += ang;
- anghi += ang;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- xinc = (xhi - xlo)/radn;
- yinc = (yhi - ylo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi,
- ang) ){
- return(0);
- }
- /* but if its in the inner region we lose */
- else if( evellipse(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo,
- ang) ){
- return(0);
- }
- /* its in the ellipse .. must also be in the pie */
- else if( !evpie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi)){
- return(0);
- }
- /* look through all of them to find the right one */
- for(a=0; a<ahi; a++){
- for(r=1; r<=rhi; r++){
- if( evellipse(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang) &&
- evqtpie(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc)) ){
- return(1);
- }
- n++;
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, xhi, yhi, ang) )
- return(1);
- /* if its in the inner region we win */
- else if( !evellipse(g, 0, xsno+2, 1, type, x, y, xcen, ycen, xlo, ylo,
- ang) )
- return(1);
- /* if its not in the pie, we win */
- else if( !evpie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){
- return(1);
- }
- else{
- return(0);
- }
- }
-}
-
-/* varargs regions -- a series of lower and upper limits is specified */
-
-#ifdef __STDC__
-int
-evvannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int evvannulus(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double *xv;
- int i, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* this should be impossible ... */
- if( n == 2 ){
- return(evannulus(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1]));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( evannulus(g, rno+i, sno+i, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1]) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(1);
- }
- return(0);
- }
-}
-
-#ifdef __STDC__
-int
-evvbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double ang;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int evvbox(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- ang = xv[--n];
- /* this should be impossible ... */
- if( n == 2 ){
- return(evbox(g, rno, sno, flag, type, x, y,
- xcen, ycen, xv[0], xv[1], ang));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evbox(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1],
- ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( evbox(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=2, j=0; i<n; i+=2, j++){
- if( evbox(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1], ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !evbox(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[n-2], xv[n-1], ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- else if( evbox(g, 0, xsno+1, 1, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-
-#ifdef __STDC__
-int
-evvellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double ang;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int evvellipse(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- ang = xv[--n];
- /* this should be impossible ... */
- if( n == 2 ){
- return(evellipse(g, rno, sno, flag, type, x, y,
- xcen, ycen, xv[0], xv[1], ang));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1],
- ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( evellipse(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1],
- ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=2, j=0; i<n; i+=2, j++){
- if( evellipse(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1], ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we lose ... */
- if( !evellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[n-2], xv[n-1],
- ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- if( evellipse(g, 0, xsno+1, 1, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-#ifdef __STDC__
-int
-evvpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int evvpie(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double *xv;
- int i, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* this should be impossible ... */
- if( n == 2 ){
- return(evpie(g, rno, sno, flag, type, x, y,
- xcen, ycen, xv[0], xv[1]));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !evpie(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( evpie(g, rno+i, sno+i, flag, type, x, y, xcen, ycen, xv[i], xv[i+1]) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we lose ... */
- if( !evpie(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(1);
- }
- return(1);
- }
-}
-
-#ifdef __STDC__
-int
-evvpoint(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, y);
-#else
-int evvpoint(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* look through all of them to find the right one */
- for(i=0, j=0; i<n; i+=2, j++){
- if( evpoint(g, rno+j, sno+j, flag, type, x, y, xv[i], xv[i+1]) ){
- return(1);
- }
- }
- return(0);
-}
-
-
diff --git a/funtools/filter/filt.l b/funtools/filter/filt.l
deleted file mode 100644
index 576c478..0000000
--- a/funtools/filter/filt.l
+++ /dev/null
@@ -1,3228 +0,0 @@
-option caseless
-%array
-
-%{
-
-#include <stdio.h>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#include <ctype.h>
-#include <string.h>
-#include <math.h>
-#include <filter.h>
-
-#define MAX_INCLUDE_DEPTH 100
-#define SEGINC 1024
-#define MASKINC 1024
-
-#define LARGE_NUMBER 65536
-
-/* must match regions.h */
-#define PSTOP -142857.142857
-
-/* stolen from fitsy/xos.h */
-#define X__PI 3.14159265358979323846
-#define X_2PI ( 2 * X__PI )
-#define X_R2D (X_2PI / 360.0)
-#define X_R2H (X_2PI / 24.0)
-#define X_H2D (360.0 / 24.0)
-
-#define r2h(r) ( (r) / X_R2H )
-#define h2r(d) ( (d) * X_R2H )
-#define r2d(r) ( (r) / X_R2D )
-#define d2r(d) ( (d) * X_R2D )
-#define h2d(r) ( (r) * X_H2D )
-#define d2h(d) ( (d) / X_H2D )
-
-/* region types */
-#define TY_ANNULUS 1
-#define TY_BOX 2
-#define TY_CIRCLE 3
-#define TY_ELLIPSE 4
-#define TY_FIELD 5
-#define TY_LINE 6
-#define TY_PANDA 7
-#define TY_BPANDA 8
-#define TY_CPANDA 9
-#define TY_EPANDA 10
-#define TY_PIE 11
-#define TY_QTPIE 11
-#define TY_POINT 12
-#define TY_POLYGON 13
-#define TY_IMAGEMASK 14
-
-/* oft-used checks on argument and coord types */
-#define XARG ((narg % 2) == 1)
-#define YARG ((narg % 2) == 0)
-#define POSARG ((regid == TY_POLYGON) || (regid == TY_LINE) || (narg<=2))
-#define ANGARG (((regid == TY_PANDA) && (narg==3)) || \
- ((regid == TY_PANDA) && (narg==4)) || \
- ((regid == TY_BPANDA) && (narg==3)) || \
- ((regid == TY_BPANDA) && (narg==4)) || \
- ((regid == TY_CPANDA) && (narg==3)) || \
- ((regid == TY_CPANDA) && (narg==4)) || \
- ((regid == TY_EPANDA) && (narg==3)) || \
- ((regid == TY_EPANDA) && (narg==4)) || \
- ((regid == TY_PIE) && (narg>=3)) )
-
-#define NUMARG (((regid == TY_PANDA) && (narg==5)) || \
- ((regid == TY_PANDA) && (narg==8)) || \
- ((regid == TY_BPANDA) && (narg==5)) || \
- ((regid == TY_BPANDA) && (narg==10)) || \
- ((regid == TY_CPANDA) && (narg==5)) || \
- ((regid == TY_CPANDA) && (narg==8)) || \
- ((regid == TY_EPANDA) && (narg==5)) || \
- ((regid == TY_EPANDA) && (narg==10)) )
-
-#define SAVEANG ((regid == TY_BOX) || (regid == TY_ELLIPSE))
-
-#define USEPHYS (filt->fhd->table && \
- (filt->type == TYPE_EVENTS) && !filt->evsect)
-
-#define USEWCS (gcoordsys && \
- strcmp(gcoordsys, "image") && strcmp(gcoordsys, "physical"))
-
-#define IMFLIP (USEWCS && wcs->imflip)
-
-#define WCSSIZE (iswcs(wcs) && (cdelt1!=0) && (cdelt2!=0))
-
-/* format statements */
-#define DFMT1 ",%f"
-#define DFMT2 ",%f,%f"
-#define DFMT4 ",%f,%f,%f,%f"
-#define SFMT1 ",%s"
-#define IFMT1 ",%d"
-
-/* flex is not thread-safe, so we did not put any effort into avoiding
- globals, i.e. by putting read-write variables below into a struct */
-
-static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
-static int include_stack_ptr = 0;
-static int parse_error = 0;
-
-static int colargs;
-static int filtlen;
-static int radanglen;
-static int initbindefs;
-static int regtype;
-static int regid;
-static int laststart;
-static int maxfiltseg;
-static int setargs;
-static int inexpr;
-static int macropass;
-static int narg;
-static int nparen;
-static int nsparen;
-static int nrparen;
-static int nfiltseg;
-static int nrange;
-static int nroutine;
-static int nshape;
-static int nregion;
-static int nmask;
-static int got;
-static int offscl;
-static int xtype, ytype;
-static int tltyp[2];
-
-static double lastd1;
-static double lastd2;
-static double xpos, ypos;
-static double xpix, ypix;
-static double cdelt1, cdelt2, crot;
-static double dval, dval2;
-static double tlmin[2];
-static double tlmax[2];
-static double binsiz[2];
-
-static char lastarg[SZ_LINE];
-static char regname[SZ_LINE];
-static char colnames[2][SZ_LINE];
-static char wcsnames[2][SZ_LINE];
-static char macrobuf[SZ_LINE];
-static char rangename[SZ_LINE];
-static char sbuf[SZ_LINE];
-static char saveang[SZ_LINE];
-
-static char *fcoordsys=NULL;
-static char *gcoordsys=NULL;
-static char *filter=NULL;
-static char *radang=NULL;
-
-static struct WorldCoor *wcs=NULL;
-static FiltSeg *filtseg=NULL;
-static Filter filt=NULL;
-
-/* these are read-only */
-static char *rnames[] = {"annulus", "box", "circle", "ellipse",
- "line", "panda", "pie", "qtpie", "point",
- "polygon", "field", "bpanda", "cpanda", "epanda",
- "imagemask", NULL};
-static int rargs[] = {4, 5, 3, 5,
- 4, 8, 4, 4, 2,
- 6, 0, 11, 8, 11,
- 0, 0};
-static int vargs[] = {'y', 'o', 'y', 'o',
- 'n', 'n', 'y', 'n', 'e',
- 'e', 'n', 'n', 'n', 'n',
- 'n', '\0'};
-
-static int _FiltLexTypeCmp(const void *s1, const void *s2);
-static int _FiltLexTypeMatch(int ftype, int ttype);
-static int _FiltLexAccel _PRx((int n));
-static int _FiltLexRegionPanda _PRx((void));
-static int _FiltLexLcx _PRx((void));
-static int _FiltLexArgCheck _PRx((char *name, int args));
-static int _FiltLexNeedOp _PRx((int i, char *s));
-static void _FiltLexOp _PRx((char *s));
-static void _FiltLexTypeSet _PRx((int type));
-static void _FiltLexNew _PRx((void));
-static void _FiltLexParen _PRx((char *s));
-static void _FiltLexCat _PRx((char *s));
-static void _FiltLexRegionStart _PRx((int docols));
-static void _FiltLexRegionVal _PRx((char *s));
-static void _FiltLexRegionEnd _PRx((void));
-static void _FiltLexRangeAdd _PRx((char *xname, char *str, int type, int n, int maxlen));
-static void _FiltLexArgSave _PRx((double dval));
-static void _FiltLexSetWcs _PRx((char *s));
-static void _FiltLexWcsCols _PRx((FITSHead header, char *name1, char *name2));
-static void _FiltLexNum _PRx((int lcx));
-static void _FiltLexEnd _PRx((void));
-static void _FiltLexMake _PRx((void));
-static char *_FiltLexGetWcs _PRx((void));
-static int _FiltIncMask(FilterMask masks, int maxmask, int nmask);
-static int _FiltFitsMask(char *filename, FilterMask *rmasks, FITSHead *rhead, int *nreg);
-static void bin2num(char *d, char *s, int maxlen);
-
-int _filterror _PRx((char *msg));
-%}
-
-DIG [0-9]
-DIG2 [0-9a-fA-F]
-BINARY 0[bB][01]+
-INT1 [-+]?{DIG}+L?
-INT2 [-+]?0[xX]{DIG2}+L?
-INT ({INT1}|{INT2})
-FLOAT1 [-+]?{DIG}+\.?([eE][-+]?{DIG}+)?
-FLOAT2 [-+]?{DIG}*\.{DIG}+([eE][-+]?{DIG}+)?
-FLOAT ({FLOAT1}|{FLOAT2})
-NUM ({INT}|{FLOAT}|{BINARY})
-HMS {INT}{SP}[:hH]{SP}{INT}{SP}[:mM]{SP}{NUM}{SP}[s]?
-DMS {INT}{SP}[:dD]{SP}{INT}{SP}[:mM]{SP}{NUM}{SP}[s]?
-WCS {HMS}|{DMS}
-DEG {NUM}d
-RAD {NUM}r
-IPIX {NUM}i
-PPIX {NUM}p
-ASEC {NUM}\"
-AMIN {NUM}'
-COORSYS (j2000|fk5|icrs|b1950|fk4|galactic|ecliptic|linear|image|physical|amplifier|detector)
-NAME [A-Za-z_][0-9A-Za-z~_]*(\[[^\[]*\])?
-FILE @[0-9A-Za-z~_/\-\.]*(\[.*\])?
-REGION [\!+-]?(ann|annulus|box|cir|circle|ell|ellipse|lin|line|pan|panda|pie|poi|qtpie|qtp|point|pol|polygon|fie|field|bpanda|bpa|cpanda|cpa|epanda|epa)
-REGVAL {SP}\{{INT}\}
-LOP (&&|\|\||[&\|])
-OP (&&|\|\||==|!=|<=|>=|<<|>>|[&\|~=<>+\-*/%^])
-STR (\"[^\"]*\"|'[^']*')
-SP [ \t]*
-EOL ([;\n]|\\n)
-SEP (,|{EOL})
-COM #
-US (unsigned{SP})?
-II (int{SP})?
-DTYPE (\({US}char\)|\({US}short{II}\)|\({US}int\)|\({US}long{II}\)|\(float\)|\(double\))
-
-%s RLIST
-%s RTINE
-%s REG
-%x AREG
-%x INCLUDE
-%x COMM
-
-%%
-
-{DTYPE} { _FiltLexCat(yytext); }
-
-{COORSYS}[\n;,]* { _FiltLexSetWcs(yytext); }
-
-global { BEGIN COMM; }
-tile { BEGIN COMM; }
-compass { BEGIN COMM; }
-{COM} {
- /* comment acts like EOL */
- if( YY_START == REG ){
- _FiltLexRegionEnd();
- _FiltLexNew();
- }
- else if( YY_START == RLIST ){
- _FiltLexParen(")");
- _FiltLexNew();
- }
- else{
- _FiltLexNew();
- }
- BEGIN COMM;
-}
-<COMM>\n { BEGIN INITIAL; }
-<COMM>\\n { BEGIN INITIAL; }
-<COMM>. { /* ignore comments up to eol */ ; }
-
-[+-]?text([ \t]+|{SP}\({SP})[^;\n]*{EOL} { ; /* ignore */ }
-[+-]?vector([ \t]+|{SP}\({SP})[^;\n]*{EOL} { ; /* ignore */ }
-[+-]?ruler([ \t]+|{SP}\({SP})[^;\n]*{EOL} { ; /* ignore */ }
-[+-]?projection([ \t]+|{SP}\({SP})[^;\n]*{EOL} { ; /* ignore */ }
-
-\(/{NAME},{NAME}\){SP}={SP}{REGION} {
- if( YY_START == REG ){
- _FiltLexRegionEnd();
- _FiltLexNew();
- }
- /* Found an asc-style region */
- colargs = 0;
- laststart = YY_START;
- BEGIN AREG;
-}
-<AREG>{NAME} {
- if( colargs > 2 )
- _filterror("illegal Chandra region (too many column args)");
- if( !FilterSymbolEnter(filt, yytext, &got) ){
- switch(got){
- case -1:
- _filterror("missing column or header parameter");
- break;
- case -2:
- _filterror("column is not an array");
- break;
- case -3:
- _filterror("internal error while processing column");
- break;
- }
- }
- strcpy(colnames[colargs],yytext);
- colargs++;
-}
-<AREG>, { ; }
-<AREG>\( { ; }
-<AREG>\) { ; }
-<AREG>= {
- /* end of asc part of region */
- if( colargs != 2 )
- _filterror("illegal Chandra region (wrong number of cols)");
- BEGIN INITIAL;
-}
-
-[+-]?field([ \t]+|{SP}\({SP})? |
-{REGION}([ \t]+|{SP}\({SP})/{NUM} {
- /* finish off previous */
- if( YY_START == REG ){
- _FiltLexRegionEnd();
- _FiltLexNew();
- }
- /* Found a region */
- BEGIN REG;
- if( filt->type == TYPE_EVENTS ){
- /* if asc-style, re-do wcs for specified columns */
- if( colargs == 2 ){
- _FiltLexRegionStart(2);
- _FiltLexWcsCols(filt->fhd, colnames[0], colnames[1]);
- }
- /* set up default columns */
- else{
- _FiltLexRegionStart(1);
- }
- }
- /* its an image */
- else{
- _FiltLexRegionStart(0);
- }
-}
-{REGION}([ \t]+|{SP}\({SP})/{NAME} {
- /* can't happen */
- _filterror("invalid characters following the region name");
-}
-<REG>{NUM} {
- narg++;
- /* process this pure number in the current coord system */
- _FiltLexNum(_FiltLexLcx());
-}
-<REG>{IPIX} {
- narg++;
- /* remove trailing unit character */
- yytext[strlen(yytext)-1] = '\0';
- /* process this as a pure number in image coord sys */
- _FiltLexNum(LCX_IMAGE);
-}
-<REG>{PPIX} {
- narg++;
- /* remove trailing unit character */
- yytext[strlen(yytext)-1] = '\0';
- /* process this as a pure number in physical coord sys */
- _FiltLexNum(LCX_PHYS);
-}
-<REG>{WCS} {
- char *coordsys;
- if( nowcs(wcs) )
- _filterror("no WCS information in file");
- narg++;
- /* save x value for processing with y next time */
- if( XARG ){
- xpos = SAOstrtod(yytext,NULL);
- xtype = SAOdtype;
- if( (xtype !=0) && (xtype != '.') && (xtype != 'd') ){
- coordsys = _FiltLexGetWcs();
- /* arg1 coords are hms, but ecliptic, galactic are deg */
- if( !coordsys ||
- (strncasecmp(coordsys, "ecl", 3) &&
- strncasecmp(coordsys, "gal", 3)) ){
- xpos = h2d(xpos);
- }
- }
- }
- else{
- ypos = SAOstrtod(yytext,NULL);
- ytype = SAOdtype;
- /* convert wcs to image pixels */
- wcsc2pix(wcs, xpos,ypos, _FiltLexGetWcs(), &xpix,&ypix,
- &offscl);
- /* convert to physical for single event filtering */
- if( USEPHYS ){
- xpix = tli2p(xpix, tlmin[0], binsiz[0], tltyp[0]);
- ypix = tli2p(ypix, tlmin[1], binsiz[1], tltyp[1]);
- }
- snprintf(sbuf, SZ_LINE, DFMT2, xpix, ypix);
- _FiltLexCat(sbuf);
- }
-}
-<REG>{DEG} {
- narg++;
- /* handle position arguments */
- if( POSARG ){
- if( nowcs(wcs) )
- _filterror("no WCS information in file");
- /* save x value for processing with y next time */
- if( XARG ){
- xpos = strtod(yytext,NULL);
- }
- else{
- ypos = strtod(yytext,NULL);
- /* convert wcs to image pixels */
- wcsc2pix(wcs, xpos, ypos, _FiltLexGetWcs(),
- &xpix, &ypix, &offscl);
- /* convert to physical for single event filtering */
- if( USEPHYS ){
- xpix = tli2p(xpix, tlmin[0], binsiz[0], tltyp[0]);
- ypix = tli2p(ypix, tlmin[1], binsiz[1], tltyp[1]);
- }
- snprintf(sbuf, SZ_LINE, DFMT2, xpix, ypix);
- _FiltLexCat(sbuf);
- }
- }
- /* angle arguments are just passed along, with updated crot */
- else if( ANGARG ){
- dval = strtod(yytext,NULL);
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* panda numeric args are just passed along */
- else if( NUMARG ){
- dval = strtod(yytext,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* handle size arguments */
- else{
- if( !WCSSIZE )
- _filterror("no WCS (or CDELT) information in file");
- if( SAVEANG ){
- dval = strtod(yytext,NULL);
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(saveang, SZ_LINE, DFMT1, dval);
- }
- /* arg 1 is ra, arg2 is dec */
- if( XARG )
- dval = ABS(strtod(yytext,NULL)/cdelt1);
- else
- dval = ABS(strtod(yytext,NULL)/cdelt2);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
-}
-<REG>{RAD} {
- narg++;
- /* handle position arguments */
- if( POSARG ){
- if( nowcs(wcs) )
- _filterror("no WCS information in file");
- /* save x value for processing with y next time */
- if( XARG ){
- xpos = r2d(strtod(yytext,NULL));
- }
- else{
- ypos = r2d(strtod(yytext,NULL));
- /* convert wcs to image pixels */
- wcsc2pix(wcs, xpos, ypos, _FiltLexGetWcs(),
- &xpix, &ypix, &offscl);
- /* convert to physical for single event filtering */
- if( USEPHYS ){
- xpix = tli2p(xpix, tlmin[0], binsiz[0], tltyp[0]);
- ypix = tli2p(ypix, tlmin[1], binsiz[1], tltyp[1]);
- }
- snprintf(sbuf, SZ_LINE, DFMT2, xpix, ypix);
- _FiltLexCat(sbuf);
- }
- }
- /* angle arguments are just passed along, with updated crot */
- else if( ANGARG ){
- dval = r2d(strtod(yytext,NULL));
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* panda numeric args are just passed along */
- else if( NUMARG ){
- dval = strtod(yytext,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* handle size arguments */
- else{
- if( !WCSSIZE )
- _filterror("no WCS (or CDELT) information in file");
- if( SAVEANG ){
- dval = r2d(strtod(yytext,NULL));
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(saveang, SZ_LINE, DFMT1, dval);
- }
- /* arg 1 is ra, arg2 is dec */
- if( XARG )
- dval = r2d(ABS(strtod(yytext,NULL)/cdelt1));
- else
- dval = r2d(ABS(strtod(yytext,NULL)/cdelt2));
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
-}
-<REG>{AMIN} {
- if( !WCSSIZE )
- _filterror("no WCS (or CDELT) information in file");
- narg++;
- /* arg 1 is ra, arg2 is dec */
- if( XARG )
- dval = ABS(strtod(yytext,NULL)/(cdelt1*60.0));
- else
- dval = ABS(strtod(yytext,NULL)/(cdelt2*60.0));
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
-}
-<REG>{ASEC} {
- if( !WCSSIZE )
- _filterror("no WCS (or CDELT) information in file");
- narg++;
- /* arg 1 is ra, arg2 is dec */
- if( XARG )
- dval = ABS(strtod(yytext,NULL)/(cdelt1*3600.0));
- else
- dval = ABS(strtod(yytext,NULL)/(cdelt2*3600.0));
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
-}
-<REG>[a-z]{SP}={SP}{NUM}{SP} {
- int n;
- n = strtol(strchr(yytext, '=')+1, NULL, 10);
- if( n <=0 ){
- _filterror("invalid region accelerator");
- }
- else{
- if( !_FiltLexAccel(n) ){
- _filterror("invalid region accelerator");
- }
- }
-}
-<REG>{NUM}/{OP} {
- if( _FiltLexArgCheck(regname, narg) == 0 ){
- /* new expression without an expression separator ... sigh */
- _FiltLexRegionEnd();
- _FiltLexNew();
- BEGIN INITIAL;
- yyless(0);
- } else {
- narg++;
- /* process this pure number in the current coord system */
- _FiltLexNum(_FiltLexLcx());
- }
-}
-<REG>({NAME}{OP}|{FILE}) {
- /* new expression without an expression separator ... sigh */
- _FiltLexRegionEnd();
- _FiltLexNew();
- BEGIN INITIAL;
- yyless(0);
-}
-<REG>, {
- /* explicit rule avoids the _FiltLexNew of general rule */
- ;
-}
-<REG>{REGVAL} {
- _FiltLexRegionVal(yytext);
- if( !nsparen ){
- _FiltLexRegionEnd();
- BEGIN INITIAL;
- }
-}
-<REG>\( {
- nsparen++;
-}
-<REG>\){REGVAL} {
- _FiltLexRegionVal(yytext+1);
- if( nsparen ){
- nsparen--;
- if( !nsparen ){
- _FiltLexRegionEnd();
- BEGIN INITIAL;
- }
- } else {
- _FiltLexRegionEnd();
- BEGIN INITIAL;
- /* REJECT; */
- /* explicit execution of general rule instead of REJECT */
- nparen--;
- _FiltLexNew();
- _FiltLexCat(")");
- _FiltLexNew();
- }
-}
-<REG>\) {
- if( nsparen ){
- nsparen--;
- if( !nsparen ){
- _FiltLexRegionEnd();
- BEGIN INITIAL;
- }
- } else {
- _FiltLexRegionEnd();
- BEGIN INITIAL;
- /* REJECT; */
- /* explicit execution of general rule instead of REJECT */
- nparen--;
- _FiltLexNew();
- _FiltLexCat(")");
- _FiltLexNew();
- }
-}
-<REG>{OP} {
- _FiltLexRegionEnd();
- _FiltLexOp(yytext);
- BEGIN INITIAL;
-}
-<REG>{EOL} {
- _FiltLexRegionEnd();
- _FiltLexNew();
- BEGIN INITIAL;
-}
-
-{NAME}{SP}/={SP}\(?({NAME}|:{NAME}) {
- _filterror("you must use == to compare two columns,");
-}
-
-{NAME}{SP}/={SP}\(?({NUM}|:{NUM}) {
- if( YY_START == REG ){
- _FiltLexRegionEnd();
- }
- _FiltLexParen("(");
- BEGIN RLIST;
- narg = 0;
- _FiltLexTypeSet(TOK_RLIST);
- nrange = 0;
- if( !FilterSymbolEnter(filt, yytext, &got) ){
- switch(got){
- case -1:
- _filterror("missing column or header parameter");
- break;
- case -2:
- _filterror("column is not an array");
- break;
- case -3:
- _filterror("internal error while processing column");
- break;
- }
- }
- strncpy(rangename, yytext, SZ_LINE-1);
-}
-<RLIST>{NUM}{SP}:{SP}{NUM} {
- _FiltLexRangeAdd(rangename, yytext, 3, nrange++, SZ_LINE);
-}
-<RLIST>:{SP}{NUM} {
- _FiltLexRangeAdd(rangename, yytext, 1, nrange++, SZ_LINE);
-}
-<RLIST>{NUM}{SP}: {
- _FiltLexRangeAdd(rangename, yytext, 4, nrange++, SZ_LINE);
-}
-<RLIST>{NUM} {
- _FiltLexRangeAdd(rangename, yytext, 2, nrange++, SZ_LINE);
-}
-<RLIST>= { ; }
-<RLIST>, { ; }
-<RLIST>{SEP}{SP}/{NUM}\)*{LOP} { ; }
-<RLIST>{SEP}{SP}/\(*({NAME}|{NUM}{SP}{OP}|{FILE}|{REGION}) {
- _FiltLexParen(")");
- _FiltLexNew();
- BEGIN INITIAL;
-}
-<RLIST>\) {
- _FiltLexParen(")");
- _FiltLexNew();
- _FiltLexParen(")");
- _FiltLexNew();
- BEGIN INITIAL;
-}
-<RLIST>{OP} {
- _FiltLexParen(")");
- _FiltLexOp(yytext);
- BEGIN INITIAL;
-}
-<RLIST>{EOL} {
- _FiltLexParen(")");
- _FiltLexNew();
- BEGIN INITIAL;
-}
-
-{NAME}{SP}/\( {
- /* Found a routine */
- laststart = YY_START;
- BEGIN RTINE;
- narg = 0;
- nrparen = 0;
- _FiltLexTypeSet(TOK_RTINE);
- _FiltLexCat(FilterLexRoutine1(filt, yytext));
- nroutine++;
-}
-<RTINE>, {
- /* explicit rule avoids the _FiltLexNew of general rule */
- _FiltLexCat(",");
-}
-<RTINE>\( {
- nrparen++;
- _FiltLexCat("(");
-}
-<RTINE>\) {
- nrparen--;
- if( nrparen ){
- _FiltLexCat(")");
- }
- else{
- /* end of routine */
- BEGIN laststart;
- _FiltLexCat(FilterLexRoutine2(filt, ")"));
- }
-}
-
-{FILE} {
- /* Found an include file */
- char *s, *t;
- if( YY_START == REG ){
- _FiltLexRegionEnd();
- _FiltLexNew();
- }
- /* handle FITS mask file specially */
- filt->nmask = _FiltFitsMask(yytext+1,
- &(filt->masks),
- &(filt->maskhd),
- &(filt->nmaskreg));
- /* filt->nmask == -1 => its not a FITS file */
- if( filt->nmask != -1 ){
- switch(filt->nmask){
- case -2:
- _filterror("FITS image mask must be image data -");
- break;
- case -3:
- _filterror("Invalid dimensions for FITS image mask -");
- break;
- case -4:
- _filterror("FITS image mask cannot contain negative values -");
- break;
- default:
- if( (filt->type != TYPE_IMAGE) && !filt->evsect ){
- _filterror("FITS image mask is valid for image filtering only -");
- }
- else{
- if( nmask )
- _filterror("only one FITS image mask allowed at a time -");
- else
- nmask++;
- }
- break;
- }
- }
- else{
- if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) {
- _filterror("include files are nested too deeply");
- }
- if( (s = (char *)FileContents(yytext+1, 0, NULL)) == NULL ){
- _filterror("can't access include file");
- }
- /* ignore empty include file */
- else if( *s == '\0' ){
- ;
- }
- else {
- t = FilterClip(s);
- xfree(s);
- if( t && *t ){
- include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER;
- _FiltLexNew();
- _FiltLexParen("(");
- FiltScanString(t);
- xfree(t);
- }
- }
- }
-}
-
-{NAME} {
- if( !FilterSymbolEnter(filt, yytext, &got) ){
- switch(got){
- case -1:
- _filterror("missing column or header parameter");
- break;
- case -2:
- _filterror("column is not an array");
- break;
- case -3:
- _filterror("internal error while processing column");
- break;
- }
- }
- else{
- narg++;
- /* add if initial condition (not region, routine, etc.) */
- if( YY_START == INITIAL ) _FiltLexTypeSet(TOK_NAME);
- _FiltLexCat(FilterLexName(filt,yytext));
- }
-}
-
-{SP} { ; /* ignore white space */ }
-
-{STR} { narg++; _FiltLexCat(yytext); }
-
-{NUM} {
- char tbuf[SZ_LINE];
- bin2num(tbuf, yytext, SZ_LINE-1);
- narg++;
- _FiltLexCat(tbuf);
- }
-
-{OP} {
- _FiltLexOp(yytext);
- if( YY_START != RTINE ) BEGIN INITIAL;
-}
-
-\( {
- nparen++;
- _FiltLexNew();
- _FiltLexCat(yytext);
- _FiltLexNew();
-}
-\) {
- nparen--;
- _FiltLexNew();
- _FiltLexCat(yytext);
- _FiltLexNew();
-}
-{SEP} {
- _FiltLexNew();
- BEGIN INITIAL;
-}
-
-. { _FiltLexCat(yytext); }
-
-<<EOF>> {
- if ( --include_stack_ptr < 0 ){
- _FiltLexMake();
- yy_delete_buffer( YY_CURRENT_BUFFER );
- yyterminate();
- } else {
- _FiltLexParen(")");
- _FiltLexNew();
- yy_delete_buffer( YY_CURRENT_BUFFER );
- yy_switch_to_buffer(include_stack[include_stack_ptr] );
- }
-}
-
-%%
-
-/*
- *
- * Private Routines
- *
- *
- */
-
-
-#ifdef YY_USE_PROTOS
-static void floatprefix(void)
-#else
-static void floatprefix()
-#endif
-{
- if( filt->method == METHOD_C )
- _FiltLexCat("(double)");
-}
-
-#ifdef YY_USE_PROTOS
-static void floatsuffix(void)
-#else
-static void floatsuffix()
-#endif
-{
- return;
-}
-
-#ifdef YY_USE_PROTOS
-static void
-bin2num(char *d, char *s, int maxlen)
-#else
-static void
-bin2num(d, s, maxlen)
- char *d;
- char *s;
- int maxlen;
-#endif
-{
- unsigned long bits;
- char *p=NULL;
-
- if( strlen(s) < 2 ){
- if( d != s ) strncpy(d, s, maxlen-1);
- }
- else{
- if( (*s=='0') && (*(s+1)=='b') ){
- bits = strtoul(s+2, &p, 2);
- if( *p != '\0' ) _filterror("invalid binary value");
- snprintf(d, maxlen, "%lx", bits);
- if( (strlen(d) <2) || (*d!='0') || ((*(d+1)!='x')&&((*(d+1)!='X'))) ){
- snprintf(d, maxlen, "0x%lx", bits);
- }
- }
- else{
- if( d != s ) strncpy(d, s, maxlen-1);
- }
- }
-}
-
-/*
- *
- * _FiltLexNew -- finish last start and set up new filter segment
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexNew(void)
-#else
-static void _FiltLexNew()
-#endif
-{
- int i;
- int last;
-
- if( nfiltseg >= maxfiltseg ){
- last = maxfiltseg;
- if( maxfiltseg == 0 ){
- maxfiltseg = SEGINC;
- filtseg = (FiltSeg *)xmalloc(maxfiltseg * sizeof(FiltSeg));
- }
- else{
- maxfiltseg += SEGINC;
- filtseg = (FiltSeg *)xrealloc(filtseg, maxfiltseg * sizeof(FiltSeg));
- }
- /* clear the unused records */
- for(i=last; i<maxfiltseg; i++){
- filtseg[i] = NULL;
- }
- }
- if( !nfiltseg || (filtseg[nfiltseg-1] && filtseg[nfiltseg-1]->s) ){
- filtseg[nfiltseg] = (FiltSeg)xcalloc(1, sizeof(FiltSegRec));
- nfiltseg++;
- }
- filtseg[nfiltseg-1]->n = nfiltseg-1;
- filtseg[nfiltseg-1]->nregion = 0;
-}
-
-/*
- *
- * _FiltLexParen -- add a paren to the filter string buffer
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexParen(char *str)
-#else
-static void _FiltLexParen(str)
- char *str;
-#endif
-{
- /* _FiltLexNew(); */
- _FiltLexCat(str);
- /* _FiltLexNew(); */
-}
-
-/*
- *
- * __FiltLexCat -- add a string to the filter string buffer
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-__FiltLexCat(char *str, char **ostr, int *olen)
-#else
-static void __FiltLexCat(str, ostr, olen)
- char *str;
- char **ostr;
- int *olen;
-#endif
-{
- int blen;
- int slen;
-
- if( (str == NULL) || (*str == '\0') )
- return;
- else
- slen = strlen(str) + 1;
-
- if( (*ostr == NULL) || (**ostr == '\0') )
- blen = 0;
- else
- blen = strlen(*ostr);
-
- while( (blen + slen) >= *olen ){
- *olen += SEGINC;
- }
- if( blen == 0 )
- *ostr = (char *)xcalloc(*olen, sizeof(char));
- else
- *ostr = (char *)xrealloc(*ostr, *olen);
- strcat(*ostr, str);
-}
-
-/*
- *
- * _FiltLexCat -- add a string to the filter string buffer
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexCat(char *str)
-#else
-static void _FiltLexCat(str)
- char *str;
-#endif
-{
- char *s;
- if( !str || !*str )
- return;
- if( nfiltseg ==0 )
- _FiltLexNew();
- s = xmalloc(strlen(str)+1);
- nowhite(str, s);
- __FiltLexCat(s, &(filtseg[nfiltseg-1]->s), &(filtseg[nfiltseg-1]->len));
- if( s ) xfree(s);
-}
-
-/*
- *
- * _FiltLexArgSave -- save a radius or angle value to the temp string:
- * this is a special hack for funcnts
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexArgSave(double dval)
-#else
-static void _FiltLexArgSave(dval)
- double dval;
-#endif
-{
- char tbuf[SZ_LINE];
-
- if( narg < 3 )
- return;
- snprintf(tbuf, SZ_LINE, DFMT1, dval);
- if( narg == 3 ){
- *lastarg = '\0';
- lastd1 = 0.0;
- lastd2 = 0.0;
- if( filtseg[nfiltseg-1]->radang ){
- xfree(filtseg[nfiltseg-1]->radang);
- filtseg[nfiltseg-1]->radang = NULL;
- filtseg[nfiltseg-1]->ralen = 0;
- }
- }
- switch(regid){
- case TY_ANNULUS:
- case TY_CIRCLE:
- if( *lastarg ){
- __FiltLexCat(lastarg, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- if( narg > 3 ){
- __FiltLexCat(",NA,NA\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- strcpy(lastarg, tbuf);
- }
- lastd1 = lastd2;
- lastd2 = dval;
- break;
-
- case TY_BOX:
- case TY_ELLIPSE:
- if( (narg%2) == 1 ){
- if( *lastarg ){
- __FiltLexCat(lastarg, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- if( narg > 3 ){
- __FiltLexCat(",NA,NA\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- strcpy(lastarg, tbuf);
- }
- lastd1 = lastd2;
- lastd2 = dval;
- }
- break;
-
- case TY_PIE:
- if( narg == 3 ){
- __FiltLexCat("NA,NA", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- else if( *lastarg ){
- __FiltLexCat("NA,NA,", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- __FiltLexCat(lastarg, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- if( narg > 3 ){
- __FiltLexCat("\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- strcpy(lastarg, tbuf);
- }
- lastd1 = lastd2;
- lastd2 = dval;
- break;
-
- case TY_POINT:
- /* we have to process this here if its is a varargs */
- /* so, for the 3rd arg, we add a line for initial x, y pair */
- if( narg == 3 ){
- __FiltLexCat("NA,NA,NA,NA\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- /* and for every even arg, add a line for the preceeding x,y pair */
- else if( (narg % 2) == 0 ){
- __FiltLexCat("NA,NA,NA,NA\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- break;
- default:
- return;
- }
-}
-
-/*
- *
- * _FiltLexAccel -- appply acceleration to a segment
- *
- */
-#ifdef YY_USE_PROTOS
-static int
-_FiltLexAccel(int n)
-#else
-static int _FiltLexAccel(n)
- int n;
-#endif
-{
- int i;
- char tbuf[SZ_LINE];
- char *s;
- double dinc;
-
- /* check region type */
- switch(regid){
- case TY_ANNULUS:
- break;
- case TY_BOX:
- narg -= 2;
- break;
- case TY_CIRCLE:
- narg -= 1;
- break;
- case TY_ELLIPSE:
- narg -= 2;
- break;
- case TY_PIE:
- break;
- default:
- _filterror("annulus, box, circle, ellipse, pie accelerators only - ");
- break;
- }
- /* add the argument */
- snprintf(tbuf, SZ_LINE, IFMT1, n);
- _FiltLexCat(tbuf);
- /* change the name of the routine we will call */
- if( filtseg[nfiltseg-1]->s0 ){
- if( (s = xstrdup(&filtseg[nfiltseg-1]->s[filtseg[nfiltseg-1]->s0])) ){
- filtseg[nfiltseg-1]->s[filtseg[nfiltseg-1]->s0] = '\0';
- _FiltLexCat("n");
- _FiltLexCat(s);
- snprintf(tbuf, SZ_LINE, "%d ", n);
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->regions),
- &(filtseg[nfiltseg-1]->nr));
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->shapes),
- &(filtseg[nfiltseg-1]->ns));
- setargs = 1;
- free (s);
- }
- if( filtseg[nfiltseg-1]->radang ){
- xfree(filtseg[nfiltseg-1]->radang);
- filtseg[nfiltseg-1]->radang = NULL;
- filtseg[nfiltseg-1]->ralen = 0;
- }
- switch(regid){
- case TY_ANNULUS:
- case TY_BOX:
- case TY_CIRCLE:
- case TY_ELLIPSE:
- dinc = (lastd2 - lastd1)/n;
- for(i=1; i<=n; i++){
- snprintf(tbuf, SZ_LINE, DFMT2, lastd1+((i-1)*dinc), lastd1+(i*dinc));
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- __FiltLexCat(",NA,NA", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- __FiltLexCat("\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- break;
- case TY_PIE:
- dinc = (lastd2 - lastd1)/n;
- for(i=1; i<=n; i++){
- snprintf(tbuf, SZ_LINE, DFMT2, lastd1+((i-1)*dinc), lastd1+(i*dinc));
- __FiltLexCat("NA,NA", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- __FiltLexCat("\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- break;
- default:
- _filterror("annulus, box, circle, ellipse, pie accelerators only - ");
- break;
- }
- _FiltLexTypeSet(TOK_ACCEL);
- }
- else{
- _filterror("misplaced accelerator");
- }
- return(n);
-}
-
-/*
- *
- * _FiltLexTypeSet -- add type info to the filter segment record
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexTypeSet(int type)
-#else
-static void _FiltLexTypeSet(type)
- int type;
-#endif
-{
- if( nfiltseg ==0 )
- _FiltLexNew();
- filtseg[nfiltseg-1]->type |= type;
-}
-
-/*
- *
- * _FiltLexOp -- add an operator to the filter segment record
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexOp(char *op)
-#else
-static void _FiltLexOp(op)
- char *op;
-#endif
-{
- _FiltLexCat(op);
- filtseg[nfiltseg-1]->ops += 1;
-}
-
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexRegionStart(int docols)
-#else
-static void _FiltLexRegionStart(docols)
- int docols;
-#endif
-{
- char *s, *t;
- char tbuf[SZ_LINE];
-
- /* sanity check -- 1D images do not support regions */
- if( (filt->type == TYPE_IMAGE) && (ft_naxes(filt->fhd)==1) ){
- _filterror("2D region filters invalid for 1D images");
- }
- narg = 0;
- setargs=0;
- s = xmalloc(strlen(yytext)+1);
- nowhite(yytext, s);
- if( *s == '+' ){
- regtype = TOK_IREG;
- strcpy(regname, s+1);
- }
- else if( *s == '-' ){
- regtype = TOK_EREG;
- strcpy(regname, s+1);
- }
- else if( *s == '!' ){
- regtype = TOK_NREG;
- strcpy(regname, s+1);
- }
- else{
- regtype = TOK_IREG;
- strcpy(regname, s);
- }
- _FiltLexTypeSet(regtype);
- if( !(t=strchr(regname, '(')) ){
- nsparen=0;
- }
- /* remove the paren from the regname string -- we will explicitly add it */
- else{
- *t = '\0';
- nsparen=1;
- }
- /* convert to lower case, remove white space */
- culc(regname);
- nowhite(regname, s);
- strcpy(regname, s);
- /* convert abbrev to region */
- if( !strncmp(regname, "ann", 3) ){
- strcpy(regname, "annulus");
- regid = TY_ANNULUS;
- }
- else if( !strncmp(regname, "box", 3) ){
- strcpy(regname, "box");
- regid = TY_BOX;
- }
- else if( !strncmp(regname, "cir", 3) ){
- strcpy(regname, "circle");
- regid = TY_CIRCLE;
- }
- else if( !strncmp(regname, "ell", 3) ){
- strcpy(regname, "ellipse");
- regid = TY_ELLIPSE;
- }
- else if( !strncmp(regname, "fie", 3) ){
- strcpy(regname, "field");
- regid = TY_FIELD;
- }
- else if( !strncmp(regname, "lin", 3) ){
- strcpy(regname, "line");
- regid = TY_LINE;
- }
- else if( !strncmp(regname, "pan", 3) ){
- strcpy(regname, "panda");
- regid = TY_PANDA;
- }
- else if( !strncmp(regname, "bpa", 3) ){
- strcpy(regname, "bpanda");
- regid = TY_BPANDA;
- }
- else if( !strncmp(regname, "cpa", 3) ){
- strcpy(regname, "cpanda");
- regid = TY_CPANDA;
- }
- else if( !strncmp(regname, "epa", 3) ){
- strcpy(regname, "epanda");
- regid = TY_EPANDA;
- }
- else if( !strncmp(regname, "pie", 3) ){
- strcpy(regname, "pie");
- regid = TY_PIE;
- }
- else if( !strncmp(regname, "qtp", 3) ){
- strcpy(regname, "qtpie");
- regid = TY_PIE;
- }
- else if( !strncmp(regname, "poi", 3) ){
- strcpy(regname, "point");
- regid = TY_POINT;
- }
- else if( !strncmp(regname, "pol", 3) ){
- strcpy(regname, "polygon");
- regid = TY_POLYGON;
- }
- else if( !strcmp(regname, "imagemask") ){
- regid = TY_IMAGEMASK;
- }
- /* append filter-type prefix */
- switch( filt->type ){
- case TYPE_EVENTS:
- /* normally, we filter rows analytically using evregions.o */
- if( !filt->evsect )
- _FiltLexCat("ev");
- /* if evsect=xxx is specified, we filter by image pixels */
- else
- _FiltLexCat("im");
- break;
- case TYPE_IMAGE:
- /* image are filtered by image pixels */
- _FiltLexCat("im");
- break;
- }
- /* no region value to start */
- filtseg[nfiltseg-1]->regval = 0;
- /* save size of current string so we can get back to the region string */
- filtseg[nfiltseg-1]->s0 = strlen(filtseg[nfiltseg-1]->s);
- /* append region */
- _FiltLexCat(FilterLexRegion1(filt,regname));
- /* append standard args */
- _FiltLexCat("(g,$RS,");
- /* add include/exclude and whether we mark y lines for this region
- (we don't mark y on excludes as an optimization) */
- switch(regtype){
- case TOK_IREG:
- snprintf(tbuf, SZ_LINE, "1,%d", TOK_IREG);
- _FiltLexCat(tbuf);
- break;
- case TOK_NREG:
- snprintf(tbuf, SZ_LINE, "0,%d", TOK_NREG);
- _FiltLexCat(tbuf);
- break;
- case TOK_EREG:
- snprintf(tbuf, SZ_LINE, "0,%d", TOK_EREG);
- _FiltLexCat(tbuf);
- break;
- }
- switch(docols){
- case 0:
- /* initialize default columns for tables -- but don't enter symbols yet */
- FilterSymbolDefaults(filt, 0);
- /* initialize wcs for default image case */
- _FiltLexWcsCols(filt->fhd, filt->xbin, filt->ybin);
- _FiltLexCat(",");
- floatprefix();
- _FiltLexCat("x");
- floatsuffix();
- _FiltLexCat(",");
- floatprefix();
- _FiltLexCat("y");
- floatsuffix();
- break;
- case 1:
- if( !initbindefs ){
- /* initialize default columns for tables and enter symbols */
- FilterSymbolDefaults(filt, 1);
- /* initialize wcs for default table case */
- _FiltLexWcsCols(filt->fhd, filt->xbin, filt->ybin);
- initbindefs++;
- }
- if( !filt->xbin || !filt->ybin ){
- _filterror("two binning columns are required for regions");
- }
- _FiltLexCat(",");
- floatprefix();
- _FiltLexCat(filt->xbin);
- floatsuffix();
- _FiltLexCat(",");
- floatprefix();
- _FiltLexCat(filt->ybin);
- floatsuffix();
- break;
- case 2:
- _FiltLexCat(",");
- floatprefix();
- _FiltLexCat(colnames[0]);
- floatsuffix();
- _FiltLexCat(",");
- floatprefix();
- _FiltLexCat(colnames[1]);
- floatsuffix();
- break;
- }
- if( s ) xfree(s);
-}
-
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexRegionVal(char *s)
-#else
-static void
-_FiltLexRegionVal(s)
- char *s;
-#endif
-{
- char *t=NULL;
- if( (t=strchr(s, '{')) ){
- t++;
- }
- else{
- t = s;
- }
- filtseg[nfiltseg-1]->regval = atoi(t);
-}
-
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexRegionEnd(void)
-#else
-static void
-_FiltLexRegionEnd()
-#endif
-{
- int n;
- char *s;
- char ebuf[SZ_LINE];
- char tbuf[SZ_LINE];
-
- /* add final arguments as required */
- switch( regid ){
- case TY_BOX:
- if( (narg%2) == 0 ){
- _FiltLexCat(",0.0"); narg++;
- }
- else{
- /* if we saved an angle arg, we need to replace the last position arg */
- if( *saveang ){
- if( (s=strrchr(filtseg[nfiltseg-1]->s, ',')) ){
- *s = '\0';
- _FiltLexCat(saveang);
- }
- }
- }
- break;
- case TY_ELLIPSE:
- if( (narg%2) == 0 ){
- _FiltLexCat(",0.0"); narg++;
- }
- else{
- /* if we saved an angle arg, we need to replace the last position arg */
- if( *saveang ){
- if( (s=strrchr(filtseg[nfiltseg-1]->s, ',')) ){
- *s = '\0';
- _FiltLexCat(saveang);
- }
- }
- }
- break;
- case TY_BPANDA:
- case TY_EPANDA:
- if( (narg%2) == 0 ){
- _FiltLexCat(",0.0"); narg++;
- }
- /* drop through here to process panda */
- case TY_PANDA:
- case TY_CPANDA:
- _FiltLexRegionPanda();
- setargs = 1;
- break;
- default:
- break;
- }
-
- /* argument check */
- if( (n=_FiltLexArgCheck(regname, narg)) > 0 ){
- /* don't bother printing where we are in region */
- *yytext = '\0';
- switch( vargs[n-1] ){
- case 'n':
- snprintf(ebuf, SZ_LINE, "'%s' requires %d args (%d found)",
- rnames[n-1], rargs[n-1], narg);
- break;
- case 'e':
- snprintf(ebuf, SZ_LINE,
- "'%s' requires at least %d (even) args (%d found)",
- rnames[n-1], rargs[n-1], narg);
- break;
- case 'o':
- snprintf(ebuf, SZ_LINE,
- "'%s' requires at least %d (odd) args (%d found)",
- rnames[n-1], rargs[n-1], narg);
- break;
- case 'y':
- default:
- snprintf(ebuf, SZ_LINE, "'%s' requires %d args (%d found)",
- rnames[n-1], rargs[n-1], narg);
- break;
- }
- _filterror(ebuf);
- }
-
- /* process varargs */
- if( (n < 0) || (regid == TY_POLYGON) ){
- if( filtseg[nfiltseg-1]->type & TOK_ACCEL ){
- _filterror("n= and variable arglist cannot be combined -");
- }
- /* if its a varargs, we need to end with PSTOP values */
- snprintf(sbuf, SZ_LINE, DFMT2, PSTOP, PSTOP);
- _FiltLexCat(sbuf);
- /* change the name of the routine we will call */
- if( regid != TY_POLYGON ){
- if( filtseg[nfiltseg-1]->s0 ){
- if((s = xstrdup(&filtseg[nfiltseg-1]->s[filtseg[nfiltseg-1]->s0]))){
- filtseg[nfiltseg-1]->s[filtseg[nfiltseg-1]->s0] = '\0';
- _FiltLexCat("v");
- _FiltLexCat(s);
- switch(regid){
- case TY_ANNULUS:
- n = narg - 3;
- break;
- case TY_BOX:
- n = (narg - 5)/2;
- break;
- case TY_CIRCLE:
- n = narg - 3;
- break;
- case TY_ELLIPSE:
- n = (narg - 5)/2;
- break;
- case TY_PIE:
- n = narg - 3;
- break;
- case TY_POINT:
- n = narg/2;
- break;
- default:
- _filterror("varargs: annulus, box, circle, ellipse, pie, point;");
- break;
- }
- snprintf(tbuf, SZ_LINE, "%d ", n);
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->regions),
- &(filtseg[nfiltseg-1]->nr));
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->shapes),
- &(filtseg[nfiltseg-1]->ns));
- setargs = 1;
- free (s);
- }
- _FiltLexTypeSet(TOK_VARARGS);
- }
- else{
- _filterror("invalid varargs");
- }
- }
- }
-
-
- /* set number of regions and shapes, if not already done */
- if( !setargs ){
- snprintf(tbuf, SZ_LINE, "%d ", 1);
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->regions),
- &(filtseg[nfiltseg-1]->nr));
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->shapes),
- &(filtseg[nfiltseg-1]->ns));
- }
-
- /* finish off region string */
- _FiltLexCat(FilterLexRegion2(filt,")"));
-
- /* no column arguments */
- colargs = 0;
- /* arguments are not set */
- setargs = 0;
- /* save angle not set */
- *saveang = 0;
-}
-
-#ifdef YY_USE_PROTOS
-static int
-_FiltLexRegionPanda(void)
-#else
-static int
-_FiltLexRegionPanda()
-#endif
-{
- int i;
- int n=0;
- int got=0;
- int a, r;
- int ahi=0, rhi=0;
- int hi=0;
- double d[11];
- double ainc=0.0, rinc=0.0;
- char tbuf[SZ_LINE];
- char *s=NULL;
- char *t, *u;
-
- switch(regid){
- case TY_PANDA:
- case TY_CPANDA:
- hi = 7;
- break;
- case TY_BPANDA:
- case TY_EPANDA:
- hi = 10;
- break;
- default:
- _filterror("unknown panda type -- contact saord@cfa.harvard.edu");
- break;
- }
- s = xstrdup(filtseg[nfiltseg-1]->s);
- for(i=hi; i>=0; i--){
- /* look for last comma */
- t = strrchr(s, ',');
- if( !t ) goto done;
- /* null it out from base string */
- *t = '\0';
- /* point past comma and get double value */
- t++;
- d[i] = strtod(t, &u);
- if( t == u ) goto done;
- }
-
- switch(regid){
- case TY_PANDA:
- case TY_CPANDA:
- ainc = (d[3] - d[2])/d[4];
- ahi = (int)d[4];
- rinc = (d[6] - d[5])/d[7];
- rhi = (int)d[7];
- break;
- case TY_BPANDA:
- case TY_EPANDA:
- ainc = (d[3] - d[2])/d[4];
- ahi = (int)d[4];
- rinc = (d[7] - d[5])/d[9];
- rhi = (int)d[9];
- break;
- default:
- _filterror("unknown panda type -- contact saord@cfa.harvard.edu");
- break;
- }
- /* process limits arguments */
- for(a=1; a<=ahi; a++){
- for(r=1; r<=rhi; r++){
- snprintf(tbuf, SZ_LINE, DFMT4,
- d[5]+((r-1)*rinc), d[5]+(r*rinc),
- d[2]+((a-1)*ainc), d[2]+(a*ainc));
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- __FiltLexCat("\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- n++;
- }
- }
-
- /* adjust region and shape count */
- snprintf(tbuf, SZ_LINE, "%d ", n);
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->regions),
- &(filtseg[nfiltseg-1]->nr));
- snprintf(tbuf, SZ_LINE, "%d ", 2*n);
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->shapes),
- &(filtseg[nfiltseg-1]->ns));
- _FiltLexTypeSet(TOK_ACCEL);
- /* success */
- got = 1;
-
-done:
- if( s ) xfree(s);
- return got;
-}
-
-/*
- *
- * _FiltLexRangeAdd -- add a rangelist string to the filter string buffer
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexRangeAdd(char *xname, char *str, int type, int n, int maxlen)
-#else
-static void _FiltLexRangeAdd(xname, str, type, n, maxlen)
- char *xname;
- char *str;
- int type;
- int n;
- int maxlen;
-#endif
-{
- char tbuf[SZ_LINE];
- char tbuf2[SZ_LINE];
- char *s;
- char *t;
- char *t2;
- char *name;
-
- /* get "in-expression" name for current technique */
- name = FilterLexName(filt, xname);
-
- /* initialize pointers */
- s = str;
- t = tbuf;
-
- /* clear working buffer */
- memset(t, 0, SZ_LINE);
-
- /* if this is not the beginning, we first need to OR with prev */
- if( n != 0 ) strncat(t, "||", maxlen-1);
-
- /* put in parens for safety */
- strncat(t, "(", maxlen-1);
-
- /* add the name */
- strncat(t, name, maxlen-1);
-
- /* add the rangelist */
- switch(type){
- case 1:
- strncat(t, "<=", maxlen-1);
- /* skip past : */
- s++;
- /* append value */
- t2 = tbuf2;
- while( *s ){
- *t2++ = *s++;
- }
- *t2 = '\0';
- bin2num(tbuf2, tbuf2, maxlen-1);
- strncat(t, tbuf2, maxlen-1);
- break;
- case 2:
- strncat(t, "==", maxlen-1);
- /* append upper value */
- t2 = tbuf2;
- while( *s ){
- *t2++ = *s++;
- }
- *t2 = '\0';
- bin2num(tbuf2, tbuf2, maxlen-1);
- strncat(t, tbuf2, maxlen-1);
- break;
- case 3:
- strncat(t, ">=", maxlen-1);
- /* append lower value */
- t2 = tbuf2;
- while( *s && (*s != ':') ){
- *t2++ = *s++;
- }
- *t2 = '\0';
- bin2num(tbuf2, tbuf2, maxlen-1);
- strncat(t, tbuf2, maxlen-1);
- /* skip past : */
- s++;
- strncat(t, "&&", maxlen-1);
- strncat(t, name, maxlen-1);
- strncat(t, "<=", maxlen-1);
- /* append upper value */
- t2 = tbuf2;
- while( *s ){
- *t2++ = *s++;
- }
- *t2 = '\0';
- bin2num(tbuf2, tbuf2, maxlen-1);
- strncat(t, tbuf2, maxlen-1);
- break;
- case 4:
- strncat(t, ">=", maxlen-1);
- /* append lower value */
- t2 = tbuf2;
- while( *s && (*s != ':') ){
- *t2++ = *s++;
- }
- *t2 = '\0';
- bin2num(tbuf2, tbuf2, maxlen-1);
- strncat(t, tbuf2, maxlen-1);
- break;
- }
- strncat(t, ")", maxlen-1);
- _FiltLexCat(tbuf);
-}
-
-/*
- *
- * _FiltLexTypeCmp -- compare routine for qsort
- *
- */
-#ifdef YY_USE_PROTOS
-static int
-_FiltLexTypeCmp(const void *s1, const void *s2)
-#else
-static int _FiltLexTypeCmp(s1, s2)
- const void *s1;
- const void *s2;
-#endif
-{
- FiltSeg *f1 = (FiltSeg *)s1;
- FiltSeg *f2 = (FiltSeg *)s2;
-
- /* check for broken qsort */
- if( !*f1 || !*f2 ){
- _filterror("qsort is broken -- contact saord@cfa.harvard.edu");
- /* will not happen */
- return 0;
- }
-
- /* make sure null string is at the end */
- if( !(*f1)->s && !(*f2)->s ) return 0;
- else if( !(*f1)->s ) return 1;
- else if( !(*f2)->s ) return -1;
-
- /* paint: reverse order and make excludes local */
- if( filt->paint ){
- /* if both are regions, reverse order */
- if( ((*f1)->type & TOK_REG) && ((*f2)->type & TOK_REG) ){
- if( (*f1)->n < (*f2)->n ) return 1;
- else if( (*f1)->n > (*f2)->n ) return -1;
- else return 0;
- }
- /* keep same order */
- else{
- if( (*f1)->n < (*f2)->n ) return -1;
- else if( (*f1)->n > (*f2)->n ) return 1;
- else return 0;
- }
- }
- else{
- /* if both or neither are eregions, keep them in the same order */
- if( ((*f1)->type & TOK_EREG) == ((*f2)->type & TOK_EREG) ){
- if( (*f1)->n < (*f2)->n ) return -1;
- else if( (*f1)->n > (*f2)->n ) return 1;
- else return 0;
- }
- /* exactly one is an eregion -- and we want eregions last */
- else{
- if( (*f1)->type & TOK_EREG ) return 1;
- else if( (*f2)->type & TOK_EREG ) return -1;
- /* should not happen */
- else return 0;
- }
- }
-}
-
-/*
- *
- * _FiltLexTypeMatch -- see if the type of filtering we are doing
- * matches the type of token we have
- *
- */
-#ifdef YY_USE_PROTOS
-int
-_FiltLexTypeMatch(int ftype, int ttype)
-#else
-int _FiltLexTypeMatch(ftype, ttype)
- int ftype;
- int ttype;
-#endif
-{
- switch(ftype){
- case TYPE_IMAGE:
- /* we don't allow range list and col names in image filters */
- if( (ttype & TOK_RLIST) || (ttype & TOK_NAME) )
- return 0;
- /* everything else is fine */
- else
- return 1;
- case TYPE_EVENTS:
- return 1;
- default:
- return 1;
- }
-}
-
-#ifdef YY_USE_PROTOS
-static int
-_FiltLexArgCheck(char *name, int args)
-#else
-static int _FiltLexArgCheck(name, args)
- char *name;
- int args;
-#endif
-{
- int i;
-
- for(i=0; rnames[i]; i++){
- if( !strcmp(name, rnames[i]) ){
- if( args == rargs[i] ){
- return(0);
- }
- else{
- /* less than required min */
- if( args < rargs[i] )
- return(i+1);
- /* more than min args -- could be varargs */
- else{
- /* check args allowed in varargs */
- switch(vargs[i]){
- case 'e':
- if( (args%2) == 0 )
- return(-1);
- else
- return(i+1);
- case 'o':
- if( (args%2) == 1 )
- return(-1);
- else
- return(i+1);
- case 'y':
- return(-1);
- default:
- return(i+1);
- }
- }
- }
- }
- }
- return(0);
-}
-
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexSetWcs(char *s)
-#else
-static void _FiltLexSetWcs(s)
- char *s;
-#endif
-{
- char name[SZ_LINE];
- int ip=0;
-
- newdtable(",=;");
- /* get name of global coordsys */
- if( word(s, name, &ip) ){
- if( gcoordsys ) xfree(gcoordsys);
- gcoordsys = xstrdup(name);
- culc(gcoordsys);
- }
- /* restore old delim table */
- freedtable();
-}
-
-#ifdef YY_USE_PROTOS
-static char *
-_FiltLexCB(char *name, void *client_data)
-#else
-static char *_FiltLexCB(name, client_data)
- char *name;
- void *client_data;
-#endif
-{
- FiltSeg f=(FiltSeg)client_data;
- int ip=0;
- int nr=0;
- int ns=0;
- char *s;
- char tbuf[SZ_LINE];
-
- if( !strcmp(name, "RS") ){
- /* exclude regions get no region value first time around */
- if( (macropass==0) && (f->type & TOK_EREG) ){
- return NULL;
- }
- /* get next region value and remove from string */
- if( word(f->regions, tbuf, &ip) ){
- nr = atoi(tbuf);
- s = xstrdup(&(f->regions[ip]));
- xfree(f->regions);
- f->regions = s;
- }
- else{
- _filterror("internal error: no region string specified");
- return(NULL);
- }
- if( !inexpr || (f->type & (TOK_ACCEL|TOK_VARARGS)) ){
- if( f->regval ){
- snprintf(macrobuf, SZ_LINE, "%d,", f->regval);
- }
- else{
- snprintf(macrobuf, SZ_LINE, "%d,", nregion+1);
- }
- nregion += nr;
- f->nregion += nr;
- inexpr = 1;
- }
- else{
- if( f->regval ){
- snprintf(macrobuf, SZ_LINE, "%d,", f->regval);
- }
- else{
- snprintf(macrobuf, SZ_LINE, "%d,", nregion);
- }
- }
-
- /* get next shape value and remove from string */
- ip = 0;
- if( word(f->shapes, tbuf, &ip) ){
- ns = atoi(tbuf);
- s = xstrdup(&(f->shapes[ip]));
- xfree(f->shapes);
- f->shapes = s;
- }
- else{
- _filterror("internal error: no shape string specified");
- return(NULL);
- }
- /* concat shape value */
- nshape++;
- snprintf(tbuf, SZ_LINE, "%d", nshape);
- strcat(macrobuf, tbuf);
- /* set new shape value */
- nshape += (ns-1);
-
- /* return macro value */
- return(macrobuf);
- }
- else{
- return NULL;
- }
-}
-
-/*
- *
- * _FiltLexNeedOp -- determine if we add a connecting operator for this segment
- *
- */
-#ifdef YY_USE_PROTOS
-static int
-_FiltLexNeedOp(int i, char *s)
-#else
-static int _FiltLexNeedOp(i, s)
- int i;
- char *s;
-#endif
-{
- int c;
- /* check for operator in current string */
- if( s && *s ){
- c = *s;
- switch(c){
- case '&':
- case '|':
- case '=':
- case '!':
- case '<':
- case '>':
- return 0;
- default:
- break;
- }
- }
- /* not in this string check for operator in previous */
- for(i=i-1; i>=0; i--){
- if( !filtseg[i] || !filtseg[i]->s ) continue;
- if( strcmp(filtseg[i]->s, "(") && strcmp(filtseg[i]->s, ")") )
- break;
- }
- if( i >= 0 ){
- c = filtseg[i]->s[strlen(filtseg[i]->s)-1];
- switch(c){
- case '&':
- case '|':
- case '=':
- case '!':
- case '<':
- case '>':
- return 0;
- default:
- return 1;
- }
- }
- else{
- return 0;
- }
-}
-
-/*
- *
- * _FiltLexMake -- generate filter from filter segments
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexMake(void)
-#else
-static void _FiltLexMake()
-#endif
-{
- int i, j, k, l;
- int x, xtot;
- int type=0;
- int ltype=0;
- int opar=0;
- char *s;
-
- /* debugging */
- if( filt->debug ){
- for(i=0; i<nfiltseg; i++){
- if( filtseg[i]->s )
- fprintf(stderr, "unsorted #%d %s\n", filtseg[i]->n, filtseg[i]->s);
- else
- fprintf(stderr, "unsorted #%d %d is empty\n", i, filtseg[i]->n);
- }
- }
- /* look for bad region expressions and determine how many regions we have */
- for(i=0, j=0, k=0, l=0; i<nfiltseg; i++){
- if( !filtseg[i] || !filtseg[i]->s ) continue;
- type = filtseg[i]->type;
- /* make sure we want the type being offered */
- if( !_FiltLexTypeMatch(filt->type, type) ){
- _filterror("column filters not permitted in an image filter expression");
- }
- /* look for bad combinations */
- if( (type & TOK_NREG) && !(type & TOK_IREG) )
- _filterror("!region must be combined with another region (e.g., field()&&!region)");
- if( (type & TOK_EREG) && (type & TOK_IREG) )
- _filterror("-region must not be combined with another region (use !region instead)");
- if( (type & TOK_EREG) && (type & TOK_NAME) )
- _filterror("-region must not be combined with filters (use !region instead)");
- if( (type & TOK_EREG) && (type & TOK_RLIST) )
- _filterror("-region must not be combined with range lists (use !region instead)");
- if( (type & TOK_EREG) && (type & TOK_RTINE) )
- _filterror("-region must not be combined with routines (use !region instead)");
- /* count region types */
- if( filtseg[i]->type & TOK_IREG ) j++;
- if( filtseg[i]->type & TOK_NREG ) k++;
- if( filtseg[i]->type & TOK_EREG ) l++;
- }
- /* check for fits image mask and process specially */
- if( filt->masks ){
- /* can't have fits mask and ascii regions */
- if( j || k || l ){
- _filterror("FITS image masks cannot be combined with ASCII regions");
- }
- /* image filtering of events uses a imagemask special routine */
- if( (filt->type == TYPE_EVENTS) && filt->evsect ){
- strcpy(yytext, "imagemask");
- _FiltLexRegionStart(1);
- _FiltLexRegionEnd();
- }
- else{
- __FiltLexCat("imagemask", &filter, &filtlen);
- nregion = filt->nmaskreg;
- return;
- }
- }
- /* if we have only exclude regions, add field */
- if( !j && !k && l ){
- strcpy(yytext, "field");
- if( filt->type == TYPE_EVENTS )
- _FiltLexRegionStart(1);
- else
- _FiltLexRegionStart(0);
- _FiltLexRegionEnd();
- }
-
- /* reset region and shape counts */
- nregion=0;
- nshape=0;
-
- /* expand macro before reordering, to maintain region numbers in sequence */
- for(i=0; i<nfiltseg; i++){
- if( filtseg[i] && filtseg[i]->s ){
- if( _FiltLexNeedOp(i, NULL) ) inexpr=0;
- macropass=0;
- s = ExpandMacro(filtseg[i]->s, NULL, NULL, 0, _FiltLexCB, filtseg[i]);
- xfree(filtseg[i]->s);
- filtseg[i]->s = s;
- }
- }
-
- /* we want descending order so that eregions are last in the expression */
- qsort(filtseg, nfiltseg, sizeof(FiltSeg), _FiltLexTypeCmp);
-
- if( filt->debug ){
- for(i=0; i<nfiltseg; i++){
- if( filtseg[i]->s )
- fprintf(stderr, "sorted #%d %s\n", filtseg[i]->n, filtseg[i]->s);
- else
- fprintf(stderr, "sorted #%d %d is empty\n", i, filtseg[i]->n);
- }
- }
-
- /* add open paren and mark that we did it */
- __FiltLexCat("(", &filter, &filtlen);
- opar = 1;
-
- /* run through segments, inserting proper boolean connectors */
- ltype = 0;
- for(i=0; i<nfiltseg; ){
- if( filtseg[i] && filtseg[i]->s ){
- /* no type probably means its a paren, so just add it and jump out */
- if( !filtseg[i]->type ){
- __FiltLexCat(filtseg[i]->s, &filter, &filtlen);
- /* remove empty parens, if we just make them */
- x = strlen(filter);
- if( (filter[x-2] == '(') && (filter[x-1] == ')') )
- filter[x-2] = '\0';
- i++;
- continue;
- }
- type = filtseg[i]->type;
- if( _FiltLexNeedOp(i, NULL) ) inexpr=0;
- macropass=1;
- s = ExpandMacro(filtseg[i]->s, NULL, NULL, 0, _FiltLexCB, filtseg[i]);
- if( _FiltLexNeedOp(i, s) ){
- /* remove trailing open parens from prev. segment (add back later) */
- for(xtot=0, x=strlen(filter)-1; x>=0; x--){
- if( filter[x] != '(' ) break;
- filter[x] = '\0';
- xtot++;
- }
- if( (ltype & TOK_IREG) && (type & TOK_IREG) ){
- __FiltLexCat("||", &filter, &filtlen);
- }
- else if( (ltype & TOK_IREG) && (type & TOK_EREG) ){
- if( opar > 0 ){
- __FiltLexCat(")", &filter, &filtlen);
- opar--;
- }
- if( filt->paint ){
- if( opar > 0 ){
- __FiltLexCat(")", &filter, &filtlen);
- opar --;
- }
- __FiltLexCat("||", &filter, &filtlen);
- }
- else{
- __FiltLexCat("&&", &filter, &filtlen);
- }
- __FiltLexCat("(", &filter, &filtlen);
- opar++;
- }
- else if( (ltype & TOK_EREG) && (type & TOK_EREG) ){
- __FiltLexCat("&&", &filter, &filtlen);
- }
- else if( (ltype & TOK_EREG) && (type & TOK_IREG) ){
- if( filt->paint && (opar > 0) ){
- __FiltLexCat(")", &filter, &filtlen);
- opar --;
- }
- __FiltLexCat("&&", &filter, &filtlen);
- __FiltLexCat("(", &filter, &filtlen);
- opar ++;
- if( filt->paint ){
- __FiltLexCat("(", &filter, &filtlen);
- opar++;
- }
- }
- /* otherwise implied operator is AND */
- else{
- __FiltLexCat("&&", &filter, &filtlen);
- }
- /* add back parens */
- for(x=0; x<xtot; x++){
- __FiltLexCat("(", &filter, &filtlen);
- }
- }
- else{
- if( filt->paint && (i==0) ){
- __FiltLexCat("((", &filter, &filtlen);
- opar +=2;
- }
- }
- __FiltLexCat(s, &filter, &filtlen);
- if( s ) xfree(s);
- if( filtseg[i]->radang ){
- if( *filtseg[i]->radang == ',' )
- __FiltLexCat(filtseg[i]->radang+1, &radang, &radanglen);
- else
- __FiltLexCat(filtseg[i]->radang, &radang, &radanglen);
- }
- else{
- __FiltLexCat("NA,NA,NA,NA\n", &radang, &radanglen);
- }
- i++;
- for(; (i<nfiltseg) && (filtseg[i]->type==type); ){
- if( _FiltLexNeedOp(i, NULL) ) inexpr=0;
- s = ExpandMacro(filtseg[i]->s, NULL, NULL, 0, _FiltLexCB, filtseg[i]);
- if( _FiltLexNeedOp(i, s) ){
- for(xtot=0, x=strlen(filter)-1; x>=0; x--){
- if( filter[x] != '(' ) break;
- filter[x] = '\0';
- xtot++;
- }
- /* if lhs and rhs are regions, implied operator is OR */
- if( type & TOK_IREG )
- __FiltLexCat("||", &filter, &filtlen);
- /* otherwise implied operator is AND */
- else
- __FiltLexCat("&&", &filter, &filtlen);
- for(x=0; x<xtot; x++){
- __FiltLexCat("(", &filter, &filtlen);
- }
- }
- __FiltLexCat(s, &filter, &filtlen);
- if( s ) xfree(s);
- if( filtseg[i]->radang ){
- if( *filtseg[i]->radang == ',' )
- __FiltLexCat(filtseg[i]->radang+1, &radang, &radanglen);
- else
- __FiltLexCat(filtseg[i]->radang, &radang, &radanglen);
- }
- else{
- __FiltLexCat("NA,NA,NA,NA\n", &radang, &radanglen);
- }
- i++;
- }
- }
- /* ignore invalid arguments */
- else{
- i++;
- }
- /* save last type */
- ltype = type;
- }
-
- /* if last segment was an exclude and we are in paint mode, ignore it */
- if( filt->paint && (ltype & TOK_EREG) ){
- __FiltLexCat("&&0", &filter, &filtlen);
- }
-
- /* close off open parens (lots could be needed in paint mode) */
- while( opar-- ){
- __FiltLexCat(")", &filter, &filtlen);
- }
-
- /* check for even number of parens */
- l = strlen(filter);
- for(i=0, j=0; i<l; i++){
- if( filter[i] == '(' ) j++;
- if( filter[i] == ')' ) j--;
- }
- if( j != 0 ){
- if( filt->debug ) fprintf(stderr, "paren error %d: %s\n", j, filter);
- _filterror("unbalanced parentheses");
- }
- if( filt->debug ) fprintf(stderr, "filter: %s\n", filter);
-}
-
-/*
- *
- * _FiltLexEnd -- cleanup from parsing regions
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexEnd(void)
-#else
-static void _FiltLexEnd()
-#endif
-{
- int i;
-
- /* reset state variables */
- colargs = 0;
- initbindefs = 0;
- include_stack_ptr = 0;
- nroutine = 0;
- nshape = 0;
- nmask = 0;
- nparen = 0;
- parse_error = 0;
- filtlen = 0;
- radanglen = 0;
- regid = 0;
- regtype = 0;
- inexpr = 0;
- *regname = '\0';
- *saveang = 0;
- *(wcsnames[0]) = '\0';
- *(wcsnames[1]) = '\0';
- binsiz[0] = 1;
- binsiz[1] = 1;
- /* free up previous filter */
- if( filter ){
- xfree(filter);
- filter = NULL;
- }
- /* free up previous radang string */
- if( radang ){
- xfree(radang);
- radang = NULL;
- }
- /* free up wcs */
- if( wcs ){
- wcsfree (wcs);
- wcs = NULL;
- }
- /* no segments */
- if( filtseg ){
- for(i=0; i<nfiltseg; i++){
- if( filtseg[i] ){
- if( filtseg[i]->s ) xfree(filtseg[i]->s);
- if( filtseg[i]->regions ) xfree(filtseg[i]->regions);
- if( filtseg[i]->shapes ) xfree(filtseg[i]->shapes);
- if( filtseg[i]->radang ) xfree(filtseg[i]->radang);
- xfree(filtseg[i]);
- }
- }
- xfree(filtseg);
- filtseg = NULL;
- }
- maxfiltseg = 0;
- nfiltseg = 0;
- if( gcoordsys ){
- xfree(gcoordsys);
- gcoordsys = NULL;
- }
- if( fcoordsys ){
- xfree(fcoordsys);
- fcoordsys = NULL;
- }
- cdelt1 = 0.0;
- cdelt2 = 0.0;
- crot = 0.0;
-}
-
-/*
- *
- * _FiltLexGetWcs -- determine the WCS coord system to use for wcsc translation
- *
- */
-#ifdef YY_USE_PROTOS
-static char *
-_FiltLexGetWcs(void)
-#else
-static char *_FiltLexGetWcs()
-#endif
-{
- if( gcoordsys &&
- strcmp(gcoordsys, "image") && strcmp(gcoordsys, "physical") )
- return gcoordsys;
- if( fcoordsys &&
- strcmp(fcoordsys, "image") && strcmp(fcoordsys, "physical") )
- return fcoordsys;
- return NULL;
-}
-
-/*
- *
- * _FiltLexWcsCols -- reset WCS for these columns
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexWcsCols(FITSHead iheader, char *name0, char *name1)
-#else
-static void _FiltLexWcsCols(iheader, name0, name1)
- FITSHead iheader;
- char *name0;
- char *name1;
-#endif
-{
- int i, which, ival;
- int simple=1;
- double dval, dval2;
- char *s;
- FITSHead oheader;
- FITSCard card;
-
- /* make sure we have something to process */
- if( !iheader )
- return;
-
- if( filt->fhd->image ){
- /* free up old wcs */
- if( wcs ) wcsfree (wcs);
- /* init new wcs */
- hlength(ft_cards(filt->fhd),0);
- wcs = wcsinit(ft_cards(filt->fhd));
- tltyp[0] = 0;
- tltyp[1] = 0;
- }
- /* for tables, we can init wcs only the specified columns */
- else if( name0 && *name0 && name1 && *name1 ){
- /* see if these are the same as the last set of columns */
- if( (*(wcsnames[0]) && !strcasecmp(name0,wcsnames[0])) &&
- (*(wcsnames[1]) && !strcasecmp(name1,wcsnames[1])) && wcs ){
- return;
- }
-
- /* gather up important tl info about the binning columns */
- for(i=1; i<=iheader->table->tfields; i++){
- /* determine which bincol we are processing */
- if( !strcasecmp(iheader->table->col[i-1].name, name0) )
- which = 0;
- else if( !strcasecmp(iheader->table->col[i-1].name, name1) )
- which = 1;
- else
- continue;
- /* set tlinfo values for this column */
- tlmin[which] = ft_headgetr(iheader, "TLMIN", i, 1.0, &card);
- tlmax[which] = ft_headgetr(iheader, "TLMAX", i, 1.0, &card);
- binsiz[which] = ft_headgetr(iheader, "TDBIN", i, 1.0, &card);
- tltyp[which] = iheader->table->col[i-1].type;
- }
-
- /* free up old wcs */
- if( wcs ) wcsfree (wcs);
- /* make a copy of the header */
- oheader = ft_headcopy(iheader);
-
- /* make sure this is a primary FITS file */
- ft_cardfmt((FITSCard)oheader->cards,
- "SIMPLE", 0, FT_LOGICAL, &simple, 0, "Standard FITS");
- /* set dimension info, used by wcs code */
- ft_headseti(oheader, "NAXIS", 0, 2, "number of axes", 1);
- /* set dimension info */
- for(i=0; i<=1; i++){
- ival = (int)tldim(tlmin[i], tlmax[i], binsiz[i], tltyp[i]);
- ft_headseti(oheader, "NAXIS", i+1, ival, "axis dimension", 1);
- }
- /* set bitpix */
- ft_headseti(oheader, "BITPIX", 0, 32, "bits/pixel", 1);
- /* synchronize the header and the cards after any changes */
- ft_syncdata(oheader);
-
- /* transform WCS cards for the specified columns, if we have such */
- for(i=1; i<=iheader->table->tfields; i++){
- /* determine which bincol we are processing */
- if( !strcasecmp(iheader->table->col[i-1].name, name0) )
- which = 0;
- else if( !strcasecmp(iheader->table->col[i-1].name, name1) )
- which = 1;
- else
- continue;
- /* convert event wcs header info image wcs info */
- if( (s=ft_headgets(iheader, "TCTYP", i, NULL, &card)) && card ){
- ft_headapps(oheader, "CTYPE", which+1, s, NULL);
- xfree(s);
- }
- if( (s=ft_headgets(iheader, "TCRVL", i, NULL, &card)) && card ){
- ft_headappv(oheader, "CRVAL", which+1, s, NULL);
- xfree(s);
- }
- if( (s=ft_headgets(iheader, "TCDLT", i, NULL, &card)) && card ){
- ft_headappv(oheader, "CDELT", which+1, s, NULL);
- xfree(s);
- }
- if( (s=ft_headgets(iheader, "TCROT", i, NULL, &card)) && card ){
- ft_headappv(oheader, "CROTA", which+1, s, NULL);
- xfree(s);
- }
- /* this value gets converted from physical to image */
- if( (dval=ft_headgetr(iheader, "TCRPX", i, 0.0, &card)) && card ){
- dval2 = tlp2i(dval, tlmin[which], binsiz[which], tltyp[which]);
- ft_headsetr(oheader, "CRPIX", which+1, dval2, 7, NULL, 1);
- }
- }
-
- /* init new wcs */
- hlength(ft_cards(oheader),0);
- wcs = wcsinit(ft_cards(oheader));
- ft_headfree(oheader, 1);
- /* save names for next time */
- strcpy(wcsnames[0], name0);
- strcpy(wcsnames[1], name1);
- }
-
- /* set some extra wcs parameters */
- if( wcs && iswcs(wcs) ){
- if( fcoordsys ) xfree(fcoordsys);
- fcoordsys = xstrdup(wcs->radecin);
- culc(fcoordsys);
- if( !wcs->coorflip ){
- cdelt1 = wcs->cdelt[0];
- cdelt2 = wcs->cdelt[1];
- }
- else{
- cdelt1 = wcs->cdelt[1];
- cdelt2 = wcs->cdelt[0];
- }
- if ( wcs->imflip ) {
- crot = -wcs->rot;
- } else {
- crot = wcs->rot;
- }
- }
- else{
- cdelt1 = 0.0;
- cdelt2 = 0.0;
- crot = 0.0;
- }
- /* set global coord system first time through */
- if( !gcoordsys ){
- if( (gcoordsys=xstrdup(getenv("COORDSYS"))) == NULL )
- gcoordsys = xstrdup(DEFAULT_COORDSYS);
- }
-}
-
-/*
- *
- * _FiltLexLcx -- determine if we have a linear-type WCS
- *
- */
-#ifdef YY_USE_PROTOS
-static int
-_FiltLexLcx(void)
-#else
-static int _FiltLexLcx()
-#endif
-{
- char *coordsys;
- coordsys = gcoordsys;
- if( !coordsys || !*coordsys )
- return 0;
- if( !strcasecmp(coordsys, "image") ) return LCX_IMAGE;
- if( !strcasecmp(coordsys, "physical") ) return LCX_PHYS;
- if( !strcasecmp(coordsys, "amplifier") ) return LCX_AMP;
- if( !strcasecmp(coordsys, "detector") ) return LCX_DET;
- return 0;
-}
-
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexNum(int lcx)
-#else
-static void _FiltLexNum(lcx)
- int lcx;
-#endif
-{
- char tbuf[SZ_LINE];
-
- /* process binary number, if necessary */
- bin2num(tbuf, yytext, SZ_LINE);
-
- /* for linear coordinate systems (physical, amps, etc.),
- we have to convert to image coords or physical coords,
- depending on the type of data and type of filtering */
- if( lcx ){
- /* data is in a table: we can use image or physical coords */
- if( filt->fhd->table ){
- /* if we want to use physical coordinates ... */
- if( USEPHYS ){
- /* convert image positions to physical coords */
- if( lcx == LCX_IMAGE ){
- if( POSARG ){
- dval = tli2p(strtod(tbuf,NULL),
- tlmin[(narg+1)%2], binsiz[(narg+1)%2], tltyp[(narg+1)%2]);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- /* angle arguments are just passed along */
- else if( ANGARG ){
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- /* panda numeric args are just passed along */
- else if( NUMARG ){
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* size arguments have to be converted using the binsize */
- else{
- if( SAVEANG ){
- dval = strtod(tbuf,NULL);
- snprintf(saveang, SZ_LINE, DFMT1, dval);
- }
- dval = strtod(tbuf,NULL) * binsiz[(narg+1)%2];
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- }
- /* already in physical -- just pass along args */
- else{
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- }
- /* we are using image coords (image-style filtering) */
- else{
- /* convert non-image positions to image coords */
- if( lcx != LCX_IMAGE ){
- if( POSARG ){
- dval = tlp2i(strtod(tbuf,NULL),
- tlmin[(narg+1)%2], binsiz[(narg+1)%2], tltyp[(narg+1)%2]);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- /* angle arguments are just passed along */
- else if( ANGARG ){
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- /* panda numeric args are just passed along */
- else if( NUMARG ){
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* size arguments have to be converted using the binsize */
- else{
- if( SAVEANG ){
- dval = strtod(tbuf,NULL);
- snprintf(saveang, SZ_LINE, DFMT1, dval);
- }
- dval = strtod(tbuf,NULL) / binsiz[(narg+1)%2];
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- }
- /* already in image -- just pass along args */
- else{
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- }
- }
- /* data is in an image: we use image coords */
- else{
- /* convert positional arguments to image */
- if( POSARG ){
- /* save x value for processing with y next time */
- if( XARG ){
- xpos = SAOstrtod(tbuf,NULL);
- }
- else{
- ypos = SAOstrtod(tbuf,NULL);
- switch(lcx){
- case LCX_IMAGE:
- xpix = xpos;
- ypix = ypos;
- break;
- case LCX_PHYS:
- ft_phy2img(filt->fhd, xpos, ypos, &xpix, &ypix);
- break;
- case LCX_AMP:
- ft_amp2phy(filt->fhd, xpos, ypos, &dval, &dval2);
- ft_phy2img(filt->fhd, dval, dval2, &xpix, &ypix);
- break;
- case LCX_DET:
- ft_det2phy(filt->fhd, xpos, ypos, &dval, &dval2);
- ft_phy2img(filt->fhd, dval, dval2, &xpix, &ypix);
- break;
- }
- snprintf(sbuf, SZ_LINE, DFMT2, xpix, ypix);
- _FiltLexCat(sbuf);
- }
- }
- /* angle arguments are just passed along, with updated crot */
- else if( ANGARG ){
- dval = strtod(tbuf,NULL);
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* panda numeric args are just passed along */
- else if( NUMARG ){
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* convert size args, which may or may not be in pairs */
- else{
- if( SAVEANG ){
- dval = strtod(tbuf,NULL);
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(saveang, SZ_LINE, DFMT1, dval);
- }
- /* arg 1 is associated with ra, arg2 with dec */
- if( XARG ){
- xpos = ABS(strtod(tbuf,NULL));
- ypos = 0.0;
- switch(lcx){
- case LCX_IMAGE:
- xpix = xpos;
- break;
- case LCX_PHYS:
- ft_phy2img_size(filt->fhd, xpos, ypos, &xpix, &ypix);
- break;
- case LCX_AMP:
- ft_amp2phy_size(filt->fhd, xpos,ypos, &dval,&dval2);
- ft_phy2img_size(filt->fhd, dval,dval2, &xpix,&ypix);
- break;
- case LCX_DET:
- ft_det2phy_size(filt->fhd, xpos,ypos, &dval,&dval2);
- ft_phy2img_size(filt->fhd, dval,dval2, &xpix,&ypix);
- break;
- }
- snprintf(sbuf, SZ_LINE, DFMT1, xpix);
- _FiltLexArgSave(xpix);
- }
- else{
- xpos = 0.0;
- ypos = ABS(strtod(tbuf,NULL));
- switch(lcx){
- case LCX_IMAGE:
- ypix = ypos;
- break;
- case LCX_PHYS:
- ft_phy2img_size(filt->fhd, xpos, ypos, &xpix, &ypix);
- break;
- case LCX_AMP:
- ft_amp2phy_size(filt->fhd, xpos,ypos, &dval,&dval2);
- ft_phy2img_size(filt->fhd, dval,dval2, &xpix,&ypix);
- break;
- case LCX_DET:
- ft_det2phy_size(filt->fhd, xpos,ypos, &dval,&dval2);
- ft_phy2img_size(filt->fhd, dval,dval2, &xpix,&ypix);
- break;
- }
- snprintf(sbuf, SZ_LINE, DFMT1, ypix);
- _FiltLexArgSave(ypix);
- }
- _FiltLexCat(sbuf);
- }
- }
- }
- /* not lcx -- angle arguments are just passed along with updated crot */
- else if( ANGARG ){
- dval = strtod(tbuf,NULL);
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* panda numeric args are just passed along */
- else if( NUMARG ){
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* not lcx -- everything else is assumed to be in units of "degrees"
- in the default system. add 'd' and put back for reparsing */
- else{
- int i;
- char *yycopy = xstrdup(tbuf);
- unput('d');
- for(i=yyleng-1; i>=0; --i)
- unput(yycopy[i]);
- xfree(yycopy);
- narg--;
- }
-}
-
-#ifdef YY_USE_PROTOS
-static int
-_FiltIncMask(FilterMask masks, int maxmask, int nmask)
-#else
-static int _FiltIncMask(masks, maxmask, nmask)
- FilterMask masks;
- int maxmask;
- int nmask;
-#endif
-{
- int omax;
- nmask++;
- if( nmask >= maxmask ){
- omax = maxmask;
- maxmask += MASKINC;
- masks = (FilterMask)xrealloc(masks, maxmask*sizeof(FilterMaskRec));
- memset(masks+omax, 0, (maxmask-omax)*sizeof(FilterMaskRec));
- }
- return nmask;
-}
-
-#ifdef YY_USE_PROTOS
-static int
-_FiltFitsMask(char *filename, FilterMask *rmasks, FITSHead *rhead, int *nreg)
-#else
-static int _FiltFitsMask(filename, rmasks, rhead, nreg)
- char *filename;
- FilterMask *rmasks;
- FITSHead *rhead;
- int *nreg;
-#endif
-{
- short *dptr;
- short *data=NULL;
- int x, y;
- int maxreg=-1;
- int maxmask; /* max masks allocated thus far */
- int nmask=0; /* number of mask segments */
- FilterMask masks=NULL; /* array valid region masks for one row */
- FITSHead head=NULL;
-
- /* read fits image */
- if( !ft_simpleimageread(filename, &head, (void *)&data, NULL, 16) ){
- return(-1);
- }
- if( !head->image ){
- if( data ) xfree(data);
- if( head ) ft_headfree(head, 1);
- return(-2);
- }
- if( !ft_naxes(head) || !ft_naxis(head, 1) || !ft_naxis(head, 2) ){
- if( data ) xfree(data);
- if( head ) ft_headfree(head, 1);
- return(-3);
- }
-
- /* allocate an array of masks, which will be returned to caller */
- maxmask = MASKINC;
- masks = (FilterMask)xcalloc(maxmask, sizeof(FilterMaskRec));
- /* seed the first region mask value */
- masks[nmask].region = 0;
- /* loop through y rows */
- for(y=1; y<=ft_naxis(head, 2); y++){
- dptr = data + ((y-1) * ft_naxis(head, 1));
- /* to start this line, we make a seed mask with no region */
- if( masks[nmask].region ){
- nmask = _FiltIncMask(masks, maxmask, nmask);
- masks[nmask].region = 0;
- }
- /* process each pixel in the row */
- for(x=1; x<=ft_naxis(head, 1); x++, dptr++){
- /* we do not allow negative values */
- if( *dptr < 0 ){
- if( data ) xfree(data);
- if( head ) ft_headfree(head, 1);
- if( masks ) xfree(masks);
- return(-4);
- }
- /* set max region as needed */
- if( *dptr > maxreg )
- maxreg = *dptr;
- /* look for a change in the mask */
- if( *dptr != masks[nmask].region ){
- /* if previous was non-zero region, finish it and bump to next */
- if( masks[nmask].region ){
- masks[nmask].xstop = x - 1;
- nmask = _FiltIncMask(masks, maxmask, nmask);
- }
- masks[nmask].y = y;
- masks[nmask].region = *dptr;
- masks[nmask].xstart = x;
- }
- }
- /* finish last non-zero segment, inc number of mask segs */
- if( masks[nmask].region ){
- masks[nmask].xstop = x;
- nmask = _FiltIncMask(masks, maxmask, nmask);
- }
- }
-
- /* free up data space */
- if( data ) xfree(data);
- /* allocate just enough mask space */
- masks = (FilterMask)xrealloc(masks, nmask*sizeof(FilterMaskRec));
- if( rmasks )
- *rmasks = masks;
- else
- xfree(masks);
- if( rhead )
- *rhead = head;
- else
- ft_headfree(head, 1);
- if( nreg )
- *nreg = maxreg;
-
- return(nmask);
-}
-
-/*
- *
- * Semi-public Routines
- *
- *
- */
-
-/*
- *
- * _FilterString -- return output filter from lexer
- *
- */
-#ifdef YY_USE_PROTOS
-char *
-_FilterString(void)
-#else
-char *_FilterString()
-#endif
-{
- if( filtlen <= 0 )
- _FiltLexMake();
- return(filter);
-}
-
-#ifdef YY_USE_PROTOS
-int
-FilterRoutineCount(void)
-#else
-int FilterRoutineCount()
-#endif
-{
- return(nroutine);
-}
-
-#ifdef YY_USE_PROTOS
-int
-FilterShapeCount(void)
-#else
-int FilterShapeCount()
-#endif
-{
- return(nshape);
-}
-
-#ifdef YY_USE_PROTOS
-int
-FilterRegionCount(int type)
-#else
-int FilterRegionCount(type)
- int type;
-#endif
-{
- int i, j;
-
- /* handle fits image masks specially */
- if( nmask ){
- if( type & TOK_IREG )
- return(nregion);
- else
- return(0);
- }
-
- /* normal regions */
- for(i=0, j=0; i<nfiltseg; i++){
- if( filtseg[i]->type & type ){
- j += filtseg[i]->nregion;
- }
- }
- return(j);
-}
-
-#ifdef YY_USE_PROTOS
-char *
-FilterRadAng(void)
-#else
-char *FilterRadAng()
-#endif
-{
- return(radang);
-}
-
-#ifdef YY_USE_PROTOS
-int
-FilterParseError(void)
-#else
-int FilterParseError()
-#endif
-{
- return(parse_error);
-}
-
-#ifdef YY_USE_PROTOS
-int
-FilterTlInfo(double *tlmins, double *binsizs, int *tltyps)
-#else
-int FilterTlInfo(tlmins, binsizs, tltyps)
- double *tlmins;
- double *binsizs;
- int *tltyps;
-#endif
-{
- tlmins[0] = tlmin[0];
- tlmins[1] = tlmin[1];
- binsizs[0] = binsiz[0];
- binsizs[1] = binsiz[1];
- tltyps[0] = tltyp[0];
- tltyps[1] = tltyp[1];
- return 1;
-}
-
-#ifdef YY_USE_PROTOS
-void
-FiltInitParser(void)
-#else
-void FiltInitParser()
-#endif
-{
- static int parser = 0;
- /* make sure we free'd up all space from last time */
- _FiltLexEnd();
- /* set up some convenience variables */
- filt = FilterDefault();
-/*
- if( parser )
- yyrestart(NULL);
-*/
- BEGIN INITIAL;
- parser++;
- laststart=INITIAL;
-}
-
-#ifdef YY_USE_PROTOS
-void
-FiltScanString(char *s)
-#else
-void FiltScanString(s)
- char *s;
-#endif
-{
- int i;
- char *t;
- /* make sure there is an explicit delim at end so we are done before
- lex finds EOF -- otherwise panda shapes don't get processed */
- i = strlen(s);
- t = xmalloc(i+2);
- strcpy(t, s);
- if( (t[i-1] != ';') && (t[i-1] != '\n') )
- strcat(t, "\n");
- yy_scan_string(t);
- if( t ) xfree(t);
-}
-
-/* yyerror -- renamed to _filterror because flex -P does not change this */
-#ifdef YY_USE_PROTOS
-int
-_filterror(char *msg)
-#else
-int _filterror(msg)
- char *msg;
-#endif
-{
- if( *yytext )
- gerror(stderr, "%s while parsing filter at: %s\n",
- msg ? msg : "filterr", yytext);
- else
- gerror(stderr, "%s\n", msg ? msg : "filterr");
- YY_FLUSH_BUFFER;
- parse_error = 1;
- yyterminate();
-}
-
-#ifdef YY_USE_PROTOS
-int yywrap(void)
-#else
-int yywrap()
-#endif
-{
- return 1;
-}
diff --git a/funtools/filter/filter.c b/funtools/filter/filter.c
deleted file mode 100644
index 78d5383..0000000
--- a/funtools/filter/filter.c
+++ /dev/null
@@ -1,1041 +0,0 @@
-/*
- * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory
- */
-
-/*
- *
- * filter.c -- hi-level management of filters
- *
- */
-
-#include <filter.h>
-
-#if HAVE_CYGWIN||HAVE_MINGW32
-#include <windows.h>
-#endif
-
-extern int idx_debug;
-
-/*
- *
- * private routines
- *
- */
-
-/* this is needed by lex */
-static Filter default_filter = NULL;
-
-/* null filters return this special record */
-static FilterRec null_filter;
-
-#ifdef ANSI_FUNC
-static void
-FiltInitRegions(void)
-#else
-static void FiltInitRegions()
-#endif
-{
- initevregions();
- initimregions();
-}
-
-/*
- *
- * _FilterImageCmp -- compare routine for qsort
- *
- */
-#ifdef ANSI_FUNC
-static int
-_FilterImageCmp(const void *s1, const void *s2)
-#else
-static int _FilterImageCmp(s1, s2)
- const void *s1;
- const void *s2;
-#endif
-{
- FilterMask f1 = (FilterMask)s1;
- FilterMask f2 = (FilterMask)s2;
-
- if( f1->y < f2->y ){
- return -1;
- }
- else if( f1->y > f2->y ){
- return 1;
- }
- else{
- if( f1->xstart < f2->xstart ){
- return -1;
- }
- else{
- return 1;
- }
- }
-}
-
-/*
- *
- * semi-public routines, used by other modules
- *
- */
-
-/*
- *
- * public routines
- *
- */
-
-/*
- *
- * FilterClip -- save the filter without the enclosing brackets
- *
- */
-#ifdef ANSI_FUNC
-char *
-FilterClip(char *filter)
-#else
-char *FilterClip(filter)
- char *filter;
-#endif
-{
- char *tbuf;
- char *tptr;
- char *ofilter;
- int len;
- int i;
-
- /* check for the obvious */
- if( !filter || (*filter == '\0') )
- return(NULL);
-
- /* save filter, but without the enclosing brackets */
- tbuf = xstrdup(filter);
- nowhite(tbuf, tbuf);
- tptr = tbuf;
- if( *tbuf == '[' ){
- tptr++;
- len = strlen(tptr);
- for(i=len-1; i>=0; i-- ){
- if( tptr[i] == ']' ){
- tptr[i] = '\0';
- break;
- }
- }
- }
- if( tptr && (*tptr != '\0') ){
- /* we extend the buffer because flex has problems in filt_init_buffer
- if its smaller than sizeof(FILE *) */
- ofilter = xcalloc(strlen(tptr)+SZ_LINE, sizeof(char));
- nowhite(tptr, ofilter);
- }
- else{
- ofilter = NULL;
- }
- xfree(tbuf);
- return(ofilter);
-}
-
-/*
- *
- * FilterDefault -- get the default filter handle for the parser
- *
- */
-#ifdef ANSI_FUNC
-Filter
-FilterDefault(void)
-#else
-Filter FilterDefault()
-#endif
-{
- return(default_filter);
-}
-
-/*
- *
- * FilterNull -- get the null filter pointer
- *
- */
-#ifdef ANSI_FUNC
-Filter
-FilterNull(void)
-#else
-Filter FilterNull()
-#endif
-{
- return(&null_filter);
-}
-
-/*
- *
- * FilterNum -- get a unique number associated with an open filter
- *
- */
-static int filter_num=0;
-#ifdef ANSI_FUNC
-int
-FilterNum(void)
-#else
-int FilterNum()
-#endif
-{
- filter_num++;
- return(filter_num);
-}
-
-/*
- *
- * FilterPath -- get the path through which we look for things
- *
- */
-#ifdef ANSI_FUNC
-char *
-FilterPath(void)
-#else
-char *FilterPath()
-#endif
-{
- static char *filter_path=NULL;
- if( filter_path == NULL ){
- filter_path = (char *)getenv("PATH");
- }
- return(filter_path);
-}
-
-/*
- *
- * FilterOpen -- open a filter and initialize the symbol table
- *
- */
-#ifdef ANSI_FUNC
-Filter
-FilterOpen(FITSHead header, char *string, char *mode)
-#else
-Filter FilterOpen(header, string, mode)
- FITSHead header; /* fitsy header struct */
- char *string; /* filter string */
- char *mode; /* "C", "f77", "awk", etc. */
-#endif
-{
- int lexonly=0;
- int got=0;
- char *s, *t;
- char tbuf[SZ_LINE];
- Filter filter;
- char *filtstr;
-
- /* return if we have no filter */
- if( (string == NULL) || (*string == '\0') ||
- !strcmp(string, "[]") || !strcmp(string, "\n") )
- return(NOFILTER);
-
- /* more checks for an essentially blank string */
- for(got=0, s=string; *s; s++){
- if( (*s != ' ') && (*s != '\t') && (*s != '\n') && (*s != ';') ){
- got++;
- break;
- }
- }
- if( !got )
- return(NOFILTER);
-
- /* allocate a new filter record */
- if( (filter = (Filter)xcalloc(1, sizeof(FilterRec))) == NULL )
- return(NULL);
-
- /* this is the default filter handle for the parser */
- default_filter = filter;
-
- /* clean up filter */
- s = FilterClip(string);
- /* if its not a file, use string directly */
- if( *s != '@' ){
- t = xstrdup(s);
- }
- /* if it a FITS file, use string directly */
- else if( IsFits(&(s[1])) ){
- t = xstrdup(s);
- }
- /* replace ASCII file with contents, if possible */
- else if( !(t = FileContents(&(s[1]), 0, NULL)) ){
- t = xstrdup(s);
- }
- /* set the input filter string for the parser */
- filter->string = FilterClip(t);
- if( s ) xfree(s);
- if( t ) xfree(t);
- /* return if we have no filter */
- if( !filter->string || (*filter->string == '\0') ){
- return(NOFILTER);
- }
-
- /* save mode */
- filter->mode=xstrdup(mode);
-
- /* assume we will use an index */
-#if HAVE_MINGW32==0
- filter->doidx = 1;
-#else
- filter->doidx = 0;
-#endif
-
- /* process the mode string */
- if( (s = xstrdup(filter->mode)) ){
- /* set global convert flag */
- if( keyword(s, "convert", tbuf, SZ_LINE) )
- filter->convert = istrue(tbuf);
- /* set the event section */
- if( keyword(s, "evsect", tbuf, SZ_LINE) )
- filter->evsect = xstrdup(tbuf);
- if( keyword(s, "lexonly", tbuf, SZ_LINE) )
- lexonly = 1;
-#if HAVE_MINGW32==0
- if( keyword(s, "idx", tbuf, SZ_LINE) ){
- if( istrue(tbuf) )
- filter->doidx = 1;
- else if( isfalse(tbuf) )
- filter->doidx = -1;
- }
-#endif
- }
- if( s ) xfree(s);
-
- /* determine which method of filter processing we will use:
- currently we support only the C method */
- filter->method = DEFAULT_FILTER_METHOD;
- *tbuf = '\0';
- if( (s=(char *)getenv("FILTER_METHOD")) ){
- strcpy(tbuf, s);
- }
- if( !*tbuf && (s=xstrdup(filter->mode)) ){
- keyword(s, "method", tbuf, SZ_LINE);
- if( s ) xfree(s);
- }
- if( *tbuf ){
- if( !strcasecmp(tbuf, "c") )
- filter->method = METHOD_C;
- }
-
- /* determine which type of filtering we do: event or image */
- filter->type = DEFAULT_FILTER_TYPE;
- *tbuf = '\0';
- if( (s=(char *)getenv("FILTER_TYPE")) ){
- strcpy(tbuf, s);
- }
- if( !*tbuf && (s=xstrdup(filter->mode)) ){
- keyword(s, "type", tbuf, SZ_LINE);
- if( s ) xfree(s);
- }
- if( *tbuf ){
- if( !strncasecmp(tbuf, "ev", 2) )
- filter->type = TYPE_EVENTS;
- else if( !strncasecmp(tbuf, "im", 2) )
- filter->type = TYPE_IMAGE;
- }
-
- /* determine which type of process execution we do */
- switch(filter->method){
- case METHOD_C:
- filter->ptype = DEFAULT_FILTER_PTYPE;
- *tbuf = '\0';
- if( (s=(char *)getenv("FILTER_PTYPE")) ){
- strcpy(tbuf, s);
- }
- if( !*tbuf && (s=xstrdup(filter->mode)) ){
- keyword(s, "ptype", tbuf, SZ_LINE);
- if( s ) xfree(s);
- }
- if( *tbuf ){
- if( *tbuf == 'p' )
- filter->ptype = PTYPE_PROCESS;
- else if( *tbuf == 'c' )
- filter->ptype = PTYPE_CONTAINED;
-#ifdef USE_DL
- else if( *tbuf == 'd' )
- filter->ptype = PTYPE_DYNAMIC;
-#endif
- }
- break;
- default:
- filter->ptype = PTYPE_PROCESS;
- break;
- }
-
- /* determine region paint mode */
- *tbuf = '\0';
- if( (s=(char *)getenv("FILTER_PAINT")) ){
- strcpy(tbuf, s);
- }
- if( !*tbuf && (s=xstrdup(filter->mode)) ){
- keyword(s, "paint", tbuf, SZ_LINE);
- if( s ) xfree(s);
- }
- if( !*tbuf )
- strcpy(tbuf, DEFAULT_PAINT_MODE);
- if( *tbuf ){
- if( istrue(tbuf) )
- filter->paint = 1;
- else
- filter->paint = 0;
- }
-
- /* debugging mode */
- *tbuf = '\0';
- if( (s=(char *)getenv("FILTER_DEBUG")) ){
- strcpy(tbuf, s);
- }
- if( !*tbuf && (s=xstrdup(filter->mode)) ){
- keyword(s, "debug", tbuf, SZ_LINE);
- if( s ) xfree(s);
- }
- if( *tbuf ){
- if( isdigit((int)*tbuf) )
- filter->debug = atoi(tbuf);
- else if( istrue(tbuf) )
- filter->debug = 1;
- else if( isfalse(tbuf) )
- filter->debug = 0;
- }
-
- /* save the fits header */
- filter->fhd = header;
-
- /* init the symbol table */
- if( !FilterSymbolInit(filter) )
- goto error;
-
- /* init parser variables */
- FiltInitParser();
-
- /* init regions */
- FiltInitRegions();
-
- /* set up to parse the input filter */
- FiltScanString(filter->string);
-
- /* parse filter */
- filtlex();
-
- /* check for errors while parsing the string */
- if( FilterParseError() )
- goto error;
-
- /* make sure we have something to filter */
- if( !(filtstr = (char *)_FilterString()) || !strcmp(filtstr, "()") ){
- FilterClose(filter);
- return(NOFILTER);
- }
-
- /* imagemask processing of images does not use the compiled process */
- if( filter->nmask && filter->masks && (filter->type == TYPE_IMAGE) )
- goto done;
-
- /* for event filtering, we can use indexes */
-#if HAVE_MINGW32==0
- if( filter->type == TYPE_EVENTS ){
- /* run index grammar and see if we can get help from indexes */
- if( filter->doidx == 1 ){
- if( !idxinitparser(filtstr) ){
- filter->doidx = -1;
- }
- else{
- idxparse();
- idxfreeglobals();
- if( !filter->idx || (filter->idx->type == IDX_INDEF) ){
- if( filter->idx ){
- idxendparser();
- filter->idx = NULL;
- }
- filter->doidx = -1;
- }
- }
- }
- /* if we are using an index and we are only processing indexed columns,
- we don't need to use compiled filter */
- if( FILTER_INDEX_ONLY(filter) ){
- if( idx_debug ) fprintf(stderr, "idx: skipping compiled filter\n");
- goto done;
- }
- }
-#endif
-
- /* lexonly means we only wanted to run the lexer */
- if( lexonly )
- goto done;
-
- /* open the program file that we will compile from the filter */
- if( !FilterProgOpen(filter) )
- goto error;
-
- /* prepend the to C program as needed */
- if( !FilterProgPrepend(filter) )
- goto error;
-
- /* write the symbols to the appropriate program */
- if( !FilterProgWrite(filter) )
- goto error;
-
- /* append the program body to C program */
- if( !FilterProgAppend(filter) )
- goto error;
-
- /* that is all we need to output */
- if( !FilterProgClose(filter) )
- goto error;
-
- /* compile the filter program */
- if( !FilterProgCompile(filter) )
- goto error;
-
- if( filter->debug >= 2 ) goto done;
-
- switch(filter->method){
- case METHOD_C:
- switch(filter->ptype){
- case PTYPE_PROCESS:
- case PTYPE_CONTAINED:
- switch(filter->pipeos){
- case PIPE_WIN32:
-#if HAVE_CYGWIN||HAVE_MINGW32
- if( !WinProcessOpen(filter->prog,
- &(filter->ihandle), &(filter->ohandle), &(filter->process)) )
- goto error;
-#else
- gerror(stderr, "internal error: no WinProcess without Windows");
- goto error;
-#endif
- break;
- default:
- if( !ProcessOpen(filter->prog,
- &(filter->ichan), &(filter->ochan), &(filter->pid)) )
- goto error;
- break;
- }
- break;
-#ifdef USE_DL
- case PTYPE_DYNAMIC:
- if( !(filter->dl=DLOpen(filter->prog)) )
- goto error;
- break;
-#endif
- default:
- goto error;
- }
- break;
- default:
- goto error;
- }
-
- /* return the good news */
-done:
- return(filter);
-
-error:
- FilterClose(filter);
- return(NULL);
-
-}
-
-/*
- *
- * FilterEvents -- filter events by sending them to a co-process,
- * which returns a char array of good event flags
- *
- */
-#ifdef ANSI_FUNC
-int
-FilterEvents(Filter filter, char *ebuf, int esize, int n, int *vbuf)
-#else
-int FilterEvents(filter, ebuf, esize, n, vbuf)
- Filter filter;
- char *ebuf;
- int esize;
- int n;
- int *vbuf;
-#endif
-{
- int i;
- int flag;
- int get=0, got=0;
- int bytes;
- char *eptr;
- char *etop;
- char *obuf;
- char *optr;
-#ifdef USE_DL
- FilterTableCall evrtn;
-#endif
- FilterSymbols sp;
-
- /* make sure we have a valid filter and a valid table */
- if( !filter || (filter == NOFILTER) || !filter->fhd || !filter->fhd->table )
- return(0);
-
- /* handle fits image mask specially */
- if( filter->nmask && filter->masks && !filter->evsect ){
- gerror(stderr, "event filtering cannot use image masks\n");
- return(0);
- }
-
- /* if the index is enough, just return */
- if( FILTER_INDEX_ONLY(filter) )
- return 0;
-
- /* we only send the necessary parts of each event record */
- if( (obuf = (char *)xcalloc(n*filter->evsize, sizeof(char))) == NULL )
- return(0);
- optr = obuf;
-
- /* extract (and convert) the necessary columns of the event */
- for(eptr=ebuf, etop=ebuf+(n*esize); eptr<etop; eptr += esize){
- /* loop through the symbol table and process columns */
- for(i=0; i<filter->nsyms; i++){
- sp = &(filter->symtab[i]);
- /* skip accidentally empty ones */
- if( (sp->name == NULL) || (*sp->name == '\0') )
- continue;
- /* process this type of symbol */
- switch(sp->type){
- case SYM_COL:
- if( filter->fhd->table->col[sp->idx].type == 'X' ){
- ColumnLoad(eptr+filter->fhd->table->col[sp->idx].offset,
- filter->fhd->table->col[sp->idx].size,
- (filter->fhd->table->col[sp->idx].n+7)/8,
- filter->convert, optr+sp->offset);
- }
- else{
- ColumnLoad(eptr+filter->fhd->table->col[sp->idx].offset,
- filter->fhd->table->col[sp->idx].size,
- filter->fhd->table->col[sp->idx].n,
- filter->convert, optr+sp->offset);
- }
- break;
- default:
- break;
- }
- }
- /* bump to next output record */
- optr += filter->evsize;
- }
-
- switch(filter->ptype){
- case PTYPE_PROCESS:
- case PTYPE_CONTAINED:
- switch(filter->pipeos){
- case PIPE_WIN32:
-#if HAVE_CYGWIN||HAVE_MINGW32
- /* write events to the filter process */
- bytes = n*filter->evsize;
- if((got=WinProcessWrite(filter->ohandle, obuf, bytes)) != bytes){
- gerror(stderr,
- "event filter failed: wanted to write %d bytes but wrote %d\n",
- bytes, got);
- flag = -1;
- }
- /* read back result flags */
- get = n * sizeof(unsigned int);
- WinProcessRead(filter->ihandle, vbuf, get, &got);
-#else
- gerror(stderr, "internal error: no WinProcess without Windows");
- flag = -1;
-#endif
- break;
- default:
- /* write events to the filter process */
- bytes = n*filter->evsize;
- if((got=ProcessWrite(filter->ochan, obuf, bytes)) != bytes){
- gerror(stderr,
- "event filter failed: wanted to write %d bytes but wrote %d\n",
- bytes, got);
- flag = -1;
- }
- /* read back result flags */
- get = n * sizeof(unsigned int);
- ProcessRead(filter->ichan, vbuf, get, &got);
- break;
- }
- /* we need one int back for each event we wrote */
- if( get == got ){
- flag = 1;
- }
- else{
- gerror(stderr,
- "event filter failed: wanted to read %d bytes but got %d\n",
- get, got);
- flag = -1;
- }
- break;
-#ifdef USE_DL
- case PTYPE_DYNAMIC:
- if( (evrtn=(FilterTableCall)DLSym(filter->dl, filter->pname)) ){
- filter->g = (*evrtn)(filter->g, obuf, n, filter->evsize, vbuf);
- flag = 1;
- }
- else{
- flag = -1;
- }
- break;
-#endif
- default:
- flag = -1;
- break;
- }
-
- /* free up malloc'ed space */
- if( obuf ) xfree(obuf);
- /* return the news */
- return flag;
-}
-
-/*
- *
- * FilterImage -- filter image by sending sections to a co-process,
- * which returns segments of valid image data
- *
- */
-#ifdef ANSI_FUNC
-int
-FilterImage(Filter filter, int x0, int x1, int y0, int y1, int block,
- FilterMask *masks, int *nreg)
-#else
-int FilterImage(filter, x0, x1, y0, y1, block, masks, nreg)
- Filter filter;
- int x0, x1, y0, y1, block;
- FilterMask *masks;
- int *nreg;
-#endif
-{
- int i, j;
- int got;
- int fsize;
- int mblock;
- char tbuf[SZ_LINE];
- FilterMask xmasks;
-#ifdef USE_DL
- FilterImageCall imrtn;
-#endif
-
- /* make sure we have a valid filter */
- if( !filter || (filter == NOFILTER) )
- return(0);
-
- /* handle fits image mask specially */
- if( filter->nmask && filter->masks ){
- mblock = (int)(((double)((x1 - x0 + 1)/block)/(double)ft_naxis(filter->maskhd, 1)) + 0.5);
- if( mblock < 1 ){
- gerror(stderr, "image mask cannot be larger than blocked image section");
- return(0);
- }
- /* copy mask records into return buffer */
- fsize = filter->nmask * sizeof(FilterMaskRec) * mblock;
- xmasks = xmalloc(fsize);
- /* copy all masks and translate x,y positions as needed */
- for(got=0, i=0; i<filter->nmask; i++){
- xmasks[got].region = filter->masks[i].region;
- xmasks[got].y = (filter->masks[i].y - 1.0) * mblock + 1.0;
- xmasks[got].xstart = (filter->masks[i].xstart - 1.0) * mblock + 1.0;
- xmasks[got].xstop = (filter->masks[i].xstop - 1.0) * mblock + 1.0;
- /* replicate the segment up to the block factor */
- for(j=1; j<mblock; j++){
- xmasks[got+j].region = xmasks[got].region;
- xmasks[got+j].y = xmasks[got].y+j;
- xmasks[got+j].xstart = xmasks[got].xstart;
- xmasks[got+j].xstop = xmasks[got].xstop;
- }
- got += mblock;
- }
- /* sort by y and x */
- qsort(xmasks, got, sizeof(FilterMaskRec), _FilterImageCmp);
- /* mask records */
- if( masks ) *masks = xmasks;
- /* number of regions */
- if( nreg ) *nreg = filter->nmaskreg;
- return(got);
- }
-
- /* if the index is enough, just return */
- if( FILTER_INDEX_ONLY(filter) )
- return(0);
-
- switch(filter->ptype){
- case PTYPE_PROCESS:
- case PTYPE_CONTAINED:
- switch(filter->pipeos){
- case PIPE_WIN32:
-#if HAVE_CYGWIN||HAVE_MINGW32
- /* write command to process */
- snprintf(tbuf, SZ_LINE-1, "%d %d %d %d %d\n", x0, x1, y0, y1, block);
- WinProcessWrite(filter->ohandle, tbuf, (int)strlen(tbuf));
- /* read back mask records */
- *masks = WinProcessRead(filter->ihandle, NULL, -1, &got);
- got /= sizeof(FilterMaskRec);
-#else
- gerror(stderr, "internal error: no WinProcess without Windows");
- return(-1);
-#endif
- break;
- default:
- /* write command to process */
- snprintf(tbuf, SZ_LINE-1, "%d %d %d %d %d\n", x0, x1, y0, y1, block);
- ProcessWrite(filter->ochan, tbuf, (int)strlen(tbuf));
- /* read back mask records */
- *masks = ProcessRead(filter->ichan, NULL, -1, &got);
- got /= sizeof(FilterMaskRec);
- break;
- }
- break;
-#ifdef USE_DL
- case PTYPE_DYNAMIC:
- if( (imrtn=(FilterImageCall)DLSym(filter->dl, filter->pname)) ){
- *masks = (*imrtn)(x0, x1, y0, y1, block, &got);
- }
- else
- return(-1);
- break;
-#endif
- default:
- return(-1);
- }
-
- /* how many separate regions? */
- if( nreg ) *nreg = FilterRegionCount(TOK_IREG);
-
- /* return the news */
- return(got);
-}
-
-/*
- *
- * FilterClose -- close a filter and free up memory
- *
- */
-#ifdef ANSI_FUNC
-int FilterClose(Filter filter)
-#else
-int FilterClose(filter)
- Filter filter;
-#endif
-{
- int status=0;
- int i, j;
- Scan scan, tscan;
-
- if( !filter || (filter == NOFILTER) )
- return(0);
-
- /* this is the default filter handle */
- default_filter = filter;
-
- switch(filter->ptype){
- case PTYPE_PROCESS:
- case PTYPE_CONTAINED:
- /* close the filter process */
- switch(filter->pipeos){
- case PIPE_WIN32:
-#if HAVE_CYGWIN||HAVE_MINGW32
- if( filter->process ) WinProcessClose(filter->process, &status);
-#else
- gerror(stderr, "internal error: no WinProcess without Windows");
-#endif
- break;
- default:
- if( filter->pid > 0 ) ProcessClose(filter->pid, &status);
- break;
- }
- /* delete program */
- if( filter->prog ) unlink(filter->prog);
- break;
-#ifdef USE_DL
- case PTYPE_DYNAMIC:
- if( filter->dl )
- DLClose(filter->dl);
- break;
-#endif
- default:
- break;
- }
-
- /* call any method-specific cleanup routines */
- FilterProgClose(filter);
- FilterProgEnd(filter);
-
- /* free alloc'ed memory */
- FilterSymbolFree(filter);
- if( filter->pname ) xfree(filter->pname);
- if( filter->mode ) xfree(filter->mode);
- if( filter->masks ) xfree(filter->masks);
- if( filter->cc ) xfree(filter->cc);
- if( filter->cflags ) xfree(filter->cflags);
- if( filter->objs ) xfree(filter->objs);
- if( filter->extra ) xfree(filter->extra);
- if( filter->shflags ) xfree(filter->shflags);
- if( filter->code ) xfree(filter->code);
- if( filter->prog ) xfree(filter->prog);
- if( filter->string ) xfree(filter->string);
- if( filter->xbin ) xfree(filter->xbin);
- if( filter->ybin ) xfree(filter->ybin);
- if( filter->symtab ) xfree(filter->symtab);
- if( filter->evsect ) xfree(filter->evsect);
- if( filter->maskhd ) ft_headfree(filter->maskhd, 1);
- /* free region information */
- if( filter->g ){
- for(i=0; i<filter->g->maxshapes; i++){
- if( filter->g->shapes[i].scanlist ){
- for(j=0; j<=filter->g->y1; j++){
- if( filter->g->shapes[i].scanlist[j] ){
- for(scan=filter->g->shapes[i].scanlist[j]; scan; ){
- tscan = scan->next;
- xfree(scan);
- scan = tscan;
- }
- }
- }
- xfree(filter->g->shapes[i].scanlist);
- }
- if( filter->g->shapes[i].pts ) xfree(filter->g->shapes[i].pts);
- if( filter->g->shapes[i].xv ) xfree(filter->g->shapes[i].xv);
- }
- if( filter->g->shapes ) xfree(filter->g->shapes);
- if( filter->g->ybuf ) xfree(filter->g->ybuf);
- if( filter->g->x0s ) xfree(filter->g->x0s);
- if( filter->g->x1s ) xfree(filter->g->x1s);
- if( filter->g->masks ) xfree(filter->g->masks);
- if( filter->g ) xfree(filter->g);
- }
- /* free index information */
-#if HAVE_MINGW32==0
- idxendparser();
-#endif
- /* free main struct */
- xfree(filter);
- /* return the status from closing the sub-process */
- return(status);
-}
-
-
-/*
- *
- * FilterConcats -- concat n filters, removing enclosing brackets as necessary
- *
- */
-#ifdef ANSI_FUNC
-char *
-FilterConcats(char **filters, int n)
-#else
-char *FilterConcats(filters, n)
- char **filters;
- int n;
-#endif
-{
- char *ofilter;
- char *optr;
- char *clip;
- int i;
- int len;
-
- /* need at least 1 string */
- if( n == 0 )
- return(NULL);
-
- /* get max length of output filter */
- for(len=0, i=0; i<n; i++){
- if( filters[i] && (*filters[i] != '\0') ){
- len += strlen(filters[i]);
- }
- }
-
- /* need something to return */
- if( len == 0 )
- return(NULL);
-
- /* allocate space for the output filter */
- ofilter = (char *)xcalloc(len+1, sizeof(char));
- optr = ofilter;
-
- /* take each input filter */
- for(i=0; i<n; i++){
- if( filters[i] && (*filters[i] != '\0') ){
- /* clip off the brackets */
- clip = FilterClip(filters[i]);
- /* copy the clipped filter to the output */
- if( clip && (*clip != '\0') ){
- strcpy(optr, clip);
- xfree(clip);
- while( *optr )
- optr++;
- }
- }
- }
-
- /* this is the concat'ed filter */
- return(ofilter);
-}
-
-/*
- *
- * FilterConcat -- concat 2 filters, with an optional operation in between
- *
- */
-#ifdef ANSI_FUNC
-char *
-FilterConcat(char *f1, char *f2, char *op)
-#else
-char *FilterConcat(f1, f2, op)
- char *f1;
- char *f2;
- char *op;
-#endif
-{
- char *nf1, *nf2, *nop;
- char *result;
- char *filters[4];
- int n=0;
-
- /* clip the filters and look for null extensions */
- nf1 = FilterClip(f1);
- nf2 = FilterClip(f2);
- nop = FilterClip(op);
-
- if( nf1 && (*nf1 != '\0') ){
- filters[n++] = nf1;
- }
- if( nop && (*nop != '\0') &&
- nf1 && (*nf1 != '\0') &&
- nf2 && (*nf2 != '\0') ){
- filters[n++] = nop;
- }
- if( nf2 && (*nf2 != '\0') ){
- filters[n++] = nf2;
- }
-
- /* get the concated filters */
- result = FilterConcats(filters, n);
-
- /* free up space */
- if( nf1 )
- xfree(nf1);
- if( nf2 )
- xfree(nf2);
- if( nop )
- xfree(nop);
-
- /* return result */
- return(result);
-}
-
-/*
- *
- * FilterString -- return the filter string used for this filter
- *
- */
-#ifdef ANSI_FUNC
-char *
-FilterString(Filter filter)
-#else
-char *FilterString(filter)
- Filter filter;
-#endif
-{
- if( !filter || (filter == NOFILTER) )
- return NULL;
- else
- return filter->string;
-}
diff --git a/funtools/filter/filter.h b/funtools/filter/filter.h
deleted file mode 100644
index 7a49bdc..0000000
--- a/funtools/filter/filter.h
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory
- */
-
-/*
- *
- * filter.h - include file for "compile on the fly" filters
- *
- */
-
-#ifndef __filter_h
-#define __filter_h
-
-#if HAVE_CONFIG_H
-#include "conf.h"
-#endif
-
-/* avoid use of system -- its not secure */
-/* but funtools cannot use launch for the MinGW platform because the stdfiles
- support is missing in the launch_spawnvp() implementation of launch */
-#ifndef USE_LAUNCH
-#define USE_LAUNCH 1
-#endif
-#if HAVE_MINGW32
-#undef USE_LAUNCH
-#endif
-
-#include <stdio.h>
-#include <ctype.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#include <sys/types.h>
-#include "prsetup.h"
-#include "gio.h"
-#include "file.h"
-#include "find.h"
-#include "macro.h"
-#include "word.h"
-#include "xalloc.h"
-#include "strtod.h"
-#define USE_XFILEIO 1
-#include "fitsy.h"
-#undef USE_XFILEIO
-#include "idx.h"
-#include "wcs.h"
-#include "column.h"
-#include "tl.h"
-#include "dl.h"
-#include "mkrtemp.h"
-#include "zprocess.h"
-#include "winprocess.h"
-#include "parse.h"
-#ifdef USE_LAUNCH
-#include "xlaunch.h"
-#endif
-
-#ifndef OBJPATH
-#define OBJPATH "."
-#endif
-
-#ifndef FILTER_CC
-#define FILTER_CC NULL
-#endif
-
-#ifndef FILTER_CFLAGS
-#define FILTER_CFLAGS NULL
-#endif
-
-/* define methods of program generation */
-#define METHOD_C 1
-
-/* define types of filtering */
-#define TYPE_EVENTS 1
-#define TYPE_IMAGE 2
-
-/* define types of filtering process -- separate process, self-contained
- separate process, or dynamic load (if defined) */
-#define PTYPE_PROCESS 1
-#define PTYPE_CONTAINED 2
-#define PTYPE_DYNAMIC 3
-
-/* define how we connect the processes -- unix or windows pipes */
-#define PIPE_UNIX 0
-#define PIPE_WIN32 1
-
-
-/* defaults which can be overridden by environment variables */
-#define DEFAULT_FILTER_METHOD METHOD_C
-#define DEFAULT_FILTER_TYPE TYPE_EVENTS
-#ifdef USE_DL
-#define DEFAULT_FILTER_PTYPE PTYPE_DYNAMIC
-#else
-#define DEFAULT_FILTER_PTYPE PTYPE_PROCESS
-#endif
-#define DEFAULT_PAINT_MODE "false"
-#define DEFAULT_FILTER_TMPDIR "/tmp"
-
-/* define type of important tokens */
-#define TOK_EREG 1
-#define TOK_NREG 2
-#define TOK_IREG 4
-#define TOK_RLIST 8
-#define TOK_RTINE 16
-#define TOK_NAME 32
-#define TOK_ACCEL 64
-#define TOK_VARARGS 128
-
-#define TOK_REG (TOK_EREG|TOK_NREG|TOK_IREG)
-
-/* default cordinate system for regions */
-#define DEFAULT_COORDSYS "physical"
-
-/* if we have gcc, we can use dynamic loading instead of a separate process */
-#define GCC_SHARED_FLAGS "-g -fPIC -shared"
-
-/* places to look for the compiler other than user's path */
-#define CC_PATH "/opt/SUNWspro/bin:/bin:/usr/bin:/usr/local/bin/:/opt/local/bin:"
-
-/* define non-WCS coordinate systems we handle specially */
-#define LCX_IMAGE 1
-#define LCX_PHYS 2
-#define LCX_AMP 3
-#define LCX_DET 4
-
-/* define symbol types in symbol table */
-#define SYM_COL 1
-#define SYM_PAR 2
-
-/* whether we use only the index and not the compiled filter */
-#define FILTER_INDEX_ONLY(f) \
- ((f->doidx==1)&&(f->idx)&&(f->idx->dofilt==0)&&(f->idx->rtype!=IDX_INDEF))
-
-typedef struct filtmask {
- int region;
- int y;
- int xstart, xstop;
-} *FilterMask, FilterMaskRec;
-
-typedef struct scanrec{
- struct scanrec *next;
- int x;
-} *Scan, ScanRec;
-
-/* structs for use with region routines */
-typedef struct shaperec {
- int init;
- double ystart, ystop;
- Scan *scanlist;
- /* varargs */
- int nv;
- double *xv;
- /* circle, annulus */
- double r1sq, r2sq;
- /* ellipse */
- double angl, sinangl, cosangl;
- double cossq, sinsq;
- double xradsq, yradsq;
- double a;
- /* polygon-style shapes */
- int npt;
- double *pts;
- /* line */
- int xonly;
- double x1, x2, y1;
- double invslope;
-} *Shape, ShapeRec;
-
-typedef struct gfiltrec {
- int nshapes; /* number of shapes */
- int maxshapes; /* number of shape records we allocate */
- Shape shapes; /* array holding range limits for one shape */
- int rid; /* first valid region for current pixel */
- int usebinsiz; /* whether bindizx,binsizy are used */
- char *evsect; /* value of event section */
- double tlminx, tlminy; /* tlmin for event section */
- double binsizx, binsizy; /* bin sizes for event section */
- double tloff; /* offset for quick p2i conversion */
- int xmin, xmax, ymin, ymax; /* section limits in original image coords */
- int block; /* block factor */
- int x0, x1, y0, y1; /* section limits in section coords */
- int *ybuf; /* valid y row flags */
- int *x0s; /* valid x start values */
- int *x1s; /* valid x stop values */
- int nmask; /* number of image mask record */
- int maskdim; /* size of mask image */
- FilterMask masks; /* mask records */
-} *GFilt, GFiltRec;
-
-typedef struct filtseg {
- int n;
- int type;
- int ops;
- int len;
- int flag;
- int nregion;
- char *s;
- int s0;
- char *regions;
- int nr;
- char *shapes;
- int ns;
- int regval;
- char *radang;
- int ralen;
-} *FiltSeg, FiltSegRec;
-
-/* structs for use with symbol table routines */
-typedef struct filtsymtab {
- int type;
- char *name;
- char *value;
- int idx;
- int offset;
- FITSCard card;
-} *FilterSymbols, FilterSymRec;
-
-typedef struct filtrec {
- /* general information */
- char *mode;
- char *evsect;
- int method;
- int type;
- int paint;
- int debug;
- /* the input filter string */
- char *string;
- int size;
- /* fits info */
- FITSHead fhd;
- int convert;
- char *xbin;
- char *ybin;
- /* compiled program info */
- char *code;
- char *prog;
- FILE *fp;
- /* symbol table info */
- int maxsyms;
- int nsyms;
- int evsize;
- FilterSymbols symtab;
- /* method info */
- char *cc;
- char *cflags;
- char *objs;
- char *extra;
- char *shflags;
- /* process info */
- char *pname;
- int ptype;
- /* which type of pipe? */
- int pipeos;
- /* used by unix pipe */
- int pid;
- int ichan;
- int ochan;
- /* used by Windows pipe */
- void *process;
- void *ihandle;
- void *ohandle;
- /* used for dynamic linking */
- void *dl;
- GFilt g;
- /* loadable drivers for each technique */
- /* NB: can't use typdef because we refer to this struct */
- int (*filt_start) _PRx((struct filtrec *filter));
- int (*filt_open) _PRx((struct filtrec *filter));
- int (*filt_prepend) _PRx((struct filtrec *filter));
- int (*filt_write) _PRx((struct filtrec *filter));
- int (*filt_append) _PRx((struct filtrec *filter));
- int (*filt_close) _PRx((struct filtrec *filter));
- int (*filt_compile) _PRx((struct filtrec *filter));
- int (*filt_end) _PRx((struct filtrec *filter));
- char *(*filt_name) _PRx((struct filtrec *filter, char *name));
- char *(*filt_routine1) _PRx((struct filtrec *filter, char *name));
- char *(*filt_routine2) _PRx((struct filtrec *filter, char *name));
- char *(*filt_region1) _PRx((struct filtrec *filter, char *name));
- char *(*filt_region2) _PRx((struct filtrec *filter, char *name));
- /* fits image mask info */
- int nmask;
- int nmaskreg;
- FilterMask masks;
- FITSHead maskhd;
- /* indexing information */
- int doidx;
- idxvalrec *valhead;
- idxrowrec *rowhead;
- idxrowrec *idx;
-} *Filter, FilterRec;
-
-typedef void *(*FilterTableCall)(
-#ifdef ANSI_FUNC
- void *tg, char *ebuf, int ne, int esize, int *rbuf
-#endif
-);
-
-typedef FilterMask (*FilterImageCall)(
-#ifdef ANSI_FUNC
- int txmin, int txmax, int tymin, int tymax, int tblock, int *got
-#endif
-);
-
-/* this makes it look like a simple flag */
-#define NOFILTER FilterNull()
-
-_PRbeg
-
-/* filter.c */
-int FilterNum _PRx((void));
-char *FilterClip _PRx((char *filter));
-Filter FilterDefault _PRx((void));
-Filter FilterNull _PRx((void));
-char *FilterPath _PRx((void));
-Filter FilterOpen _PRx((FITSHead header, char *filter, char *mode));
-int FilterEvents _PRx((Filter filter,
- char *ebuf, int esize, int n, int *vbuf));
-int FilterImage _PRx((Filter filter,
- int x0, int x1, int y0, int y1, int block,
- FilterMask *masks, int *nreg));
-int FilterClose _PRx((Filter filter));
-char *FilterConcats _PRx((char **filters, int n));
-char *FilterConcat _PRx((char *f1, char *f2, char *op));
-char *FilterString _PRx((Filter filter));
-
-/* symbols.c */
-int FilterSymbolInit _PRx((Filter filter));
-char *FilterSymbolEnter _PRx((Filter filter, char *s, int *got));
-FilterSymbols FilterSymbolLookup _PRx((Filter filter, char *s));
-int FilterSymbolDefaults _PRx((Filter filter, int enter));
-void FilterSymbolFree _PRx((Filter filter));
-
-/* filt.l */
-char *_FilterString _PRx((void));
-void FiltInitParser _PRx((void));
-void FiltScanString _PRx((char *s));
-int FilterRoutineCount _PRx((void));
-int FilterShapeCount _PRx((void));
-int FilterRegionCount _PRx((int type));
-int FilterParseError _PRx((void));
-int FilterTlInfo _PRx((double *tlmins, double *binsizs, int *tltyps));
-char *FilterRadAng _PRx((void));
-
-int filterror _PRx((char *msg));
-int filtlex _PRx((void));
-int filtwrap _PRx((void));
-int filtparse _PRx((void));
-
-/* filtprog.c */
-int FilterProgStart _PRx((Filter filter));
-int FilterProgOpen _PRx((Filter filter));
-int FilterProgPrepend _PRx((Filter filter));
-int FilterProgWrite _PRx((Filter filter));
-int FilterProgAppend _PRx((Filter filter));
-int FilterProgClose _PRx((Filter filter));
-int FilterProgCompile _PRx((Filter filter));
-int FilterProgEnd _PRx((Filter filter));
-char *FilterLexName _PRx((Filter filter, char *name));
-char *FilterLexRoutine1 _PRx((Filter filter, char *name));
-char *FilterLexRoutine2 _PRx((Filter filter, char *name));
-char *FilterLexRegion1 _PRx((Filter filter, char *name));
-char *FilterLexRegion2 _PRx((Filter filter, char *name));
-
-/* filtprog_c.c */
-int FilterProgLoad_C _PRx((Filter filter));
-
-/* evregions.c */
-void initevregions _PRx((void));
-/* imregions.c */
-void initimregions _PRx((void));
-
-_PRend
-
-/* for compatibility with funtools */
-#define FilterTable FilterEvents
-
-#endif /* __filter.h */
diff --git a/funtools/filter/filter_pyh.py b/funtools/filter/filter_pyh.py
deleted file mode 100644
index fb98196..0000000
--- a/funtools/filter/filter_pyh.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# from regions.h -- no idea what it is ...
-xsno=3
-
-# ... but its important!
-maxshapes=(nshape*(xsno+1))+1
-
-# ctypes struct definitions (taken from filter.h)
-class filtmask(Structure):
- _fields_ = [('region', c_int), ('y', c_int), ('xstart', c_int), ('xstop', c_int)]
-
-class scanrec(Structure):
- pass
-
-# this is how you add a forward pointer
-scanrec._fields_ = [ ('next', POINTER(scanrec)), ('x', c_int) ]
-
-class shaperec(Structure):
- _fields_ = [ ('init', c_int), ('ystart', c_double), ('ystop', c_double), ('scanlist', c_void_p), ('nv', c_int), ('xv', c_void_p), ('r1sq', c_double), ('r2sq', c_double), ('angl', c_double), ('sinangl', c_double), ('cosangl', c_double), ('cossq', c_double), ('sinsq', c_double), ('xradsq', c_double), ('yradsq', c_double), ('a', c_double), ('npt', c_int), ('pts', c_void_p), ('xonly', c_int), ('x1', c_double), ('x2', c_double), ('y1', c_double), ('invslope', c_double)]
-
-class gfiltrec(Structure):
- _fields_ = [('nshapes', c_int), ('maxshapes', c_int), ('shapes', POINTER(shaperec * maxshapes)), ('rid', c_int), ('usebinsiz', c_int), ('evsect', c_char_p), ('tlminx', c_double), ('tlminy', c_double), ('binsizx', c_double), ('binsizy', c_double), ('tloff', c_double), ('xmin', c_int), ('xmax', c_int), ('ymin', c_int), ('ymax', c_int), ('block', c_int), ('x0', c_int), ('x1', c_int), ('y0', c_int), ('y1', c_int), ('ybuf', POINTER(c_int)), ('x0s', POINTER(c_int)), ('x1s', POINTER(c_int)), ('nmask', c_int), ('maskdim', c_int), ('masks', POINTER(filtmask))]
-
diff --git a/funtools/filter/filtprog.c b/funtools/filter/filtprog.c
deleted file mode 100644
index 81720f8..0000000
--- a/funtools/filter/filtprog.c
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory
- */
-
-/*
- *
- * filtprog.c -- hi level support for filters using different techniques
- *
- */
-
-#include <filter.h>
-
-/*
- *
- * FilterProgStart -- start the filtering process
- *
- */
-#ifdef ANSI_FUNC
-int
-FilterProgStart (Filter filter)
-#else
-int FilterProgStart(filter)
- Filter filter;
-#endif
-{
- /* make sure we have something to play with */
- if( filter == NULL)
- return(0);
-
- /* call the technique-specific routine */
- if( filter->filt_start )
- return((filter->filt_start)(filter));
- else{
- return(0);
- }
-}
-
-/*
- *
- * FilterProgOpen -- return filter program as a file for writing
- *
- */
-#ifdef ANSI_FUNC
-int
-FilterProgOpen (Filter filter)
-#else
-int FilterProgOpen(filter)
- Filter filter;
-#endif
-{
- /* make sure we have something to play with */
- if( filter == NULL)
- return(0);
-
- /* check the mode for known techniques and load drivers */
- switch( filter->method ){
- case METHOD_C:
- FilterProgLoad_C(filter);
- break;
- default:
- gerror(stderr, "unknown filter technique: %d\n", filter->method);
- return(0);
- }
-
- /* call the technique-specific routine */
- if( filter->filt_open ){
- return((filter->filt_open)(filter));
- }
- else{
- return(1);
- }
-}
-
-/*
- *
- * FilterProgPrepend -- prepend to the filter
- *
- */
-#ifdef ANSI_FUNC
-int
-FilterProgPrepend (Filter filter)
-#else
-int FilterProgPrepend(filter)
- Filter filter;
-#endif
-{
- /* make sure we have something to play with */
- if( filter == NULL)
- return(0);
-
- /* call the technique-specific routine */
- if( filter->filt_prepend )
- return((filter->filt_prepend)(filter));
- else
- return(1);
-}
-
-/*
- *
- * FilterProgWrite -- write the symbols
- *
- */
-#ifdef ANSI_FUNC
-int
-FilterProgWrite (Filter filter)
-#else
-int FilterProgWrite(filter)
- Filter filter;
-#endif
-{
- /* make sure we have something to play with */
- if( filter == NULL)
- return(0);
-
- /* call the technique-specific routine */
- if( filter->filt_write )
- return((filter->filt_write)(filter));
- else
- return(1);
-}
-
-/*
- *
- * FilterProgAppend -- append the filter program body
- *
- */
-#ifdef ANSI_FUNC
-int
-FilterProgAppend (Filter filter)
-#else
-int FilterProgAppend(filter)
- Filter filter;
-#endif
-{
- /* make sure we have something to play with */
- if( filter == NULL)
- return(0);
-
- /* call the technique-specific routine */
- if( filter->filt_append )
- return((filter->filt_append)(filter));
- else
- return(1);
-}
-
-/*
- *
- * FilterProgClose -- close the filter program file
- *
- */
-#ifdef ANSI_FUNC
-int
-FilterProgClose (Filter filter)
-#else
-int FilterProgClose(filter)
- Filter filter;
-#endif
-{
- /* make sure we have something to play with */
- if( filter == NULL)
- return(0);
-
- /* debugging only */
- if( filter->debug >= 2 )
- return(1);
-
- /* call the technique-specific routine */
- if( filter->filt_close )
- return((filter->filt_close)(filter));
- else
- return(1);
-}
-
-/*
- *
- * FilterProgCompile -- compile the filter program
- *
- */
-#ifdef ANSI_FUNC
-int
-FilterProgCompile (Filter filter)
-#else
-int FilterProgCompile(filter)
- Filter filter;
-#endif
-{
- /* make sure we have something to play with */
- if( filter == NULL)
- return(0);
-
- /* debugging only */
- if( filter->debug >= 2 )
- return(1);
-
- /* call the technique-specific routine */
- if( filter->filt_compile )
- return((filter->filt_compile)(filter));
- else
- return(1);
-}
-
-/*
- *
- * FilterProgEnd -- end the filtering process
- *
- */
-#ifdef ANSI_FUNC
-int
-FilterProgEnd (Filter filter)
-#else
-int FilterProgEnd(filter)
- Filter filter;
-#endif
-{
- /* make sure we have something to play with */
- if( filter == NULL)
- return(0);
-
- /* call the technique-specific routine */
- if( filter->filt_end )
- return((filter->filt_end)(filter));
- else{
- return(0);
- }
-}
-
-/*
- *
- * FilterLexName -- return the "in-expression" name
- *
- */
-#ifdef ANSI_FUNC
-char *
-FilterLexName (Filter filter, char *name)
-#else
-char *FilterLexName(filter, name)
- Filter filter;
- char *name;
-#endif
-{
- /* make sure we have something to play with */
- if( filter == NULL)
- return(name);
-
- /* call the technique-specific routine */
- if( filter->filt_name )
- return((filter->filt_name)(filter, name));
- else
- return(name);
-}
-
-/*
- *
- * FilterLexRoutine1 -- return the beginning of the routine string
- *
- */
-#ifdef ANSI_FUNC
-char *
-FilterLexRoutine1 (Filter filter, char *name)
-#else
-char *FilterLexRoutine1(filter, name)
- Filter filter;
- char *name;
-#endif
-{
- /* make sure we have something to play with */
- if( filter == NULL)
- return(NULL);
-
- /* call the technique-specific routine */
- if( filter->filt_routine1 )
- return((filter->filt_routine1)(filter, name));
- else
- return(name);
-}
-
-/*
- *
- * FilterLexRoutine2 -- return the beginning of the routine string
- *
- */
-#ifdef ANSI_FUNC
-char *
-FilterLexRoutine2 (Filter filter, char *name)
-#else
-char *FilterLexRoutine2(filter, name)
- Filter filter;
- char *name;
-#endif
-{
- /* make sure we have something to play with */
- if( filter == NULL)
- return(NULL);
-
- /* call the technique-specific routine */
- if( filter->filt_routine2 )
- return((filter->filt_routine2)(filter, name));
- else
- return(name);
-}
-
-/*
- *
- * FilterLexRegion1 -- return the beginning of the region string
- *
- */
-#ifdef ANSI_FUNC
-char *
-FilterLexRegion1 (Filter filter, char *name)
-#else
-char *FilterLexRegion1(filter, name)
- Filter filter;
- char *name;
-#endif
-{
- /* make sure we have something to play with */
- if( filter == NULL)
- return(NULL);
-
- /* call the technique-specific region */
- if( filter->filt_region1 )
- return((filter->filt_region1)(filter, name));
- else
- return(name);
-}
-
-/*
- *
- * FilterLexRegion2 -- return the end of the region string
- *
- */
-#ifdef ANSI_FUNC
-char *
-FilterLexRegion2 (Filter filter, char *name)
-#else
-char *FilterLexRegion2(filter, name)
- Filter filter;
- char *name;
-#endif
-{
- /* make sure we have something to play with */
- if( filter == NULL)
- return(NULL);
-
- /* call the technique-specific region */
- if( filter->filt_region2 )
- return((filter->filt_region2)(filter, name));
- else
- return(name);
-}
-
diff --git a/funtools/filter/filtprog_c.c b/funtools/filter/filtprog_c.c
deleted file mode 100644
index dbebd60..0000000
--- a/funtools/filter/filtprog_c.c
+++ /dev/null
@@ -1,1033 +0,0 @@
-/*
- * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory
- */
-
-/*
- *
- * filtprog_c.c -- support for filters using the C compiler
- *
- */
-
-#include <filter.h>
-#include <swap.h>
-#include <regions_h.h>
-#include <events_c.h>
-#include <image_c.h>
-#include <evregions_c.h>
-#include <imregions_c.h>
-#include <xalloc_c.h>
-#include <swap_c.h>
-
-/*
- *
- * Private Routines
- *
- */
-
-#ifdef ANSI_FUNC
-static char *
-GetType(int t)
-#else
-static char *GetType(t)
- int t;
-#endif
-{
- switch(t){
- case 'A':
- return("char");
- case 'B':
- return("unsigned char");
- case 'I':
- return("short");
- case 'U':
- return("unsigned short");
- case 'J':
- return("int");
- case 'V':
- return("unsigned int");
- case 'K':
- return("long long");
- case 'E':
- return("float");
- case 'D':
- return("double");
- case 'X':
- return("char");
- case 'L':
- return("char");
- default:
- return("char");
- }
-}
-
-#ifdef ANSI_FUNC
-static double
-GetTloff(int t)
-#else
-static double GetTloff(t)
- int t;
-#endif
-{
- switch(t){
- case 'B':
- case 'I':
- case 'U':
- case 'J':
- case 'V':
- case 'K':
- case 'X':
- return 1.0;
- case 'E':
- case 'D':
- return 0.5;
- default:
- return 1.0;
- }
-}
-
-#ifdef ANSI_FUNC
-static char *
-_FilterInitString(char *filtstr)
-#else
-static char *_FilterInitString(filtstr)
- char *filtstr;
-#endif
-{
- char *ibuf, *iptr, *fptr;
- char *s, *t;
- int paren=0;
-
- ibuf = xcalloc(strlen(filtstr)*10, sizeof(char));
- /* make sure we have at least one shape */
- if( !FilterShapeCount() )
- return ibuf;
- iptr = ibuf;
- fptr = filtstr;
- while( *fptr ){
- /* look for beginning of region routine */
- if( !(s=strstr(fptr, "im")) && !(s=strstr(fptr, "ev")) )
- break;
- t = s+2;
- if( !*t )
- break;
- /* which is followed by a region and open paren */
- if( strncmp(t, "annulus(", 8) &&
- strncmp(t, "box(", 4) &&
- strncmp(t, "circle(", 7) &&
- strncmp(t, "ellipse(", 8) &&
- strncmp(t, "line(", 5) &&
- strncmp(t, "panda(", 6) &&
- strncmp(t, "bpanda(", 7) &&
- strncmp(t, "cpanda(", 7) &&
- strncmp(t, "epanda(", 7) &&
- strncmp(t, "pie(", 4) &&
- strncmp(t, "qtpie(", 6) &&
- strncmp(t, "point(", 6) &&
- strncmp(t, "nannulus(", 9) &&
- strncmp(t, "nbox(", 5) &&
- strncmp(t, "ncircle(", 8) &&
- strncmp(t, "nellipse(", 9) &&
- strncmp(t, "npie(", 5) &&
- strncmp(t, "vannulus(", 9) &&
- strncmp(t, "vbox(", 5) &&
- strncmp(t, "vcircle(", 8) &&
- strncmp(t, "vellipse(", 9) &&
- strncmp(t, "vpie(", 5) &&
- strncmp(t, "vpoint(", 7) &&
- strncmp(t, "polygon(", 8) &&
- strncmp(t, "field(", 6) &&
- strncmp(t, "imagemask(", 10) ){
- fptr = t;
- continue;
- }
- /* copy region name up to open paren */
- for(fptr=s; *fptr && *fptr!='('; fptr++){
- *iptr++ = *fptr;
- }
- /* append init suffix */
- *iptr++ = 'i';
- /* copy the paren */
- if( *fptr == '(' ){
- *iptr++ = *fptr++;
- paren++;
- }
- /* copy til end of region, i.e., when paren goes to 0 */
- while( *fptr && paren ){
- if( *fptr == '(' )
- paren++;
- if( *fptr == ')' )
- paren--;
- *iptr++ = *fptr++;
- }
- /* copy ';' */
- *iptr++ = ';';
- }
- return(ibuf);
-}
-
-/*
- *
- * FilterProgOpen_C -- return filter program as a file for writing
- *
- */
-#ifdef ANSI_FUNC
-static int
-FilterProgOpen_C (Filter filter)
-#else
-static int FilterProgOpen_C(filter)
- Filter filter;
-#endif
-{
- int fd;
- char *ccstr=NULL;
- char prefix[SZ_LINE];
- char tbuf[SZ_LINE];
- char *tmpdir=NULL;
-#if HAVE_CYGWIN
- char *s;
-#endif
-
- /* make sure we have something to work with */
- if( !filter )
- return(0);
-
- /* see if the user specified a compiler explicitly */
- if( !(ccstr = getenv("FILTER_CC")) &&
- !(ccstr = getenv("CC")) &&
- !(ccstr = FILTER_CC) ){
- ccstr = "gcc";
- }
- /* make sure we have a compiler */
- if( !(filter->cc = Access(ccstr, "x")) &&
- !(filter->cc = Find(ccstr, "x", NULL, FilterPath())) &&
- !(filter->cc = Find("gcc", "x", NULL, FilterPath())) &&
- !(filter->cc = Find("cc", "x", NULL, FilterPath())) &&
- !(filter->cc = Find("cc", "x", NULL, ".")) &&
- !(filter->cc = Find("cc", "x", NULL, CC_PATH)) ){
- gerror(stderr, "no compiler found for filter compilation\n");
- return(0);
- }
-
- /* determine whether communication is via Unix pipes or Win32 pipes */
- filter->pipeos = PIPE_UNIX;
-#if HAVE_MINGW32
- filter->pipeos = PIPE_WIN32;
-#endif
-#if HAVE_CYGWIN
- if( (s=strrchr(filter->cc, '/')) ){
- s++;
- }
- else if( (s=strrchr(filter->cc, '\\')) ){
- s++;
- } else {
- s = filter->cc;
- }
- if( !strcasecmp(s, "tcc") || !strcasecmp(s, "tcc.exe") ||
- !strcasecmp(s, "pcc") || !strcasecmp(s, "pcc.exe") ){
- filter->pipeos = PIPE_WIN32;
- }
-#endif
-
- /* final check on ptype: if we wanted dynamic but had no gcc, use process */
- if( (filter->ptype == PTYPE_DYNAMIC) && !strstr(filter->cc, "gcc") )
- filter->ptype = PTYPE_PROCESS;
- /* get default file names */
- snprintf(tbuf, SZ_LINE, "$FILTER_OBJDIR:$FILTER_LIBDIR:%s:$HOME/.funtools:$SAORD_ROOT/lib:/usr/lib:/usr/local/lib:/opt/local/lib", OBJPATH);
- switch( filter->type ){
- case TYPE_EVENTS:
- /* normally, we filter events analytically */
- if( !filter->evsect )
- /* filter->objs = Find("evregions.o", "r", NULL, tbuf); */
- filter->objs = Find("libfuntools.a", "r", NULL, tbuf);
- /* if evsect=xxx is specified, we filter by image pixels */
- else
- /* filter->objs = Find("imregions.o", "r", NULL, tbuf); */
- filter->objs = Find("libfuntools.a", "r", NULL, tbuf);
- break;
- case TYPE_IMAGE:
- /* image are filtered by image pixels */
- /* filter->objs = Find("imregions.o", "r", NULL, tbuf); */
- filter->objs = Find("libfuntools.a", "r", NULL, tbuf);
- break;
- }
- /* if we wanted to a process, but have no objects, use self-contained */
- if( (filter->ptype == PTYPE_PROCESS) && !filter->objs )
- filter->ptype = PTYPE_CONTAINED;
- /* allow extra stuff on the command line */
- if( !(filter->cflags = xstrdup(getenv("FILTER_CFLAGS"))) &&
- !(filter->cflags = xstrdup(FILTER_CFLAGS)) )
- filter->cflags = xstrdup(" ");
- if( !(filter->extra = xstrdup(getenv("FILTER_EXTRA"))) )
- filter->extra = xstrdup(" ");
- /* set shared switches for gcc */
- if( strstr(filter->cc, "gcc") )
- filter->shflags = xstrdup(GCC_SHARED_FLAGS);
-
- /* get prefix for filter source and program */
- if( !(tmpdir = (char *)getenv("FILTER_TMPDIR")) &&
- !(tmpdir = (char *)getenv("TMPDIR")) &&
- !(tmpdir = (char *)getenv("TMP")) )
- tmpdir = DEFAULT_FILTER_TMPDIR;
- if( !*tmpdir )
- tmpdir = ".";
-#if HAVE_MINGW32
- snprintf(prefix, SZ_LINE, "%s\\f", tmpdir);
-#else
- snprintf(prefix, SZ_LINE, "%s/f", tmpdir);
-#endif
-
- /* make up the routine name when we dynamically load */
- snprintf(tbuf, SZ_LINE, "Filter%d%d", (int)getpid(), FilterNum());
- filter->pname = xstrdup(tbuf);
-
- /* make up name of C source file we will generate */
- if( filter->debug >= 2 ){
- filter->fp = stdout;
- return(1);
- }
- else{
- if( (fd=mkrtemp(prefix, ".c", tbuf, SZ_LINE, 1)) < 0 ){
- gerror(stderr, "could not generate C filter source name: %s\n",
- prefix);
- return(0);
- }
- filter->code = xstrdup(tbuf);
- if( !(filter->fp = fdopen(fd, "w+b")) ){
- gerror(stderr, "could not open C filter source file: %s\n",
- tbuf);
- return(0);
- }
- }
-
- /* make up the name of the program we will compile into.
- we make this different from the .c file name to make interception
- by an intruder harder */
- if( mkrtemp(prefix, NULL, tbuf, SZ_LINE, 0) < 0 ){
- gerror(stderr, "could not generate C filter program name: %s\n",
- prefix);
- return(0);
- }
-#if HAVE_MINGW32
- strcat(tbuf, ".exe");
-#endif
- filter->prog = xstrdup(tbuf);
- return(1);
-}
-
-/*
- *
- * FilterProgPrepend_C -- prepend the filter code
- *
- */
-#ifdef ANSI_FUNC
-static int
-FilterProgPrepend_C (Filter filter)
-#else
-static int FilterProgPrepend_C(filter)
- Filter filter;
-#endif
-{
- char *s=NULL;
- char *contents=NULL;
- FILE *fd;
-
- /* make sure we have something to work with */
- if( !filter )
- return(0);
-
- /* make sure we are not in debug mode */
- if( filter->debug >= 2 )
- return(1);
-
- /* init temps */
- fd = filter->fp;
-
- /* initialize with process type */
- switch(filter->ptype){
- case PTYPE_CONTAINED:
- fprintf(fd, "#define FILTER_PTYPE c\n");
- break;
- case PTYPE_DYNAMIC:
- fprintf(fd, "#define FILTER_PTYPE d\n");
- break;
- case PTYPE_PROCESS:
- fprintf(fd, "#define FILTER_PTYPE p\n");
- break;
- }
-
- /* we want the byte order up at the top */
- if( is_bigendian() ){
- fprintf(fd, "#define MYBYTE_ORDER 4321\n");
- }
- else{
- fprintf(fd, "#define MYBYTE_ORDER 1234\n");
- }
-
- /* for some compilers (e.g. pcc), we need to minimize use of #include */
- if( (s=strrchr(filter->cc, '/')) ){
- s++;
- } else {
- s = filter->cc;
- }
- if( !strcasecmp(s, "pcc") || !strcasecmp(s, "pcc.exe") ){
- fprintf(fd, "#define MINIMIZE_INCLUDES 1\n");
- }
-
- /* do we need windows pipes? */
- if( filter->pipeos == PIPE_WIN32 ){
- fprintf(fd, "#define USE_WIN32 1\n");
- fprintf(fd, "#include <windows.h>\n");
- }
-
-
- /* prepend the filter header */
- contents = REGIONS_H;
- if( (contents != NULL) && (*contents != '\0') ){
- fprintf(fd, "%s\n", contents);
- }
-
- /* these are implemented as aliases */
- fprintf(fd, "#define evvcircle evvannulus\n");
- fprintf(fd, "#define evncircle evnannulus\n");
- fprintf(fd, "#define imvcirclei imvannulusi\n");
- fprintf(fd, "#define imncirclei imnannulusi\n");
- fprintf(fd, "#define imvcircle imvannulus\n");
- fprintf(fd, "#define imncircle imnannulus\n");
- fprintf(fd, "#define evcpanda evpanda\n");
- fprintf(fd, "#define imcpandai impandai\n");
- fprintf(fd, "#define imcpanda impanda\n");
- fprintf(fd, "\n");
-
- /* add some math support */
- if( is_bigendian() ){
- fprintf(fd, "static unsigned char _nan[8]={0x7F,0xF0,1,1,1,1,1,1};\n");
- }
- else{
- fprintf(fd, "static unsigned char _nan[8]={1,1,1,1,1,1,0xF0,0x7F};\n");
- }
- fprintf(fd, "#define NaN *((double *)_nan)\n");
- fprintf(fd, "#define div(a,b) (feq(b,0)?(NaN):(a/b))\n");
- fprintf(fd, "\n");
- return(1);
-}
-
-/*
- *
- * FilterProgWrite_C -- write the symbols for filtering
- *
- */
-#ifdef ANSI_FUNC
-static int
-FilterProgWrite_C(Filter filter)
-#else
-static int FilterProgWrite_C(filter)
- Filter filter;
-#endif
-{
- int i;
- int offset;
- int pad;
- int dsize;
- int evsize;
- int tltyps[2];
- double tlmins[2];
- double binsizs[2];
- char vbuf[1024];
- char *s, *t;
- char *v;
- char *ibuf;
- char *filtstr;
- char *contents=NULL;
- char tbuf[SZ_LINE];
- FILE *fd;
- FilterSymbols sp;
- FITSHead fhd;
-
- /* make sure we have something to work with */
- if( !filter )
- return(0);
-
- /* make sure we are init'ed */
- if( filter->fhd == NULL ){
- gerror(stderr, "symbol table not initialized\n");
- return(0);
- }
-
- /* make sure we are init'ed */
- if( filter->fp == NULL ){
- gerror(stderr, "no output file for parser\n");
- return(0);
- }
-
- /* get the filter string */
- if( !(filtstr = (char *)_FilterString()) || !strcmp(filtstr, "()") ){
- return(0);
- }
-
- /* init temps */
- fhd = filter->fhd;
- fd= filter->fp;
- offset = 0;
- evsize = 0;
-
- /* ptype-specific processing */
- switch(filter->ptype){
- case PTYPE_CONTAINED:
- /* Write code to output file -- must be done BEFORE we write the
- region symbols, to avoid unintentional redefinitions */
- if( filter->debug < 2 ){
- /* we need the xalloc routines */
- contents = XALLOC_C;
- if( (contents != NULL) && (*contents != '\0') ){
- fprintf(fd, "%s\n", contents);
- }
- /* region routines if not linking against previously compiled code */
- switch( filter->type ){
- case TYPE_EVENTS:
- /* normally, we filter events analytically using evregions.o */
- if( !filter->evsect )
- contents = EVREGIONS_C;
- /* if evsect=xxx is specified, we filter by image pixels */
- else
- contents = IMREGIONS_C;
- break;
- case TYPE_IMAGE:
- /* image are filtered by image pixels */
- contents = IMREGIONS_C;
- break;
- default:
- break;
- }
- if( (contents != NULL) && (*contents != '\0') ){
- /* use fprintf so that we handle \n correctly in TEMPLATE */
- fprintf(fd, "%s\n", contents);
- }
- else{
- gerror(stderr, "could not write filter subroutines\n");
- return(0);
- }
- }
- break;
- }
-
- /* always need the swap routines (they're part of the filter) */
- contents = SWAP_C;
- if( (contents != NULL) && (*contents != '\0') ){
- fprintf(fd, "%s\n", contents);
- }
-
- /* output counts of shapes */
- fprintf(fd, "#define NSHAPE %d\n",
- FilterShapeCount());
- fprintf(fd, "#define NREGION %d\n",
- FilterRegionCount(TOK_IREG|TOK_EREG|TOK_NREG));
- /* output the filter itself */
- fprintf(fd, "#define FILTER %s\n", filtstr);
- if( filter->debug < 2 ){
- /* string version of the filter -- used to check for FIELD optimization */
- fprintf(fd, "#define FILTSTR \"%s\"\n", filtstr);
- /* output the initialization string */
- ibuf = _FilterInitString(filtstr);
- fprintf(fd, "#define FINIT %s\n", (ibuf && *ibuf)?ibuf:"");
- if( ibuf ) xfree(ibuf);
- }
-
- /* for type image, we generate an initialization string */
- switch(filter->type){
- case TYPE_IMAGE:
- fprintf(fd, "#define IMFILTRTN %s\n", filter->pname);
- break;
- case TYPE_EVENTS:
- fprintf(fd, "#define EVFILTRTN %s\n", filter->pname);
- /* output the event section and tlmin values, if necessary */
- if( filter->evsect && FilterTlInfo(tlmins,binsizs,tltyps) ){
- if( *filter->evsect == '"' )
- fprintf(fd, "#define EVSECT %s\n", filter->evsect);
- else
- fprintf(fd, "#define EVSECT \"%s\"\n", filter->evsect);
- fprintf(fd, "#define TLMINX %f\n", tlmins[0]);
- fprintf(fd, "#define TLMINY %f\n", tlmins[1]);
- for(i=0; i<2; i++)
- if( binsizs[i] <= 0.0 ) binsizs[i] = 1.0;
- if( (binsizs[0] == 1.0) && (binsizs[1] == 1.0) )
- fprintf(fd, "#define USEBINSIZ 0\n");
- else
- fprintf(fd, "#define USEBINSIZ 1\n");
- fprintf(fd, "#define BINSIZX %f\n", binsizs[0]);
- fprintf(fd, "#define BINSIZY %f\n", binsizs[1]);
- fprintf(fd, "#define TLOFF %f\n", GetTloff(tltyps[0]));
- fprintf(fd, "#define TLOFF %f\n", GetTloff(tltyps[1]));
- }
- /* loop through the symbol table and process #defines */
- for(i=0; i<filter->nsyms; i++){
- sp = &(filter->symtab[i]);
- /* skip accidentally empty ones */
- if( (sp->name == NULL) || (*sp->name == '\0') )
- continue;
- /* process this type of symbol */
- switch(sp->type){
- case SYM_COL:
- /* make sure we are aligned */
- if( fhd->table->col[sp->idx].type == 'X' ){
- switch(fhd->table->col[sp->idx].n){
- case 8:
- dsize = 1;
- break;
- case 16:
- dsize = 2;
- break;
- case 32:
- dsize = 4;
- break;
- default:
- dsize = ft_sizeof(filter->fhd->table->col[sp->idx].type);
- }
- }
- else{
- dsize = ft_sizeof(filter->fhd->table->col[sp->idx].type);
- }
- pad = dsize - (offset % dsize);
- if( pad == dsize ) pad = 0;
- offset += pad;
- evsize += pad;
- sp->offset = offset;
- if( fhd->table->col[sp->idx].scaled ){
- snprintf(tbuf, SZ_LINE, "(%f+%f*(",
- fhd->table->col[sp->idx].zero,
- fhd->table->col[sp->idx].scale);
- s = tbuf;
- t = "))";
- }
- else{
- s = "";
- t = "";
- }
- if( fhd->table->col[sp->idx].n == 1 ){
- fprintf(fd, "#define %s %s*((%s *)(SW%d(eptr+%d,%d,_swf,%d)))%s\n",
- sp->name,
- s,
- GetType((int)fhd->table->col[sp->idx].type),
- dsize,
- offset,
- dsize,
- offset,
- t);
- }
- else{
- if( fhd->table->col[sp->idx].type == 'X' ){
- switch(fhd->table->col[sp->idx].n){
- case 8:
- fprintf(fd, "#define %s %s*((%s *)(eptr+%d))%s\n",
- sp->name, s, "unsigned char", offset, t);
- break;
- case 16:
- fprintf(fd, "#define %s %s*((%s *)(SW2(eptr+%d,%d,_swf,%d)))%s\n",
- sp->name, s, "unsigned short", offset, 2, offset, t);
- break;
- case 32:
- fprintf(fd, "#define %s %s*((%s *)(SW4(eptr+%d,%d,_swf,%d)))%s\n",
- sp->name, s, "unsigned int", offset, 4, offset, t);
- break;
- default:
- fprintf(fd, "#define %s %s((%s *)(SW%d(eptr+%d,%d,_swf,%d)))%s\n",
- sp->name,
- s,
- GetType((int)fhd->table->col[sp->idx].type),
- dsize,
- offset,
- dsize,
- offset,
- t);
- }
- }
- else if( fhd->table->col[sp->idx].type == 'A' ){
- fprintf(fd, "#define %s acopy(eptr+%d,%d)\n",
- sp->name,
- offset,
- fhd->table->col[sp->idx].n);
- }
- else{
- fprintf(fd, "#define %s %s((%s *)(SW%d(eptr+%d,%d,_swf,%d)))%s\n",
- sp->name,
- s,
- GetType((int)fhd->table->col[sp->idx].type),
- dsize,
- offset,
- dsize,
- offset,
- t);
- }
- }
- /* lower and upper case are both acceptable */
- strcpy(vbuf, sp->name);
- cluc(vbuf);
- if( strcmp(vbuf, sp->name) ){
- fprintf(fd, "#define %s %s\n", vbuf, sp->name);
- }
- culc(vbuf);
- if( strcmp(vbuf, sp->name) ){
- fprintf(fd, "#define %s %s\n", vbuf, sp->name);
- }
- /* bump pointers */
- if( fhd->table->col[sp->idx].type == 'X' ){
- offset +=
- ((fhd->table->col[sp->idx].size*fhd->table->col[sp->idx].n)+7)/8;
- evsize +=
- ((fhd->table->col[sp->idx].size*fhd->table->col[sp->idx].n)+7)/8;
- }
- else{
- offset += fhd->table->col[sp->idx].size*fhd->table->col[sp->idx].n;
- evsize += fhd->table->col[sp->idx].size*fhd->table->col[sp->idx].n;
- }
- break;
- case SYM_PAR:
- /* we have to distinguish between numbers and strings here */
- /* strip off enclosing white space */
- (void)nowhite(sp->value, vbuf);
- /* check for all white space */
- if( *vbuf == '\0' ){
- fprintf(fd, "#define %s \"\"\n", sp->name);
- }
- else{
- /* see if its a pure number */
- (void)strtod(vbuf, &v);
- if( (v == NULL) || (*v == '\0') )
- fprintf(fd, "#define %s %s\n", sp->name, vbuf);
- else
- fprintf(fd, "#define %s \"%s\"\n", sp->name, vbuf);
- }
- break;
- }
- }
- /* make sure each record is aligned */
- pad = 8 - (evsize % 8);
- if( pad == 8 ) pad = 0;
- evsize += pad;
- /* make sure we have at least one byte to send to co-process */
- if( evsize <=0 ) evsize = 1;
- /* output the size of the filter record */
- fprintf(fd, "#define EVSIZE %d\n", evsize);
- fprintf(fd, "static char _swf[%d];\n", evsize);
- /* save for later use */
- filter->evsize = evsize;
- break;
- default:
- break;
- }
-
- /* write out the mask structure */
- if( filter->nmask && filter->masks &&
- (filter->type == TYPE_EVENTS) && filter->evsect ){
- fprintf(fd, "#define NMASK %d\n", filter->nmask);
- fprintf(fd, "#define MASKDIM %d;\n", ft_naxis(filter->maskhd, 1));
- fprintf(fd, "static FilterMaskRec _masks[]={\n");
- /* copy all masks and translate x,y positions as needed */
- for(i=0; i<filter->nmask; i++){
- fprintf(fd, "{%d,%d,%d,%d}",
- filter->masks[i].region,
- filter->masks[i].y,
- filter->masks[i].xstart,
- filter->masks[i].xstop);
- if( i != (filter->nmask -1) )
- fprintf(fd, ",");
- fprintf(fd, "\n");
- }
- fprintf(fd, "};\n");
- }
- else{
- fprintf(fd, "#define NMASK 0\n");
- fprintf(fd, "#define MASKDIM 0;\n");
- fprintf(fd, "static FilterMask _masks=NULL;\n");
- }
-
- /* write it now */
- fflush(fd);
- return(1);
-}
-
-/*
- *
- * FilterProgAppend_C -- append the filter program body
- *
- */
-#ifdef ANSI_FUNC
-static int
-FilterProgAppend_C (Filter filter)
-#else
-static int FilterProgAppend_C(filter)
- Filter filter;
-#endif
-{
- char *contents=NULL;
-
- /* make sure we have something to work with */
- if( !filter )
- return(0);
-
- /* make sure we are not in debug mode */
- if( filter->debug >= 2 )
- return(1);
-
- /* get body of filter program */
- switch( filter->type ){
- case TYPE_EVENTS:
- contents = EVENTS_C;
- break;
- case TYPE_IMAGE:
- contents = IMAGE_C;
- break;
- }
- if( (contents != NULL) && (*contents != '\0') ){
- /* use fprintf so that we handle \n correctly in TEMPLATE */
- fprintf(filter->fp, "%s\n", contents);
- return(1);
- }
- else{
- gerror(stderr, "could not write body of filter program\n");
- return(0);
- }
-}
-
-/*
- *
- * FilterProgClose_C -- close the filter program file
- *
- */
-#ifdef ANSI_FUNC
-static int
-FilterProgClose_C (Filter filter)
-#else
-static int FilterProgClose_C(filter)
- Filter filter;
-#endif
-{
- /* make sure we have something to work with */
- if( !filter )
- return(0);
-
- /* close file if we are not in debug mode */
- if( (filter->debug < 2) && filter->fp ){
- fclose(filter->fp);
- filter->fp = NULL;
- }
- return(1);
-}
-
-/*
- *
- * FilterProgCompile_C -- compile the filter program
- *
- */
-#ifdef ANSI_FUNC
-static int
-FilterProgCompile_C (Filter filter)
-#else
-static int FilterProgCompile_C(filter)
- Filter filter;
-#endif
-{
- char *s;
- char *math;
- char tbuf[SZ_LINE];
- char pmode[SZ_LINE];
- char log[SZ_LINE];
- char *devnull;
-#ifdef USE_LAUNCH
- char *stdfiles[3];
-#else
- char tbuf2[SZ_LINE];
-#endif
- int len;
- int got;
- int keep=0;
-
- /* make sure we have something to work with */
- if( !filter )
- return(0);
-
- /* make sure we are not in debug mode */
- if( !filter->cc || (filter->debug >= 2) )
- return(1);
-
- /* flag whether to keep compiler files around */
- if( !(s=getenv("FILTER_KEEP")) || !istrue(s) )
- keep = 0;
- else
- keep = 1;
-
- /* add math library, if necessary */
- switch(filter->pipeos){
- case PIPE_WIN32:
- math = "";
- break;
- default:
- math = "-lm";
- break;
- }
-
- /* set up /dev/null */
-#if HAVE_MINGW32
- devnull = "nul";
-#else
- devnull = "/dev/null";
-#endif
-
- /* get log file name */
- snprintf(log, SZ_LINE, "%s.log", filter->prog);
-
- /* delete old version */
- unlink(filter->prog);
-
- switch(filter->ptype){
- case PTYPE_PROCESS:
- /* make up the compile command */
- snprintf(tbuf, SZ_LINE, "%s %s -o %s %s %s %s %s",
- filter->cc, filter->cflags, filter->prog, filter->code,
- filter->objs ? filter->objs : " ",
- filter->extra, math);
-#ifndef USE_LAUNCH
- snprintf(tbuf2, SZ_LINE, " 1>%s 2>%s", devnull, log);
- strcat(tbuf, tbuf2);
-#endif
- strcpy(pmode, "x");
- break;
- case PTYPE_CONTAINED:
- /* make up the compile command */
- snprintf(tbuf, SZ_LINE, "%s %s -o %s %s %s %s",
- filter->cc, filter->cflags, filter->prog, filter->code,
- filter->extra, math);
-#ifndef USE_LAUNCH
- snprintf(tbuf2, SZ_LINE, " 1>%s 2>%s", devnull, log);
- strcat(tbuf, tbuf2);
-#endif
- strcpy(pmode, "x");
- break;
-#ifdef USE_DL
- case PTYPE_DYNAMIC:
- snprintf(tbuf, SZ_LINE, "%s %s %s %s -o %s %s %s",
- filter->cc, filter->cflags, filter->shflags,
- filter->objs ? filter->objs : " ",
- filter->prog, filter->code, filter->extra);
-#ifndef USE_LAUNCH
- snprintf(tbuf2, SZ_LINE, " 1>%s 2>%s", devnull, log);
- strcat(tbuf, tbuf2);
-#endif
- strcpy(pmode, "r");
- break;
-#endif
- default:
- return(0);
- }
-
- /* issue the shell command to compile the program */
-#ifdef USE_LAUNCH
- stdfiles[0] = NULL;
- stdfiles[1] = devnull;
- stdfiles[2] = log;
- got = Launch(tbuf, 1, stdfiles, NULL);
-#else
- got = system(tbuf);
-#endif
-
- /* delete the filter program body in any case */
- if( !keep )
- unlink(filter->code);
-
- /* Sun cc can leave an extraneous .o around, which we don't want */
- strcpy(tbuf, filter->code);
- /* change .c to .o */
- tbuf[strlen(tbuf)-1] = 'o';
- unlink(tbuf);
- /* ... actually its usually left in the current directory */
- if( (s = strrchr(tbuf, '/')) )
- unlink(s+1);
-
- /* now we can see if we succeeded in issuing the command */
- if( got < 0 ){
- gerror(stderr, "could not run filter compilation\n");
- return(0);
- }
-
- /* if we have an executable program, we succeeded */
- if( (s=Find(filter->prog, pmode, NULL, NULL)) != NULL ){
- unlink(log);
- if( s ) xfree(s);
- }
- else{
- s = FileContents(log, 0, &len);
- if( s && *s && len ){
- fprintf(stderr, "Compilation error message:\n%s\n", s);
- }
- if( !keep ){
- unlink(log);
- }
- if( s ) xfree(s);
- gerror(stderr, "filter compilation failed\n");
- return(0);
- }
-
- /* good news */
- return(1);
-}
-
-
-/*
- *
- * FilterProgEnd_C -- end the filtering process
- *
- */
-#ifdef ANSI_FUNC
-static int
-FilterProgEnd_C (Filter filter)
-#else
-int FilterProgEnd_C(filter)
- Filter filter;
-#endif
-{
- char *s;
- int status=0;
-
- /* make sure we have something to play with */
- if( filter == NULL)
- return(0);
-
- /* delete the filter program */
- unlink(filter->prog);
- /* delete the filter program body, if necessary */
- if( !(s=getenv("FILTER_KEEP")) || !istrue(s) )
- unlink(filter->code);
- return(status);
-}
-
-/*
- *
- * Public Routines
- *
- */
-
-/*
- *
- * FilterProgLoad_C -- load the routines needed to support C filtering
- *
- */
-#ifdef ANSI_FUNC
-int
-FilterProgLoad_C (Filter filter)
-#else
-int FilterProgLoad_C(filter)
- Filter filter;
-#endif
-{
- /* make sure we have something to work with */
- if( !filter )
- return(0);
-
- filter->filt_open = FilterProgOpen_C;
- filter->filt_prepend = FilterProgPrepend_C;
- filter->filt_write = FilterProgWrite_C;
- filter->filt_append = FilterProgAppend_C;
- filter->filt_close = FilterProgClose_C;
- filter->filt_compile = FilterProgCompile_C;
- filter->filt_end = FilterProgEnd_C;
- return(1);
-}
diff --git a/funtools/filter/idx.h b/funtools/filter/idx.h
deleted file mode 100644
index 0eaf982..0000000
--- a/funtools/filter/idx.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 2005 Smithsonian Astrophysical Observatory
- */
-
-/*
- *
- * idx.h - include file for indexed filters
- *
- */
-#ifndef __idx_h
-#define __idx_h
-
-#if HAVE_CONFIG_H
-#include "conf.h"
-#endif
-#include "prsetup.h"
-#include <stdio.h>
-#include <ctype.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#include "fitsy.h"
-#include "gio.h"
-#include "xalloc.h"
-#include "strtod.h"
-
-/* binary search edge */
-#define IDX_EDGE_LEFT 1
-#define IDX_EDGE_RIGHT 2
-#define IDX_EDGE_BOTH (IDX_EDGE_LEFT|IDX_EDGE_RIGHT)
-
-/* type of row record */
-#define IDX_ALLROWS 0
-#define IDX_INDEF 1
-#define IDX_ROW_LIST 2
-#define IDX_SORT 3
-#define IDX_OR_SORT 4
-#define IDX_AND_SORT 5
-
-/* methods of accessing data record */
-#define IDX_IO_MMAP 1
-#define IDX_IO_LSEEK 2
-
-#ifdef HAVE_SYS_MMAN_H
-#define IDX_IO_DEFAULT IDX_IO_MMAP
-#else
-#define IDX_IO_DEFAULT IDX_IO_LSEEK
-#endif
-
-/* increment for storing rowlists */
-#define IDX_ROW_INC 32
-
-/* sort program */
-#define IDX_SORTPROG "_funsort"
-
-/* idxinfo which values */
-#define IDX_COLNAME 1
-#define IDX_FILENAME 2
-#define IDX_FILEROOT1 3
-#define IDX_FILEROOT2 4
-#define IDX_PATHNAME 5
-#define IDX_SORTNAME 6
-
-/* rows can be in memory range lists or file-based row numbers */
-typedef struct _idxrowrec{
- struct _idxrowrec *next;
- char *s;
- int type;
- int rtype;
- int dofilt;
- int dosort;
- int rtot;
- int maxrow;
- int nrow;
- int *startrow;
- int *stoprow;
- FILE *ifile;
- int ichan;
- int ochan;
- int pid;
- struct _idxvalrec *v;
- char *fdata;
- int flen;
-} idxrowrec;
-
-/* values can be int, float, col, region, func */
-typedef struct _idxvalrec{
- struct _idxvalrec *next;
- char *s;
- int type;
- int ntype;
- longlong ival;
- double dval;
- char *iname;
- GIO igio;
- FITSHead ifits;
- int itype;
- int ioffset;
- int in;
- int vtype;
- int voffset;
- int vn;
- int nrow;
- char *idata;
- int ilen;
- struct _idxvalrec *rv[2];
- double rlo[2], rhi[2];
-} idxvalrec;
-
-_PRbeg
-
-idxrowrec *idxall _PRx((idxrowrec *row));
-idxrowrec *idxor _PRx((idxrowrec *row1, idxrowrec *row2));
-idxrowrec *idxand _PRx((idxrowrec *row1, idxrowrec *row2));
-idxrowrec *idxnot _PRx((idxrowrec *row));
-
-idxrowrec *idxrowreg _PRx((idxvalrec *val));
-idxrowrec *idxrowfun _PRx((idxvalrec *val));
-idxrowrec *idxroweq _PRx((idxvalrec *val1, idxvalrec *val2));
-idxrowrec *idxrowne _PRx((idxvalrec *val1, idxvalrec *val2));
-idxrowrec *idxrowlt _PRx((idxvalrec *val1, idxvalrec *val2));
-idxrowrec *idxrowle _PRx((idxvalrec *val1, idxvalrec *val2));
-idxrowrec *idxrowgt _PRx((idxvalrec *val1, idxvalrec *val2));
-idxrowrec *idxrowge _PRx((idxvalrec *val1, idxvalrec *val2));
-idxrowrec *idxrownot _PRx((idxvalrec *val));
-
-idxvalrec *idxvaladd _PRx((idxvalrec *val1, idxvalrec *val2));
-
-idxvalrec *idxvalsub _PRx((idxvalrec *val1, idxvalrec *val2));
-idxvalrec *idxvalmul _PRx((idxvalrec *val1, idxvalrec *val2));
-idxvalrec *idxvaldiv _PRx((idxvalrec *val1, idxvalrec *val2));
-idxvalrec *idxvalmod _PRx((idxvalrec *val1, idxvalrec *val2));
-idxvalrec *idxvaland _PRx((idxvalrec *val1, idxvalrec *val2));
-idxvalrec *idxvalor _PRx((idxvalrec *val1, idxvalrec *val2));
-idxvalrec *idxvalxor _PRx((idxvalrec *val1, idxvalrec *val2));
-idxvalrec *idxvalnot _PRx((idxvalrec *val));
-idxvalrec *idxvalcom _PRx((idxvalrec *val));
-idxvalrec *idxvalmin _PRx((idxvalrec *val));
-
-char *idxinfo _PRx((int which));
-int idxdebug _PRx((int debug));
-idxvalrec *idxvalnew _PRx((char *s));
-int idxvalfree _PRx((idxvalrec *v));
-idxrowrec *idxrownew _PRx((void));
-int idxrowfree _PRx((idxrowrec *r));
-int idxinitfilenames _PRx((char *s, int *flag));
-char *idxindexfilename _PRx((char *s, int *size));
-idxvalrec *idxlookupfilename _PRx((char *iname));
-void idxfreefilenames _PRx((void));
-void idxfreeglobals _PRx((void));
-int idxinitparser _PRx((char *s));
-void idxendparser _PRx((void));
-void *idxread _PRx((idxrowrec *row, GIO gio, FITSHead fits,
- void *buf, size_t size, size_t get, size_t *got,
- int *dofilt));
-void idxstring _PRx((char *s));
-int idxerror _PRx((char *mmsg));
-int idxlex _PRx((void));
-int idxparse _PRx((void));
-
-_PRend
-
-#endif /* __idx.h */
diff --git a/funtools/filter/idx.l b/funtools/filter/idx.l
deleted file mode 100644
index a542505..0000000
--- a/funtools/filter/idx.l
+++ /dev/null
@@ -1,559 +0,0 @@
-%option caseless
-%array
-
-%{
-#include <math.h>
-#include <filter.h>
-#include <idx.h>
-#include <idx.tab.h>
-
-extern int idx_debug;
-
-static int _valint(char *s, idxvalrec **v);
-static int _valfloat(char *s, idxvalrec **v);
-static int _valname(char *s, idxvalrec **v);
-static int _valreg(char *s, idxvalrec **v);
-static int _valfunc(char *s, idxvalrec **v);
-%}
-
-SP [ \t]
-DIG [0-9]
-DIG2 [0-9a-fA-F]
-/* note that negative numbers are not defined here, but in the grammar */
-INT1 {DIG}+L?
-INT2 0[xX]{DIG2}+L?
-INT ({INT1}|{INT2})
-FLOAT1 {DIG}+\.?([eE][-+]?{DIG}+)?
-FLOAT2 {DIG}*\.{DIG}+([eE][-+]?{DIG}+)?
-XFLOAT -142857.142857
-FLOAT ({FLOAT1}|{FLOAT2}|{XFLOAT})
-NUM ({INT}|{FLOAT})
-NAME [A-Za-z_][0-9A-Za-z~_]*(\[[^\[]*\])?
-
-/* must match regions in filt.l */
-REGION (ev|im)[vn]?(annulus|box|circle|ellipse|line|panda|pie|qtpie|point|polygon|field|bpanda|cpanda|epanda)
-%%
-
-{INT} {return _valint(yytext, &(idxlval.val));}
-
-{FLOAT} {return _valfloat(yytext, &(idxlval.val));}
-
-
-evfield"(g",{INT},{INT},{INT},{INT},"(double)"{NAME},"(double)"{NAME}")" {
- return _valreg(yytext, &(idxlval.val));
-}
-
-{REGION}"(g",{INT},{INT},{INT},{INT},"(double)"{NAME},"(double)"{NAME}(,[+-]?{FLOAT})*,[+-]?{FLOAT}")" {
- return _valreg(yytext, &(idxlval.val));
-}
-
-{NAME}"("[^()]*("("[^()]*")")*")" {
- /* support functions with one level of nested parens */
- return _valfunc(yytext, &(idxlval.val));
-}
-
-{NAME} {return _valname(yytext, &(idxlval.val));}
-
-"||" {return OR;}
-"&&" {return AND;}
-"==" {return EQ;}
-"!=" {return NE;}
-"<=" {return LE;}
-">=" {return GE;}
-
-{SP} {;}
-
-<<EOF>> {
- yy_delete_buffer( YY_CURRENT_BUFFER );
- yyterminate();
- }
-
-. {return yytext[0];}
-
-%%
-
-#ifdef YY_USE_PROTOS
-static int _valint(char *s, idxvalrec **v)
-#else
-static int _valint(s, v)
- char *s;
- idxvalrec **v;
-#endif
-{
- char *t;
- *v = idxvalnew(s);
- (*v)->ival = strtoll(s, &t, 0);
- if( *t )
- idxerror("bad integer value");
- (*v)->type = NUM;
- (*v)->ntype = PARSE_INTEGER;
- (*v)->dval = (double)(*v)->ival;
- return NUM;
-}
-
-#ifdef YY_USE_PROTOS
-static int _valfloat(char *s, idxvalrec **v)
-#else
-static int _valfloat(s, v)
- char *s;
- idxvalrec **v;
-#endif
-{
- char *t;
- *v = idxvalnew(s);
- (*v)->dval = strtod(s, &t);
- if( *t )
- idxerror("bad float value");
- (*v)->type = NUM;
- (*v)->ntype = PARSE_FLOAT;
- return NUM;
-}
-
-#ifdef YY_USE_PROTOS
-static int _valname(char *s, idxvalrec **v)
-#else
-static int _valname(s, v)
- char *s;
- idxvalrec **v;
-#endif
-{
- int i;
- int got;
- int oflag;
- int isize=0;
- char *iname;
- char *colname;
- char tail[SZ_LINE];
- FilterSymbols sp=NULL;
- idxvalrec *vv;
-
- *v = idxvalnew(s);
- /* lookup the string */
- if( !(sp=FilterSymbolLookup(FilterDefault(), s)) ){
- idxerror("column name not found in data file");
- (*v)->type = INDEF;
- return INDEF;
- }
- colname = idxinfo(IDX_COLNAME);
- /* see what sort of symbol it is */
- switch(sp->type){
- case SYM_COL:
- if( !(iname=idxindexfilename(s, &isize)) ){
- (*v)->type = INDEF;
- return INDEF;
- }
- /* if we already have opened this index, just use the existing handle */
- if( (vv=idxlookupfilename(iname)) ){
- (*v)->igio = vv->igio;
- (*v)->ifits = vv->ifits;
- }
- /* open index for first time and mark iname */
- else{
- oflag = setgerror(0);
- (*v)->igio = ft_fitsheadopen(iname, &((*v)->ifits), tail, SZ_LINE, "r");
- setgerror(oflag);
- if( !((*v)->igio) ){
- idxerror("existing index file can't be opened");
- (*v)->type = INDEF;
- return INDEF;
- }
- else{
- (*v)->iname = xstrdup(iname);
- }
- }
- xfree(iname);
- if( (*v)->ifits ){
- for(got=0, i=0; i<(*v)->ifits->table->tfields; i++){
- if( !strcasecmp(s, (*v)->ifits->table->col[i].name) ){
- (*v)->vtype = (*v)->ifits->table->col[i].type;
- (*v)->voffset = (*v)->ifits->table->col[i].offset;
- (*v)->vn = (*v)->ifits->table->col[i].n;
- got++;
- }
- if( !strcasecmp(colname, (*v)->ifits->table->col[i].name) ){
- (*v)->itype = (*v)->ifits->table->col[i].type;
- (*v)->ioffset = (*v)->ifits->table->col[i].offset;
- (*v)->in = (*v)->ifits->table->col[i].n;
- got++;
- }
- }
- if( got == 2 ){
-#ifdef HAVE_SYS_MMAN_H
- if( !(*v)->igio->gz ){
- if(!((*v)->idata = mmap(NULL, isize, PROT_READ, MAP_PRIVATE,
- fileno((*v)->igio->fp), 0)) ){
- idxerror("index file can't be mmap'ed");
- (*v)->type = INDEF;
- return INDEF;
- }
- (*v)->ilen = isize;
- }
-#endif
- (*v)->nrow = ft_naxis((*v)->ifits,2);
- (*v)->type = COL;
- return COL;
- }
- else{
- idxerror("column name and/or index not found in index file");
- }
- }
- else{
- (*v)->type = INDEF;
- return INDEF;
- }
- case SYM_PAR:
- (*v)->ntype=ParseDataType(sp->value, &(*v)->dval, &(*v)->ival);
- (*v)->type = NUM;
- switch((*v)->ntype){
- case PARSE_INTEGER:
- case PARSE_HEXINT:
- (*v)->dval = (double)(*v)->ival;
- return NUM;
- case PARSE_FLOAT:
- return NUM;
- default:
- idxerror("invalid parameter type in index");
- return 0;
- }
- default:
- idxerror("unknown symbol type in index");
- return 0;
- }
-}
-
-#ifdef YY_USE_PROTOS
-static int _valreglims(idxvalrec *v, char *s)
-#else
-static int _valreglims(v, s)
- idxvalrec *v;
- char *s;
-#endif
-{
- int i;
- int ip=0;
- int nd=0, maxd=0;
- double xcen, ycen;
- double dval;
- double *dvals;
- double pts[8];
- char tbuf[SZ_LINE];
- char tbuf2[SZ_LINE];
- double angle;
- double xwidth, yheight;
- double angl; /* l: Cartesian angle in radians */
- double half_width, half_height;/* l: radii (1/2 width and height) */
- double cosangl, sinangl; /* l: sine, cosine of the Cartesian angle */
- double hw_cos, hw_sin; /* l: products of half_width with sin, cos */
- double hh_cos, hh_sin; /* l: products of half_height with sin, cos */
-
- if( !strcmp(v->s, "circle") || !strcmp(v->s, "ncircle") ||
- !strcmp(v->s, "annulus") || !strcmp(v->s, "nannulus") ){
- if( !word(s, tbuf, &ip)||!word(s, tbuf2, &ip) ) return 0;
- xcen = atof(tbuf);
- ycen = atof(tbuf2);
- dval = -1;
- if( *v->s == 'n' ){
- if( !word(s, tbuf, &ip) || !word(s, tbuf, &ip) ) return 0;
- dval = MAX(atof(tbuf),dval);
- }
- else{
- while( word(s, tbuf, &ip) && strcmp(tbuf, "-142857.142857") ){
- dval = MAX(atof(tbuf),dval);
- }
- }
- v->rlo[0] = xcen - dval - 1;
- v->rhi[0] = xcen + dval + 1;
- v->rlo[1] = ycen - dval - 1;
- v->rhi[1] = ycen + dval + 1;
- return 1;
- }
- else if( !strcmp(v->s, "box") || !strcmp(v->s, "nbox") ||
- !strcmp(v->s, "ellipse") || !strcmp(v->s, "nellipse") ){
- if( !word(s, tbuf, &ip)||!word(s, tbuf2, &ip) ) return 0;
- xcen = atof(tbuf);
- ycen = atof(tbuf2);
- maxd = SZ_LINE;
- if( !(dvals=(double *)malloc(maxd*sizeof(double))) ) return 0;
- if( *v->s == 'n' ){
- if( !word(s, tbuf, &ip) || !word(s, tbuf, &ip) ) return 0;
- if( !word(s, tbuf, &ip) || !word(s, tbuf2, &ip) ) return 0;
- dvals[nd++] = atof(tbuf);
- dvals[nd++] = atof(tbuf2);
- if( word(s, tbuf, &ip) && word(s, tbuf, &ip) )
- dvals[nd++] = atof(tbuf);
- }
- else{
- while( word(s, tbuf, &ip) && strcmp(tbuf, "-142857.142857") ){
- dvals[nd++] = atof(tbuf);
- if( nd == maxd ){
- maxd += SZ_LINE;
- if( !(dvals=(double *)realloc(dvals, maxd*sizeof(double))) ) return 0;
- }
- }
- }
-ellcom:
- if( nd == 2 ){
- angle = 0.0;
- xwidth = dvals[0];
- yheight = dvals[1];
- }
- else{
- angle = dvals[nd-1];
- xwidth = dvals[nd-3];
- yheight = dvals[nd-2];
- }
- if( dvals ) xfree(dvals);
-
- /* Why is this done in evfilter.c??? Doesn't seem necessary */
- /* angl = angle + 90.0; */
- angl = angle;
- while (angl >= 360.0) angl = angl - 360.0;
- /* convert to radians */
- angl = (angl / 180.0) * M_PI;
- sinangl = sin (angl);
- cosangl = cos (angl);
- /* Why is this done in evfilter.c??? Doesn't seem necessary */
- /* since we rotate by 90.0 degrees to get from astro angle to cartesian, */
- /* we also need to switch the width and height. we do this secretly so */
- /* that the display will turn out right, by doing it in the half terms */
- if( !strcmp(v->s, "box") ){
- /*
- half_width = yheight / 2.0;
- half_height = xwidth / 2.0;
- */
- half_width = xwidth / 2.0;
- half_height = yheight / 2.0;
- }
- else{
- /*
- half_width = yheight;
- half_height = xwidth;
- */
- half_width = xwidth;
- half_height = yheight;
- }
- hw_cos = half_width * cosangl;
- hw_sin = half_width * sinangl;
- hh_cos = half_height * cosangl;
- hh_sin = half_height * sinangl;
-
- pts[0] = xcen - hw_cos - hh_sin;
- pts[1] = ycen - hw_sin + hh_cos;
- pts[2] = xcen + hw_cos - hh_sin;
- pts[3] = ycen + hw_sin + hh_cos;
- pts[4] = xcen + hw_cos + hh_sin;
- pts[5] = ycen + hw_sin - hh_cos;
- pts[6] = xcen - hw_cos + hh_sin;
- pts[7] = ycen - hw_sin - hh_cos;
-
- v->rlo[0] = pts[0];
- v->rhi[0] = pts[0];
- v->rlo[1] = pts[1];
- v->rhi[1] = pts[1];
- for(i=2; i<8; i+=2){
- v->rlo[0] = MIN(pts[i],v->rlo[0]);
- v->rhi[0] = MAX(pts[i],v->rhi[0]);
- v->rlo[1] = MIN(pts[i+1],v->rlo[1]);
- v->rhi[1] = MAX(pts[i+1],v->rhi[1]);
- }
- return 1;
- }
- else if( !strcmp(v->s, "line") ){
- for(i=0; i<4; i++){
- if( word(s, tbuf, &ip) ){
- pts[i] = atof(tbuf);
- }
- }
- v->rlo[0] = MIN(pts[0],pts[2]);
- v->rhi[0] = MAX(pts[0],pts[2]);
- v->rlo[1] = MIN(pts[1],pts[3]);
- v->rhi[1] = MAX(pts[1],pts[3]);
- return 1;
- }
- else if( !strcmp(v->s, "point") || !strcmp(v->s, "polygon") ){
- if( !word(s, tbuf, &ip)||!word(s, tbuf2, &ip) ) return 0;
- xcen = atof(tbuf);
- ycen = atof(tbuf2);
- v->rlo[0] = xcen-1;
- v->rhi[0] = xcen+1;
- v->rlo[1] = ycen-1;
- v->rhi[1] = ycen+1;
- while( word(s, tbuf, &ip) && strcmp(tbuf, "-142857.142857") &&
- word(s, tbuf2, &ip) ){
- dval = atof(tbuf);
- v->rlo[0] = MIN(dval-1,v->rlo[0]);
- v->rhi[0] = MAX(dval+1,v->rhi[0]);
- dval = atof(tbuf2);
- v->rlo[1] = MIN(dval-1,v->rlo[1]);
- v->rhi[1] = MAX(dval+1,v->rhi[1]);
- }
- return 1;
- }
- else if( !strcmp(v->s, "pie") || !strcmp(v->s, "qtpie") ){
- return 0;
- }
- else if( !strcmp(v->s, "panda") || !strcmp(v->s, "cpanda") ){
- maxd = SZ_LINE;
- if( !(dvals=(double *)malloc(maxd*sizeof(double))) ) return 0;
- while( word(s, tbuf, &ip) && strcmp(tbuf, "-142857.142857") ){
- dvals[nd++] = atof(tbuf);
- if( nd == maxd ){
- maxd += SZ_LINE;
- if( !(dvals=(double *)realloc(dvals, maxd*sizeof(double))) ) return 0;
- }
- }
- v->rlo[0] = dvals[0] - dvals[6] - 1;
- v->rhi[0] = dvals[0] + dvals[6] + 1;
- v->rlo[1] = dvals[1] - dvals[6] - 1;
- v->rhi[1] = dvals[1] + dvals[6] + 1;
- if( dvals ) xfree(dvals);
- return 1;
- }
- else if( !strcmp(v->s, "bpanda") || !strcmp(v->s, "epanda") ){
- maxd = 3;
- if( !(dvals=(double *)malloc(maxd*sizeof(double))) ) return 0;
- /* grab: xcen ycen */
- if( !word(s, tbuf, &ip)||!word(s, tbuf2, &ip) ) return 0;
- xcen = atof(tbuf);
- ycen = atof(tbuf2);
- /* skip: ang1 ang2 nang xwlo yhlo */
- for(i=0; i<5; i++){
- if( !word(s, tbuf, &ip) ) return 0;
- }
- /* grab: xwhi yhhi */
- for(i=0; i<2; i++){
- if( !word(s, tbuf, &ip) ) return 0;
- dvals[nd++] = atof(tbuf);
- }
- /* skip: nrad */
- if( !word(s, tbuf, &ip) ) return 0;
- /* grab: ang */
- if( !word(s, tbuf, &ip) ) return 0;
- dvals[nd++] = atof(tbuf);
- /* we can now handle this with box/ellipse code */
- goto ellcom;
- }
- else if( !strcmp(v->s, "field") ){
- return 0;
- }
- else{
- return 0;
- }
-}
-
-#ifdef YY_USE_PROTOS
-static int _valreg(char *s, idxvalrec **v)
-#else
-static int _valreg(s, v)
- char *s;
- idxvalrec **v;
-#endif
-{
- int ip=0;
- char *t;
- char tbuf[SZ_LINE];
- *v = idxvalnew(NULL);
- newdtable("(),");
- while( *s == '(' ) s++;
- if( !word(s, tbuf, &ip) ){
- (*v)->type = INDEF;
- return REG;
- }
- if( strstr(tbuf, "field") ){
- (*v)->type = INDEF;
- return REG;
- }
- t = tbuf+2;
- if( *t == 'v' ) t++;
- (*v)->s = xstrdup(t);
- if( !word(s, tbuf, &ip) || !word(s, tbuf, &ip) ||
- !word(s, tbuf, &ip) || !word(s, tbuf, &ip) ){
- (*v)->type = INDEF;
- return REG;
- }
- /* include/exclude */
- if( !atoi(tbuf) ){
- (*v)->type = INDEF;
- return REG;
- }
- if( !word(s, tbuf, &ip) || !word(s, tbuf, &ip) || !word(s, tbuf, &ip) ){
- (*v)->type = INDEF;
- return REG;
- }
- culc(tbuf);
- _valname(tbuf, &(*v)->rv[0]);
- if( !word(s, tbuf, &ip) || !word(s, tbuf, &ip) ){
- (*v)->type = INDEF;
- return REG;
- }
- culc(tbuf);
- _valname(tbuf, &(*v)->rv[1]);
- if( !_valreglims(*v, &s[ip]) ){
- (*v)->type = INDEF;
- return REG;
- }
- freedtable();
- (*v)->type = REG;
- return REG;
-}
-
-#ifdef YY_USE_PROTOS
-static int _valfunc(char *s, idxvalrec **v)
-#else
-static int _valfunc(s, v)
- char *s;
- idxvalrec **v;
-#endif
-{
- *v = idxvalnew(s);
- (*v)->type = FUNC;
- return FUNC;
-}
-
-
-#ifdef YY_USE_PROTOS
-void
-idxstring(char *s)
-#else
-void idxstring(s)
- char *s;
-#endif
-{
- idx_scan_string(s);
-}
-
-#ifdef YY_USE_PROTOS
-int
-idxerror(char *msg)
-#else
-int idxerror(msg)
- char *msg;
-#endif
-{
- Filter filter;
-
- YY_FLUSH_BUFFER;
- /* turn indexing off */
- if( (filter=FilterDefault()) ){
- filter->doidx = -1;
- }
- /* output message, if necessary */
- if( idx_debug ){
- fprintf(stderr, "ERROR: %s", msg);
- if( !strcmp(msg, "syntax error") ){
- fprintf(stderr, " (terminating index processing)");
- }
- fprintf(stderr, "\n");
- }
- yyterminate();
-}
-
-#ifdef YY_USE_PROTOS
-int yywrap(void)
-#else
-int yywrap()
-#endif
-{
- return 1;
-}
-
diff --git a/funtools/filter/idx.output b/funtools/filter/idx.output
deleted file mode 100644
index 0a2de2d..0000000
--- a/funtools/filter/idx.output
+++ /dev/null
@@ -1,1007 +0,0 @@
-State 3 conflicts: 1 reduce/reduce
-
-
-Grammar
-
- 0 $accept: idx $end
-
- 1 idx: expr
-
- 2 expr: rowlist
- 3 | expr OR expr
- 4 | expr AND expr
- 5 | '(' expr ')'
-
- 6 rowlist: REG
- 7 | FUNC
- 8 | value EQ value
- 9 | value NE value
- 10 | value '<' value
- 11 | value LE value
- 12 | value '>' value
- 13 | value GE value
-
- 14 value: NUM
- 15 | COL
- 16 | INDEF
- 17 | FUNC
- 18 | value '+' value
- 19 | value '-' value
- 20 | value '*' value
- 21 | value '/' value
- 22 | value '%' value
- 23 | value '&' value
- 24 | value '|' value
- 25 | value '^' value
- 26 | '!' value
- 27 | '~' value
- 28 | '-' value
- 29 | '(' value ')'
-
-
-Terminals, with rules where they appear
-
-$end (0) 0
-'!' (33) 26
-'%' (37) 22
-'&' (38) 23
-'(' (40) 5 29
-')' (41) 5 29
-'*' (42) 20
-'+' (43) 18
-'-' (45) 19 28
-'/' (47) 21
-'<' (60) 10
-'>' (62) 12
-'^' (94) 25
-'|' (124) 24
-'~' (126) 27
-error (256)
-NUM (258) 14
-COL (259) 15
-FUNC (260) 7 17
-REG (261) 6
-INDEF (262) 16
-OR (263) 3
-AND (264) 4
-NE (265) 9
-EQ (266) 8
-GE (267) 13
-LE (268) 11
-UMINUS (269)
-
-
-Nonterminals, with rules where they appear
-
-$accept (29)
- on left: 0
-idx (30)
- on left: 1, on right: 0
-expr (31)
- on left: 2 3 4 5, on right: 1 3 4 5
-rowlist (32)
- on left: 6 7 8 9 10 11 12 13, on right: 2
-value (33)
- on left: 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29,
- on right: 8 9 10 11 12 13 18 19 20 21 22 23 24 25 26 27 28 29
-
-
-state 0
-
- 0 $accept: . idx $end
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 3
- REG shift, and go to state 4
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 9
-
- idx go to state 10
- expr go to state 11
- rowlist go to state 12
- value go to state 13
-
-
-state 1
-
- 14 value: NUM .
-
- $default reduce using rule 14 (value)
-
-
-state 2
-
- 15 value: COL .
-
- $default reduce using rule 15 (value)
-
-
-state 3
-
- 7 rowlist: FUNC .
- 17 value: FUNC .
-
- $end reduce using rule 7 (rowlist)
- OR reduce using rule 7 (rowlist)
- AND reduce using rule 7 (rowlist)
- ')' reduce using rule 7 (rowlist)
- ')' [reduce using rule 17 (value)]
- $default reduce using rule 17 (value)
-
-
-state 4
-
- 6 rowlist: REG .
-
- $default reduce using rule 6 (rowlist)
-
-
-state 5
-
- 16 value: INDEF .
-
- $default reduce using rule 16 (value)
-
-
-state 6
-
- 28 value: '-' . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 16
-
-
-state 7
-
- 26 value: '!' . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 17
-
-
-state 8
-
- 27 value: '~' . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 18
-
-
-state 9
-
- 5 expr: '(' . expr ')'
- 29 value: '(' . value ')'
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 3
- REG shift, and go to state 4
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 9
-
- expr go to state 19
- rowlist go to state 12
- value go to state 20
-
-
-state 10
-
- 0 $accept: idx . $end
-
- $end shift, and go to state 21
-
-
-state 11
-
- 1 idx: expr .
- 3 expr: expr . OR expr
- 4 | expr . AND expr
-
- OR shift, and go to state 22
- AND shift, and go to state 23
-
- $default reduce using rule 1 (idx)
-
-
-state 12
-
- 2 expr: rowlist .
-
- $default reduce using rule 2 (expr)
-
-
-state 13
-
- 8 rowlist: value . EQ value
- 9 | value . NE value
- 10 | value . '<' value
- 11 | value . LE value
- 12 | value . '>' value
- 13 | value . GE value
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
-
- '|' shift, and go to state 24
- '^' shift, and go to state 25
- '&' shift, and go to state 26
- NE shift, and go to state 27
- EQ shift, and go to state 28
- '<' shift, and go to state 29
- '>' shift, and go to state 30
- GE shift, and go to state 31
- LE shift, and go to state 32
- '+' shift, and go to state 33
- '-' shift, and go to state 34
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
-
-
-state 14
-
- 17 value: FUNC .
-
- $default reduce using rule 17 (value)
-
-
-state 15
-
- 29 value: '(' . value ')'
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 38
-
-
-state 16
-
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
- 28 | '-' value .
-
- $default reduce using rule 28 (value)
-
-
-state 17
-
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
- 26 | '!' value .
-
- $default reduce using rule 26 (value)
-
-
-state 18
-
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
- 27 | '~' value .
-
- $default reduce using rule 27 (value)
-
-
-state 19
-
- 3 expr: expr . OR expr
- 4 | expr . AND expr
- 5 | '(' expr . ')'
-
- OR shift, and go to state 22
- AND shift, and go to state 23
- ')' shift, and go to state 39
-
-
-state 20
-
- 8 rowlist: value . EQ value
- 9 | value . NE value
- 10 | value . '<' value
- 11 | value . LE value
- 12 | value . '>' value
- 13 | value . GE value
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
- 29 | '(' value . ')'
-
- '|' shift, and go to state 24
- '^' shift, and go to state 25
- '&' shift, and go to state 26
- NE shift, and go to state 27
- EQ shift, and go to state 28
- '<' shift, and go to state 29
- '>' shift, and go to state 30
- GE shift, and go to state 31
- LE shift, and go to state 32
- '+' shift, and go to state 33
- '-' shift, and go to state 34
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
- ')' shift, and go to state 40
-
-
-state 21
-
- 0 $accept: idx $end .
-
- $default accept
-
-
-state 22
-
- 3 expr: expr OR . expr
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 3
- REG shift, and go to state 4
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 9
-
- expr go to state 41
- rowlist go to state 12
- value go to state 13
-
-
-state 23
-
- 4 expr: expr AND . expr
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 3
- REG shift, and go to state 4
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 9
-
- expr go to state 42
- rowlist go to state 12
- value go to state 13
-
-
-state 24
-
- 24 value: value '|' . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 43
-
-
-state 25
-
- 25 value: value '^' . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 44
-
-
-state 26
-
- 23 value: value '&' . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 45
-
-
-state 27
-
- 9 rowlist: value NE . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 46
-
-
-state 28
-
- 8 rowlist: value EQ . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 47
-
-
-state 29
-
- 10 rowlist: value '<' . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 48
-
-
-state 30
-
- 12 rowlist: value '>' . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 49
-
-
-state 31
-
- 13 rowlist: value GE . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 50
-
-
-state 32
-
- 11 rowlist: value LE . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 51
-
-
-state 33
-
- 18 value: value '+' . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 52
-
-
-state 34
-
- 19 value: value '-' . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 53
-
-
-state 35
-
- 20 value: value '*' . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 54
-
-
-state 36
-
- 21 value: value '/' . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 55
-
-
-state 37
-
- 22 value: value '%' . value
-
- NUM shift, and go to state 1
- COL shift, and go to state 2
- FUNC shift, and go to state 14
- INDEF shift, and go to state 5
- '-' shift, and go to state 6
- '!' shift, and go to state 7
- '~' shift, and go to state 8
- '(' shift, and go to state 15
-
- value go to state 56
-
-
-state 38
-
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
- 29 | '(' value . ')'
-
- '|' shift, and go to state 24
- '^' shift, and go to state 25
- '&' shift, and go to state 26
- '+' shift, and go to state 33
- '-' shift, and go to state 34
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
- ')' shift, and go to state 40
-
-
-state 39
-
- 5 expr: '(' expr ')' .
-
- $default reduce using rule 5 (expr)
-
-
-state 40
-
- 29 value: '(' value ')' .
-
- $default reduce using rule 29 (value)
-
-
-state 41
-
- 3 expr: expr . OR expr
- 3 | expr OR expr .
- 4 | expr . AND expr
-
- AND shift, and go to state 23
-
- $default reduce using rule 3 (expr)
-
-
-state 42
-
- 3 expr: expr . OR expr
- 4 | expr . AND expr
- 4 | expr AND expr .
-
- $default reduce using rule 4 (expr)
-
-
-state 43
-
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 24 | value '|' value .
- 25 | value . '^' value
-
- '^' shift, and go to state 25
- '&' shift, and go to state 26
- '+' shift, and go to state 33
- '-' shift, and go to state 34
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
-
- $default reduce using rule 24 (value)
-
-
-state 44
-
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
- 25 | value '^' value .
-
- '&' shift, and go to state 26
- '+' shift, and go to state 33
- '-' shift, and go to state 34
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
-
- $default reduce using rule 25 (value)
-
-
-state 45
-
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 23 | value '&' value .
- 24 | value . '|' value
- 25 | value . '^' value
-
- '+' shift, and go to state 33
- '-' shift, and go to state 34
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
-
- $default reduce using rule 23 (value)
-
-
-state 46
-
- 9 rowlist: value NE value .
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
-
- '|' shift, and go to state 24
- '^' shift, and go to state 25
- '&' shift, and go to state 26
- '+' shift, and go to state 33
- '-' shift, and go to state 34
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
-
- $default reduce using rule 9 (rowlist)
-
-
-state 47
-
- 8 rowlist: value EQ value .
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
-
- '|' shift, and go to state 24
- '^' shift, and go to state 25
- '&' shift, and go to state 26
- '+' shift, and go to state 33
- '-' shift, and go to state 34
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
-
- $default reduce using rule 8 (rowlist)
-
-
-state 48
-
- 10 rowlist: value '<' value .
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
-
- '|' shift, and go to state 24
- '^' shift, and go to state 25
- '&' shift, and go to state 26
- '+' shift, and go to state 33
- '-' shift, and go to state 34
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
-
- $default reduce using rule 10 (rowlist)
-
-
-state 49
-
- 12 rowlist: value '>' value .
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
-
- '|' shift, and go to state 24
- '^' shift, and go to state 25
- '&' shift, and go to state 26
- '+' shift, and go to state 33
- '-' shift, and go to state 34
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
-
- $default reduce using rule 12 (rowlist)
-
-
-state 50
-
- 13 rowlist: value GE value .
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
-
- '|' shift, and go to state 24
- '^' shift, and go to state 25
- '&' shift, and go to state 26
- '+' shift, and go to state 33
- '-' shift, and go to state 34
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
-
- $default reduce using rule 13 (rowlist)
-
-
-state 51
-
- 11 rowlist: value LE value .
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
-
- '|' shift, and go to state 24
- '^' shift, and go to state 25
- '&' shift, and go to state 26
- '+' shift, and go to state 33
- '-' shift, and go to state 34
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
-
- $default reduce using rule 11 (rowlist)
-
-
-state 52
-
- 18 value: value . '+' value
- 18 | value '+' value .
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
-
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
-
- $default reduce using rule 18 (value)
-
-
-state 53
-
- 18 value: value . '+' value
- 19 | value . '-' value
- 19 | value '-' value .
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
-
- '*' shift, and go to state 35
- '/' shift, and go to state 36
- '%' shift, and go to state 37
-
- $default reduce using rule 19 (value)
-
-
-state 54
-
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 20 | value '*' value .
- 21 | value . '/' value
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
-
- $default reduce using rule 20 (value)
-
-
-state 55
-
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 21 | value '/' value .
- 22 | value . '%' value
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
-
- $default reduce using rule 21 (value)
-
-
-state 56
-
- 18 value: value . '+' value
- 19 | value . '-' value
- 20 | value . '*' value
- 21 | value . '/' value
- 22 | value . '%' value
- 22 | value '%' value .
- 23 | value . '&' value
- 24 | value . '|' value
- 25 | value . '^' value
-
- $default reduce using rule 22 (value)
diff --git a/funtools/filter/idx.tab.c b/funtools/filter/idx.tab.c
deleted file mode 100644
index d38c8af..0000000
--- a/funtools/filter/idx.tab.c
+++ /dev/null
@@ -1,2177 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.0. */
-
-/* Skeleton parser for GLR parsing with Bison,
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This is the parser code for GLR (Generalized LR) parser. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <setjmp.h>
-
-/* Identify Bison output. */
-#define YYBISON 1
-
-/* Skeleton name. */
-#define YYSKELETON_NAME "glr.c"
-
-/* Pure parsers. */
-#define YYPURE 0
-
-/* Using locations. */
-#define YYLSP_NEEDED 0
-
-/* Substitute the variable and function names. */
-#define yyparse idxparse
-#define yylex idxlex
-#define yyerror idxerror
-#define yylval idxlval
-#define yychar idxchar
-#define yydebug idxdebug
-#define yynerrs idxnerrs
-#define yylloc idxlloc
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- NUM = 258,
- COL = 259,
- FUNC = 260,
- REG = 261,
- INDEF = 262,
- OR = 263,
- AND = 264,
- NE = 265,
- EQ = 266,
- GE = 267,
- LE = 268,
- UMINUS = 269
- };
-#endif
-#define NUM 258
-#define COL 259
-#define FUNC 260
-#define REG 261
-#define INDEF 262
-#define OR 263
-#define AND 264
-#define NE 265
-#define EQ 266
-#define GE 267
-#define LE 268
-#define UMINUS 269
-
-
-
-
-/* Copy the first part of user declarations. */
-#line 1 "idx.y"
-
-#include <idx.h>
-#include <idx.tab.h>
-
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 6 "idx.y"
-typedef union YYSTYPE {
- idxrowrec *row;
- idxvalrec *val;
-} YYSTYPE;
-/* Line 186 of glr.c. */
-#line 115 "idx.tab.c"
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
-typedef struct YYLTYPE
-{
-
- char yydummy;
-
-} YYLTYPE;
-# define YYLTYPE_IS_DECLARED 1
-# define YYLTYPE_IS_TRIVIAL 1
-#endif
-
-/* Default (constant) value used for initialization for null
- right-hand sides. Unlike the standard yacc.c template,
- here we set the default value of $$ to a zeroed-out value.
- Since the default value is undefined, this behavior is
- technically correct. */
-static YYSTYPE yyval_default;
-
-/* Copy the second part of user declarations. */
-
-
-/* Line 217 of glr.c. */
-#line 142 "idx.tab.c"
-
-#ifndef YYFREE
-# define YYFREE free
-#endif
-#ifndef YYMALLOC
-# define YYMALLOC malloc
-#endif
-#ifndef YYREALLOC
-# define YYREALLOC realloc
-#endif
-
-#ifdef __cplusplus
- typedef bool yybool;
-#else
- typedef unsigned char yybool;
-#endif
-#define yytrue 1
-#define yyfalse 0
-
-/*-----------------.
-| GCC extensions. |
-`-----------------*/
-
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if !defined (__GNUC__) || __GNUC__ < 2 || \
-(__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
-# define __attribute__(Spec) /* empty */
-# endif
-#endif
-
-#ifndef YYASSERT
-# define YYASSERT(condition) ((void) ((condition) || (abort (), 0)))
-#endif
-
-#ifndef ATTRIBUTE_UNUSED
-# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
-#endif
-
-/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 21
-/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 143
-
-/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 29
-/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 5
-/* YYNRULES -- Number of rules. */
-#define YYNRULES 30
-/* YYNRULES -- Number of states. */
-#define YYNSTATES 57
-/* YYMAXRHS -- Maximum number of symbols on right-hand side of rule. */
-#define YYMAXRHS 3
-/* YYMAXLEFT -- Maximum number of symbols to the left of a handle
- accessed by $0, $-1, etc., in any rule. */
-#define YYMAXLEFT 0
-
-/* YYTRANSLATE(X) -- Bison symbol number corresponding to X. */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 269
-
-#define YYTRANSLATE(YYX) \
- ((YYX <= 0) ? YYEOF : \
- (unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const unsigned char yytranslate[] =
-{
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 24, 2, 2, 2, 23, 12, 2,
- 27, 28, 21, 19, 2, 20, 2, 22, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 15, 2, 16, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 11, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 10, 2, 25, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
- 5, 6, 7, 8, 9, 13, 14, 17, 18, 26
-};
-
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const unsigned char yyprhs[] =
-{
- 0, 0, 3, 5, 7, 11, 15, 19, 21, 23,
- 27, 31, 35, 39, 43, 47, 49, 51, 53, 55,
- 59, 63, 67, 71, 75, 79, 83, 87, 90, 93,
- 96
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const signed char yyrhs[] =
-{
- 30, 0, -1, 31, -1, 32, -1, 31, 8, 31,
- -1, 31, 9, 31, -1, 27, 31, 28, -1, 6,
- -1, 5, -1, 33, 14, 33, -1, 33, 13, 33,
- -1, 33, 15, 33, -1, 33, 18, 33, -1, 33,
- 16, 33, -1, 33, 17, 33, -1, 3, -1, 4,
- -1, 7, -1, 5, -1, 33, 19, 33, -1, 33,
- 20, 33, -1, 33, 21, 33, -1, 33, 22, 33,
- -1, 33, 23, 33, -1, 33, 12, 33, -1, 33,
- 10, 33, -1, 33, 11, 33, -1, 24, 33, -1,
- 25, 33, -1, 20, 33, -1, 27, 33, 28, -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const unsigned char yyrline[] =
-{
- 0, 39, 39, 42, 43, 44, 45, 49, 50, 51,
- 52, 53, 54, 55, 56, 59, 60, 61, 62, 63,
- 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- 74
-};
-#endif
-
-#if (YYDEBUG) || YYERROR_VERBOSE
-/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
-static const char *const yytname[] =
-{
- "$end", "error", "$undefined", "NUM", "COL", "FUNC", "REG", "INDEF",
- "OR", "AND", "'|'", "'^'", "'&'", "NE", "EQ", "'<'", "'>'", "GE", "LE",
- "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "'~'", "UMINUS", "'('", "')'",
- "$accept", "idx", "expr", "rowlist", "value", 0
-};
-#endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const unsigned char yyr1[] =
-{
- 0, 29, 30, 31, 31, 31, 31, 32, 32, 32,
- 32, 32, 32, 32, 32, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const unsigned char yyr2[] =
-{
- 0, 2, 1, 1, 3, 3, 3, 1, 1, 3,
- 3, 3, 3, 3, 3, 1, 1, 1, 1, 3,
- 3, 3, 3, 3, 3, 3, 3, 2, 2, 2,
- 3
-};
-
-/* YYDPREC[RULE-NUM] -- Dynamic precedence of rule #RULE-NUM (0 if none). */
-static const unsigned char yydprec[] =
-{
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0
-};
-
-/* YYMERGER[RULE-NUM] -- Index of merging function for rule #RULE-NUM. */
-static const unsigned char yymerger[] =
-{
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0
-};
-
-/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
- doesn't specify something else to do. Zero means the default is an
- error. */
-static const unsigned char yydefact[] =
-{
- 0, 15, 16, 18, 7, 17, 0, 0, 0, 0,
- 0, 2, 3, 0, 18, 0, 29, 27, 28, 0,
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
- 30, 4, 5, 25, 26, 24, 10, 9, 11, 13,
- 14, 12, 19, 20, 21, 22, 23
-};
-
-/* YYPDEFGOTO[NTERM-NUM]. */
-static const signed char yydefgoto[] =
-{
- -1, 10, 11, 12, 13
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -17
-static const signed char yypact[] =
-{
- 30, -17, -17, 4, -17, -17, 36, 36, 36, 30,
- 8, 2, -17, 89, -17, 36, -17, -17, -17, 37,
- 56, -17, 30, 30, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 70, -17,
- -17, 5, -17, 108, 120, 114, 103, 103, 103, 103,
- 103, 103, -16, -16, -17, -17, -17
-};
-
-/* YYPGOTO[NTERM-NUM]. */
-static const signed char yypgoto[] =
-{
- -17, -17, 29, -17, -6
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -9
-static const signed char yytable[] =
-{
- 16, 17, 18, 20, -8, 35, 36, 37, 21, 38,
- 22, 23, -8, -8, 23, 0, 0, 0, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, -8, 1, 2, 3, 4, 5, 19, 1,
- 2, 14, 0, 5, 0, 22, 23, 0, 0, 0,
- 6, 41, 42, 0, 7, 8, 6, 9, 0, 0,
- 7, 8, 0, 15, 0, 39, 24, 25, 26, 27,
- 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
- 24, 25, 26, 0, 40, 0, 0, 0, 0, 33,
- 34, 35, 36, 37, 0, 0, 0, 0, 40, 24,
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
- 35, 36, 37, 24, 25, 26, 0, 0, 0, 25,
- 26, 0, 33, 34, 35, 36, 37, 33, 34, 35,
- 36, 37, 26, 33, 34, 35, 36, 37, 0, 33,
- 34, 35, 36, 37
-};
-
-/* YYCONFLP[YYPACT[STATE-NUM]] -- Pointer into YYCONFL of start of
- list of conflicting reductions corresponding to action entry for
- state STATE-NUM in yytable. 0 means no conflicts. The list in
- yyconfl is terminated by a rule number of 0. */
-static const unsigned char yyconflp[] =
-{
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0
-};
-
-/* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by
- 0, pointed into by YYCONFLP. */
-static const short int yyconfl[] =
-{
- 0, 18, 0
-};
-
-static const signed char yycheck[] =
-{
- 6, 7, 8, 9, 0, 21, 22, 23, 0, 15,
- 8, 9, 8, 9, 9, -1, -1, -1, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 28, 3, 4, 5, 6, 7, 9, 3,
- 4, 5, -1, 7, -1, 8, 9, -1, -1, -1,
- 20, 22, 23, -1, 24, 25, 20, 27, -1, -1,
- 24, 25, -1, 27, -1, 28, 10, 11, 12, 13,
- 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
- 10, 11, 12, -1, 28, -1, -1, -1, -1, 19,
- 20, 21, 22, 23, -1, -1, -1, -1, 28, 10,
- 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 10, 11, 12, -1, -1, -1, 11,
- 12, -1, 19, 20, 21, 22, 23, 19, 20, 21,
- 22, 23, 12, 19, 20, 21, 22, 23, -1, 19,
- 20, 21, 22, 23
-};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const unsigned char yystos[] =
-{
- 0, 3, 4, 5, 6, 7, 20, 24, 25, 27,
- 30, 31, 32, 33, 5, 27, 33, 33, 33, 31,
- 33, 0, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 33, 28,
- 28, 31, 31, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33
-};
-
-
-/* Prevent warning if -Wmissing-prototypes. */
-int yyparse (void);
-
-/* Error token number */
-#define YYTERROR 1
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) ((void) 0)
-#endif
-
-
-#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-#define YYLEX yylex ()
-
-YYSTYPE yylval;
-
-YYLTYPE yylloc;
-
-int yynerrs;
-int yychar;
-
-static const int YYEOF = 0;
-static const int YYEMPTY = -2;
-
-typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG;
-
-#define YYCHK(YYE) \
- do { YYRESULTTAG yyflag = YYE; if (yyflag != yyok) return yyflag; } \
- while (0)
-
-#if YYDEBUG
-
-#if ! defined (YYFPRINTF)
-# define YYFPRINTF fprintf
-#endif
-
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (0)
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
-
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- switch (yytype)
- {
- default:
- break;
- }
- YYFPRINTF (yyoutput, ")");
-}
-
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yysymprint (stderr, \
- Type, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (0)
-
-/* Nonzero means print parse trace. It is left uninitialized so that
- multiple parsers can coexist. */
-int yydebug;
-
-#else /* !YYDEBUG */
-
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-
-#endif /* !YYDEBUG */
-
-/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
- if the built-in stack extension method is used).
-
- Do not make this value too large; the results are undefined if
- SIZE_MAX < YYMAXDEPTH * sizeof (GLRStackItem)
- evaluated with infinite-precision integer arithmetic. */
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-/* Minimum number of free items on the stack allowed after an
- allocation. This is to allow allocation and initialization
- to be completed by functions that call expandGLRStack before the
- stack is expanded, thus insuring that all necessary pointers get
- properly redirected to new data. */
-#define YYHEADROOM 2
-
-#if (! defined (YYSTACKEXPANDABLE) \
- && (! defined (__cplusplus) \
- || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
-#define YYSTACKEXPANDABLE 1
-#else
-#define YYSTACKEXPANDABLE 0
-#endif
-
-/** State numbers, as in LALR(1) machine */
-typedef int yyStateNum;
-
-/** Rule numbers, as in LALR(1) machine */
-typedef int yyRuleNum;
-
-/** Grammar symbol */
-typedef short int yySymbol;
-
-/** Item references, as in LALR(1) machine */
-typedef short int yyItemNum;
-
-typedef struct yyGLRState yyGLRState;
-typedef struct yySemanticOption yySemanticOption;
-typedef union yyGLRStackItem yyGLRStackItem;
-typedef struct yyGLRStack yyGLRStack;
-typedef struct yyGLRStateSet yyGLRStateSet;
-
-struct yyGLRState {
- yybool yyisState;
- yybool yyresolved;
- yyStateNum yylrState;
- yyGLRState* yypred;
- size_t yyposn;
- union {
- yySemanticOption* yyfirstVal;
- YYSTYPE yysval;
- } yysemantics;
- YYLTYPE yyloc;
-};
-
-struct yyGLRStateSet {
- yyGLRState** yystates;
- size_t yysize, yycapacity;
-};
-
-struct yySemanticOption {
- yybool yyisState;
- yyRuleNum yyrule;
- yyGLRState* yystate;
- yySemanticOption* yynext;
-};
-
-union yyGLRStackItem {
- yyGLRState yystate;
- yySemanticOption yyoption;
-};
-
-struct yyGLRStack {
- int yyerrflag;
- int yyerrState;
-
-
- yySymbol* yytokenp;
- jmp_buf yyexception_buffer;
- yyGLRStackItem* yyitems;
- yyGLRStackItem* yynextFree;
- int yyspaceLeft;
- yyGLRState* yysplitPoint;
- yyGLRState* yylastDeleted;
- yyGLRStateSet yytops;
-};
-
-static void yyinitGLRStack (yyGLRStack* yystack, size_t yysize);
-static void yyexpandGLRStack (yyGLRStack* yystack);
-static void yyfreeGLRStack (yyGLRStack* yystack);
-
-static void
-yyFail (yyGLRStack* yystack, const char* yyformat, ...)
-{
- yystack->yyerrflag = 1;
- if (yyformat != NULL)
- {
- char yymsg[256];
- va_list yyap;
- va_start (yyap, yyformat);
- vsprintf (yymsg, yyformat, yyap);
- yyerror (yymsg);
- }
- longjmp (yystack->yyexception_buffer, 1);
-}
-
-#if YYDEBUG || YYERROR_VERBOSE
-/** A printable representation of TOKEN. Valid until next call to
- * tokenName. */
-static inline const char*
-yytokenName (yySymbol yytoken)
-{
- if (yytoken == YYEMPTY)
- return "";
-
- return yytname[yytoken];
-}
-#endif
-
-/** Fill in YYVSP[YYLOW1 .. YYLOW0-1] from the chain of states starting
- * at YYVSP[YYLOW0].yystate.yypred. Leaves YYVSP[YYLOW1].yystate.yypred
- * containing the pointer to the next state in the chain. Assumes
- * YYLOW1 < YYLOW0. */
-static void yyfillin (yyGLRStackItem *, int, int) ATTRIBUTE_UNUSED;
-static void
-yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
-{
- yyGLRState* s;
- int i;
- s = yyvsp[yylow0].yystate.yypred;
- for (i = yylow0-1; i >= yylow1; i -= 1)
- {
- YYASSERT (s->yyresolved);
- yyvsp[i].yystate.yyresolved = yytrue;
- yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval;
- yyvsp[i].yystate.yyloc = s->yyloc;
- s = yyvsp[i].yystate.yypred = s->yypred;
- }
-}
-
-/* Do nothing if YYNORMAL or if *YYLOW <= YYLOW1. Otherwise, fill in
- YYVSP[YYLOW1 .. *YYLOW-1] as in yyfillin and set *YYLOW = YYLOW1.
- For convenience, always return YYLOW1. */
-static inline int yyfill (yyGLRStackItem *, int *, int, yybool)
- ATTRIBUTE_UNUSED;
-static inline int
-yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal)
-{
- if (!yynormal && yylow1 < *yylow)
- {
- yyfillin (yyvsp, *yylow, yylow1);
- *yylow = yylow1;
- }
- return yylow1;
-}
-
-/** Perform user action for rule number YYN, with RHS length YYRHSLEN,
- * and top stack item YYVSP. YYLVALP points to place to put semantic
- * value ($$), and yylocp points to place for location information
- * (@$). Returns yyok for normal return, yyaccept for YYACCEPT,
- * yyerr for YYERROR, yyabort for YYABORT. */
-static YYRESULTTAG
-yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
- YYSTYPE* yyvalp,
- YYLTYPE* yylocp ATTRIBUTE_UNUSED,
- yyGLRStack* yystack
- )
-{
- yybool yynormal ATTRIBUTE_UNUSED = (yystack->yysplitPoint == NULL);
- int yylow;
-
-# undef yyerrok
-# define yyerrok (yystack->yyerrState = 0)
-# undef YYACCEPT
-# define YYACCEPT return yyaccept
-# undef YYABORT
-# define YYABORT return yyabort
-# undef YYERROR
-# define YYERROR return yyerrok, yyerr
-# undef YYRECOVERING
-# define YYRECOVERING (yystack->yyerrState != 0)
-# undef yyclearin
-# define yyclearin (yychar = *(yystack->yytokenp) = YYEMPTY)
-# undef YYFILL
-# define YYFILL(N) yyfill (yyvsp, &yylow, N, yynormal)
-# undef YYBACKUP
-# define YYBACKUP(Token, Value) \
- return yyerror ("syntax error: cannot back up"), \
- yyerrok, yyerr
-
- yylow = 1;
- if (yyrhslen == 0)
- *yyvalp = yyval_default;
- else
- *yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval;
- YYLLOC_DEFAULT (*yylocp, yyvsp - yyrhslen, yyrhslen);
-
- switch (yyn)
- {
- case 2:
-#line 39 "idx.y"
- { idxall((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.row)); ;}
- break;
-
- case 4:
-#line 43 "idx.y"
- { ((*yyvalp).row) = idxor((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.row),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.row)); ;}
- break;
-
- case 5:
-#line 44 "idx.y"
- { ((*yyvalp).row) = idxand((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.row),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.row)); ;}
- break;
-
- case 6:
-#line 45 "idx.y"
- { ((*yyvalp).row) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.row); ;}
- break;
-
- case 7:
-#line 49 "idx.y"
- { ((*yyvalp).row) = idxrowreg((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 8:
-#line 50 "idx.y"
- { ((*yyvalp).row) = idxrowfun((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 9:
-#line 51 "idx.y"
- { ((*yyvalp).row) = idxroweq((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 10:
-#line 52 "idx.y"
- { ((*yyvalp).row) = idxrowne((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 11:
-#line 53 "idx.y"
- { ((*yyvalp).row) = idxrowlt((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 12:
-#line 54 "idx.y"
- { ((*yyvalp).row) = idxrowle((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 13:
-#line 55 "idx.y"
- { ((*yyvalp).row) = idxrowgt((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 14:
-#line 56 "idx.y"
- { ((*yyvalp).row) = idxrowge((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 19:
-#line 63 "idx.y"
- { ((*yyvalp).val) = idxvaladd((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 20:
-#line 64 "idx.y"
- { ((*yyvalp).val) = idxvalsub((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 21:
-#line 65 "idx.y"
- { ((*yyvalp).val) = idxvalmul((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 22:
-#line 66 "idx.y"
- { ((*yyvalp).val) = idxvaldiv((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 23:
-#line 67 "idx.y"
- { ((*yyvalp).val) = idxvalmod((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 24:
-#line 68 "idx.y"
- { ((*yyvalp).val) = idxvaland((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 25:
-#line 69 "idx.y"
- { ((*yyvalp).val) = idxvalor((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 26:
-#line 70 "idx.y"
- { ((*yyvalp).val) = idxvalxor((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval.val),(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 27:
-#line 71 "idx.y"
- { ((*yyvalp).val) = idxvalnot((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 28:
-#line 72 "idx.y"
- { ((*yyvalp).val) = idxvalcom((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 29:
-#line 73 "idx.y"
- { ((*yyvalp).val) = idxvalmin((((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval.val)); ;}
- break;
-
- case 30:
-#line 74 "idx.y"
- { ((*yyvalp).val) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval.val); ;}
- break;
-
-
- }
-
- return yyok;
-# undef yyerrok
-# undef YYABORT
-# undef YYACCEPT
-# undef YYERROR
-# undef YYBACKUP
-# undef yyclearin
-# undef YYRECOVERING
-/* Line 750 of glr.c. */
-#line 890 "idx.tab.c"
-}
-
-
-static void
-yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1)
-{
- /* `Use' the arguments. */
- (void) yy0;
- (void) yy1;
-
- switch (yyn)
- {
-
- }
-}
-
- /* Bison grammar-table manipulation. */
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol. |
-`-----------------------------------------------*/
-
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
-{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
- if (!yymsg)
- yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
- switch (yytype)
- {
-
- default:
- break;
- }
-}
-
-/** Number of symbols composing the right hand side of rule #RULE. */
-static inline int
-yyrhsLength (yyRuleNum yyrule)
-{
- return yyr2[yyrule];
-}
-
-/** Left-hand-side symbol for rule #RULE. */
-static inline yySymbol
-yylhsNonterm (yyRuleNum yyrule)
-{
- return yyr1[yyrule];
-}
-
-#define yyis_pact_ninf(yystate) \
- ((yystate) == YYPACT_NINF)
-
-/** True iff LR state STATE has only a default reduction (regardless
- * of token). */
-static inline yybool
-yyisDefaultedState (yyStateNum yystate)
-{
- return yyis_pact_ninf (yypact[yystate]);
-}
-
-/** The default reduction for STATE, assuming it has one. */
-static inline yyRuleNum
-yydefaultAction (yyStateNum yystate)
-{
- return yydefact[yystate];
-}
-
-#define yyis_table_ninf(yytable_value) \
- 0
-
-/** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN.
- * Result R means
- * R < 0: Reduce on rule -R.
- * R = 0: Error.
- * R > 0: Shift to state R.
- * Set *CONFLICTS to a pointer into yyconfl to 0-terminated list of
- * conflicting reductions.
- */
-static inline void
-yygetLRActions (yyStateNum yystate, int yytoken,
- int* yyaction, const short int** yyconflicts)
-{
- int yyindex = yypact[yystate] + yytoken;
- if (yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken)
- {
- *yyaction = -yydefact[yystate];
- *yyconflicts = yyconfl;
- }
- else if (! yyis_table_ninf (yytable[yyindex]))
- {
- *yyaction = yytable[yyindex];
- *yyconflicts = yyconfl + yyconflp[yyindex];
- }
- else
- {
- *yyaction = 0;
- *yyconflicts = yyconfl + yyconflp[yyindex];
- }
-}
-
-static inline yyStateNum
-yyLRgotoState (yyStateNum yystate, yySymbol yylhs)
-{
- int yyr;
- yyr = yypgoto[yylhs - YYNTOKENS] + yystate;
- if (0 <= yyr && yyr <= YYLAST && yycheck[yyr] == yystate)
- return yytable[yyr];
- else
- return yydefgoto[yylhs - YYNTOKENS];
-}
-
-static inline yybool
-yyisShiftAction (int yyaction)
-{
- return 0 < yyaction;
-}
-
-static inline yybool
-yyisErrorAction (int yyaction)
-{
- return yyaction == 0;
-}
-
- /* GLRStates */
-
-static void
-yyaddDeferredAction (yyGLRStack* yystack, yyGLRState* yystate,
- yyGLRState* rhs, yyRuleNum yyrule)
-{
- yySemanticOption* yynewItem;
- yynewItem = &yystack->yynextFree->yyoption;
- yystack->yyspaceLeft -= 1;
- yystack->yynextFree += 1;
- yynewItem->yyisState = yyfalse;
- yynewItem->yystate = rhs;
- yynewItem->yyrule = yyrule;
- yynewItem->yynext = yystate->yysemantics.yyfirstVal;
- yystate->yysemantics.yyfirstVal = yynewItem;
- if (yystack->yyspaceLeft < YYHEADROOM)
- yyexpandGLRStack (yystack);
-}
-
- /* GLRStacks */
-
-/** Initialize SET to a singleton set containing an empty stack. */
-static void
-yyinitStateSet (yyGLRStateSet* yyset)
-{
- yyset->yysize = 1;
- yyset->yycapacity = 16;
- yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]);
- yyset->yystates[0] = NULL;
-}
-
-static void yyfreeStateSet (yyGLRStateSet* yyset)
-{
- YYFREE (yyset->yystates);
-}
-
-/** Initialize STACK to a single empty stack, with total maximum
- * capacity for all stacks of SIZE. */
-static void
-yyinitGLRStack (yyGLRStack* yystack, size_t yysize)
-{
- yystack->yyerrflag = 0;
- yystack->yyerrState = 0;
- yynerrs = 0;
- yystack->yyspaceLeft = yysize;
- yystack->yynextFree = yystack->yyitems =
- (yyGLRStackItem*) YYMALLOC (yysize * sizeof yystack->yynextFree[0]);
- yystack->yysplitPoint = NULL;
- yystack->yylastDeleted = NULL;
- yyinitStateSet (&yystack->yytops);
-}
-
-#define YYRELOC(YYFROMITEMS,YYTOITEMS,YYX,YYTYPE) \
- &((YYTOITEMS) - ((YYFROMITEMS) - (yyGLRStackItem*) (YYX)))->YYTYPE
-
-/** If STACK is expandable, extend it. WARNING: Pointers into the
- stack from outside should be considered invalid after this call.
- We always expand when there are 1 or fewer items left AFTER an
- allocation, so that we can avoid having external pointers exist
- across an allocation. */
-static void
-yyexpandGLRStack (yyGLRStack* yystack)
-{
-#if YYSTACKEXPANDABLE
- yyGLRStack yynewStack;
- yyGLRStackItem* yyp0, *yyp1;
- size_t yysize, yynewSize;
- size_t yyn;
- yysize = yystack->yynextFree - yystack->yyitems;
- if (YYMAXDEPTH <= yysize)
- yyFail (yystack, "parser stack overflow");
- yynewSize = 2*yysize;
- if (YYMAXDEPTH < yynewSize)
- yynewSize = YYMAXDEPTH;
- yyinitGLRStack (&yynewStack, yynewSize);
- for (yyp0 = yystack->yyitems, yyp1 = yynewStack.yyitems, yyn = yysize;
- 0 < yyn;
- yyn -= 1, yyp0 += 1, yyp1 += 1)
- {
- *yyp1 = *yyp0;
- if (*(yybool *) yyp0)
- {
- yyGLRState* yys0 = &yyp0->yystate;
- yyGLRState* yys1 = &yyp1->yystate;
- if (yys0->yypred != NULL)
- yys1->yypred =
- YYRELOC (yyp0, yyp1, yys0->yypred, yystate);
- if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != NULL)
- yys1->yysemantics.yyfirstVal =
- YYRELOC(yyp0, yyp1, yys0->yysemantics.yyfirstVal, yyoption);
- }
- else
- {
- yySemanticOption* yyv0 = &yyp0->yyoption;
- yySemanticOption* yyv1 = &yyp1->yyoption;
- if (yyv0->yystate != NULL)
- yyv1->yystate = YYRELOC (yyp0, yyp1, yyv0->yystate, yystate);
- if (yyv0->yynext != NULL)
- yyv1->yynext = YYRELOC (yyp0, yyp1, yyv0->yynext, yyoption);
- }
- }
- if (yystack->yysplitPoint != NULL)
- yystack->yysplitPoint = YYRELOC (yystack->yyitems, yynewStack.yyitems,
- yystack->yysplitPoint, yystate);
-
- for (yyn = 0; yyn < yystack->yytops.yysize; yyn += 1)
- if (yystack->yytops.yystates[yyn] != NULL)
- yystack->yytops.yystates[yyn] =
- YYRELOC (yystack->yyitems, yynewStack.yyitems,
- yystack->yytops.yystates[yyn], yystate);
- YYFREE (yystack->yyitems);
- yystack->yyitems = yynewStack.yyitems;
- yystack->yynextFree = yynewStack.yynextFree + yysize;
- yystack->yyspaceLeft = yynewStack.yyspaceLeft - yysize;
-
-#else
-
- yyFail (yystack, "parser stack overflow");
-#endif
-}
-
-static void
-yyfreeGLRStack (yyGLRStack* yystack)
-{
- YYFREE (yystack->yyitems);
- yyfreeStateSet (&yystack->yytops);
-}
-
-/** Assuming that S is a GLRState somewhere on STACK, update the
- * splitpoint of STACK, if needed, so that it is at least as deep as
- * S. */
-static inline void
-yyupdateSplit (yyGLRStack* yystack, yyGLRState* yys)
-{
- if (yystack->yysplitPoint != NULL && yystack->yysplitPoint > yys)
- yystack->yysplitPoint = yys;
-}
-
-/** Invalidate stack #K in STACK. */
-static inline void
-yymarkStackDeleted (yyGLRStack* yystack, int yyk)
-{
- if (yystack->yytops.yystates[yyk] != NULL)
- yystack->yylastDeleted = yystack->yytops.yystates[yyk];
- yystack->yytops.yystates[yyk] = NULL;
-}
-
-/** Undelete the last stack that was marked as deleted. Can only be
- done once after a deletion, and only when all other stacks have
- been deleted. */
-static void
-yyundeleteLastStack (yyGLRStack* yystack)
-{
- if (yystack->yylastDeleted == NULL || yystack->yytops.yysize != 0)
- return;
- yystack->yytops.yystates[0] = yystack->yylastDeleted;
- yystack->yytops.yysize = 1;
- YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
- yystack->yylastDeleted = NULL;
-}
-
-static inline void
-yyremoveDeletes (yyGLRStack* yystack)
-{
- size_t yyi, yyj;
- yyi = yyj = 0;
- while (yyj < yystack->yytops.yysize)
- {
- if (yystack->yytops.yystates[yyi] == NULL)
- {
- if (yyi == yyj)
- {
- YYDPRINTF ((stderr, "Removing dead stacks.\n"));
- }
- yystack->yytops.yysize -= 1;
- }
- else
- {
- yystack->yytops.yystates[yyj] = yystack->yytops.yystates[yyi];
- if (yyj != yyi)
- {
- YYDPRINTF ((stderr, "Rename stack %lu -> %lu.\n",
- (unsigned long int) yyi, (unsigned long int) yyj));
- }
- yyj += 1;
- }
- yyi += 1;
- }
-}
-
-/** Shift to a new state on stack #K of STACK, corresponding to LR state
- * LRSTATE, at input position POSN, with (resolved) semantic value SVAL. */
-static inline void
-yyglrShift (yyGLRStack* yystack, int yyk, yyStateNum yylrState, size_t yyposn,
- YYSTYPE yysval, YYLTYPE* yylocp)
-{
- yyGLRStackItem* yynewItem;
-
- yynewItem = yystack->yynextFree;
- yystack->yynextFree += 1;
- yystack->yyspaceLeft -= 1;
- yynewItem->yystate.yyisState = yytrue;
- yynewItem->yystate.yylrState = yylrState;
- yynewItem->yystate.yyposn = yyposn;
- yynewItem->yystate.yyresolved = yytrue;
- yynewItem->yystate.yypred = yystack->yytops.yystates[yyk];
- yystack->yytops.yystates[yyk] = &yynewItem->yystate;
- yynewItem->yystate.yysemantics.yysval = yysval;
- yynewItem->yystate.yyloc = *yylocp;
- if (yystack->yyspaceLeft < YYHEADROOM)
- yyexpandGLRStack (yystack);
-}
-
-/** Shift stack #K of YYSTACK, to a new state corresponding to LR
- * state YYLRSTATE, at input position YYPOSN, with the (unresolved)
- * semantic value of YYRHS under the action for YYRULE. */
-static inline void
-yyglrShiftDefer (yyGLRStack* yystack, int yyk, yyStateNum yylrState,
- size_t yyposn, yyGLRState* rhs, yyRuleNum yyrule)
-{
- yyGLRStackItem* yynewItem;
-
- yynewItem = yystack->yynextFree;
- yynewItem->yystate.yyisState = yytrue;
- yynewItem->yystate.yylrState = yylrState;
- yynewItem->yystate.yyposn = yyposn;
- yynewItem->yystate.yyresolved = yyfalse;
- yynewItem->yystate.yypred = yystack->yytops.yystates[yyk];
- yynewItem->yystate.yysemantics.yyfirstVal = NULL;
- yystack->yytops.yystates[yyk] = &yynewItem->yystate;
- yystack->yynextFree += 1;
- yystack->yyspaceLeft -= 1;
- yyaddDeferredAction (yystack, &yynewItem->yystate, rhs, yyrule);
-}
-
-/** Pop the symbols consumed by reduction #RULE from the top of stack
- * #K of STACK, and perform the appropriate semantic action on their
- * semantic values. Assumes that all ambiguities in semantic values
- * have been previously resolved. Set *VALP to the resulting value,
- * and *LOCP to the computed location (if any). Return value is as
- * for userAction. */
-static inline YYRESULTTAG
-yydoAction (yyGLRStack* yystack, int yyk, yyRuleNum yyrule,
- YYSTYPE* yyvalp, YYLTYPE* yylocp)
-{
- int yynrhs = yyrhsLength (yyrule);
-
- if (yystack->yysplitPoint == NULL)
- {
- /* Standard special case: single stack. */
- yyGLRStackItem* rhs = (yyGLRStackItem*) yystack->yytops.yystates[yyk];
- YYASSERT (yyk == 0);
- yystack->yynextFree -= yynrhs;
- yystack->yyspaceLeft += yynrhs;
- yystack->yytops.yystates[0] = & yystack->yynextFree[-1].yystate;
- return yyuserAction (yyrule, yynrhs, rhs,
- yyvalp, yylocp, yystack);
- }
- else
- {
- int yyi;
- yyGLRState* yys;
- yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1];
- yys = yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred
- = yystack->yytops.yystates[yyk];
- for (yyi = 0; yyi < yynrhs; yyi += 1)
- {
- yys = yys->yypred;
- YYASSERT (yys);
- }
- yyupdateSplit (yystack, yys);
- yystack->yytops.yystates[yyk] = yys;
- return yyuserAction (yyrule, yynrhs, yyrhsVals + YYMAXRHS + YYMAXLEFT - 1,
- yyvalp, yylocp, yystack);
- }
-}
-
-#if !YYDEBUG
-# define YY_REDUCE_PRINT(K, Rule)
-#else
-# define YY_REDUCE_PRINT(K, Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (K, Rule); \
-} while (0)
-
-/*----------------------------------------------------------.
-| Report that the RULE is going to be reduced on stack #K. |
-`----------------------------------------------------------*/
-
-static inline void
-yy_reduce_print (size_t yyk, yyRuleNum yyrule)
-{
- int yyi;
- YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu), ",
- (unsigned long int) yyk, yyrule - 1,
- (unsigned long int) yyrline[yyrule]);
- /* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
- YYFPRINTF (stderr, "%s ", yytokenName (yyrhs[yyi]));
- YYFPRINTF (stderr, "-> %s\n", yytokenName (yyr1[yyrule]));
-}
-#endif
-
-/** Pop items off stack #K of STACK according to grammar rule RULE,
- * and push back on the resulting nonterminal symbol. Perform the
- * semantic action associated with RULE and store its value with the
- * newly pushed state, if FORCEEVAL or if STACK is currently
- * unambiguous. Otherwise, store the deferred semantic action with
- * the new state. If the new state would have an identical input
- * position, LR state, and predecessor to an existing state on the stack,
- * it is identified with that existing state, eliminating stack #K from
- * the STACK. In this case, the (necessarily deferred) semantic value is
- * added to the options for the existing state's semantic value.
- */
-static inline YYRESULTTAG
-yyglrReduce (yyGLRStack* yystack, size_t yyk, yyRuleNum yyrule,
- yybool yyforceEval)
-{
- size_t yyposn = yystack->yytops.yystates[yyk]->yyposn;
-
- if (yyforceEval || yystack->yysplitPoint == NULL)
- {
- YYSTYPE yysval;
- YYLTYPE yyloc;
-
- YY_REDUCE_PRINT (yyk, yyrule);
- YYCHK (yydoAction (yystack, yyk, yyrule, &yysval, &yyloc));
- yyglrShift (yystack, yyk,
- yyLRgotoState (yystack->yytops.yystates[yyk]->yylrState,
- yylhsNonterm (yyrule)),
- yyposn, yysval, &yyloc);
- }
- else
- {
- size_t yyi;
- int yyn;
- yyGLRState* yys, *yys0 = yystack->yytops.yystates[yyk];
- yyStateNum yynewLRState;
-
- for (yys = yystack->yytops.yystates[yyk], yyn = yyrhsLength (yyrule);
- 0 < yyn; yyn -= 1)
- {
- yys = yys->yypred;
- YYASSERT (yys);
- }
- yyupdateSplit (yystack, yys);
- yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule));
- YYDPRINTF ((stderr,
- "Reduced stack %lu by rule #%d; action deferred. Now in state %d.\n",
- (unsigned long int) yyk, yyrule - 1, yynewLRState));
- for (yyi = 0; yyi < yystack->yytops.yysize; yyi += 1)
- if (yyi != yyk && yystack->yytops.yystates[yyi] != NULL)
- {
- yyGLRState* yyp, *yysplit = yystack->yysplitPoint;
- yyp = yystack->yytops.yystates[yyi];
- while (yyp != yys && yyp != yysplit && yyp->yyposn >= yyposn)
- {
- if (yyp->yylrState == yynewLRState && yyp->yypred == yys)
- {
- yyaddDeferredAction (yystack, yyp, yys0, yyrule);
- yymarkStackDeleted (yystack, yyk);
- YYDPRINTF ((stderr, "Merging stack %lu into stack %lu.\n",
- (unsigned long int) yyk,
- (unsigned long int) yyi));
- return yyok;
- }
- yyp = yyp->yypred;
- }
- }
- yystack->yytops.yystates[yyk] = yys;
- yyglrShiftDefer (yystack, yyk, yynewLRState, yyposn, yys0, yyrule);
- }
- return yyok;
-}
-
-static int
-yysplitStack (yyGLRStack* yystack, int yyk)
-{
- if (yystack->yysplitPoint == NULL)
- {
- YYASSERT (yyk == 0);
- yystack->yysplitPoint = yystack->yytops.yystates[yyk];
- }
- if (yystack->yytops.yysize >= yystack->yytops.yycapacity)
- {
- yystack->yytops.yycapacity *= 2;
- yystack->yytops.yystates =
- (yyGLRState**) YYREALLOC (yystack->yytops.yystates,
- (yystack->yytops.yycapacity
- * sizeof yystack->yytops.yystates[0]));
- }
- yystack->yytops.yystates[yystack->yytops.yysize]
- = yystack->yytops.yystates[yyk];
- yystack->yytops.yysize += 1;
- return yystack->yytops.yysize-1;
-}
-
-/** True iff Y0 and Y1 represent identical options at the top level.
- * That is, they represent the same rule applied to RHS symbols
- * that produce the same terminal symbols. */
-static yybool
-yyidenticalOptions (yySemanticOption* yyy0, yySemanticOption* yyy1)
-{
- if (yyy0->yyrule == yyy1->yyrule)
- {
- yyGLRState *yys0, *yys1;
- int yyn;
- for (yys0 = yyy0->yystate, yys1 = yyy1->yystate,
- yyn = yyrhsLength (yyy0->yyrule);
- yyn > 0;
- yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1)
- if (yys0->yyposn != yys1->yyposn)
- return yyfalse;
- return yytrue;
- }
- else
- return yyfalse;
-}
-
-/** Assuming identicalOptions (Y0,Y1), (destructively) merge the
- * alternative semantic values for the RHS-symbols of Y1 into the
- * corresponding semantic value sets of the symbols of Y0. */
-static void
-yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1)
-{
- yyGLRState *yys0, *yys1;
- int yyn;
- for (yys0 = yyy0->yystate, yys1 = yyy1->yystate,
- yyn = yyrhsLength (yyy0->yyrule);
- yyn > 0;
- yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1)
- if (yys0 == yys1)
- break;
- else if (! yys0->yyresolved && ! yys1->yyresolved)
- {
- yySemanticOption* yyz;
- for (yyz = yys0->yysemantics.yyfirstVal; yyz->yynext != NULL;
- yyz = yyz->yynext)
- continue;
- yyz->yynext = yys1->yysemantics.yyfirstVal;
- }
-}
-
-/** Y0 and Y1 represent two possible actions to take in a given
- * parsing state; return 0 if no combination is possible,
- * 1 if user-mergeable, 2 if Y0 is preferred, 3 if Y1 is preferred. */
-static int
-yypreference (yySemanticOption* y0, yySemanticOption* y1)
-{
- yyRuleNum r0 = y0->yyrule, r1 = y1->yyrule;
- int p0 = yydprec[r0], p1 = yydprec[r1];
-
- if (p0 == p1)
- {
- if (yymerger[r0] == 0 || yymerger[r0] != yymerger[r1])
- return 0;
- else
- return 1;
- }
- if (p0 == 0 || p1 == 0)
- return 0;
- if (p0 < p1)
- return 3;
- if (p1 < p0)
- return 2;
- return 0;
-}
-
-static YYRESULTTAG yyresolveValue (yySemanticOption* yyoptionList,
- yyGLRStack* yystack, YYSTYPE* yyvalp,
- YYLTYPE* yylocp);
-
-static YYRESULTTAG
-yyresolveStates (yyGLRState* yys, int yyn, yyGLRStack* yystack)
-{
- YYRESULTTAG yyflag;
- if (0 < yyn)
- {
- YYASSERT (yys->yypred);
- yyflag = yyresolveStates (yys->yypred, yyn-1, yystack);
- if (yyflag != yyok)
- return yyflag;
- if (! yys->yyresolved)
- {
- yyflag = yyresolveValue (yys->yysemantics.yyfirstVal, yystack,
- &yys->yysemantics.yysval, &yys->yyloc
- );
- if (yyflag != yyok)
- return yyflag;
- yys->yyresolved = yytrue;
- }
- }
- return yyok;
-}
-
-static YYRESULTTAG
-yyresolveAction (yySemanticOption* yyopt, yyGLRStack* yystack,
- YYSTYPE* yyvalp, YYLTYPE* yylocp)
-{
- yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1];
- int yynrhs;
-
- yynrhs = yyrhsLength (yyopt->yyrule);
- YYCHK (yyresolveStates (yyopt->yystate, yynrhs, yystack));
- yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred = yyopt->yystate;
- return yyuserAction (yyopt->yyrule, yynrhs,
- yyrhsVals + YYMAXRHS + YYMAXLEFT - 1,
- yyvalp, yylocp, yystack);
-}
-
-#if YYDEBUG
-static void
-yyreportTree (yySemanticOption* yyx, int yyindent)
-{
- int yynrhs = yyrhsLength (yyx->yyrule);
- int yyi;
- yyGLRState* yys;
- yyGLRState* yystates[YYMAXRHS];
- yyGLRState yyleftmost_state;
-
- for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred)
- yystates[yyi] = yys;
- if (yys == NULL)
- {
- yyleftmost_state.yyposn = 0;
- yystates[0] = &yyleftmost_state;
- }
- else
- yystates[0] = yys;
-
- if (yyx->yystate->yyposn < yys->yyposn + 1)
- YYFPRINTF (stderr, "%*s%s -> <Rule %d, empty>\n",
- yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
- yyx->yyrule);
- else
- YYFPRINTF (stderr, "%*s%s -> <Rule %d, tokens %lu .. %lu>\n",
- yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
- yyx->yyrule, (unsigned long int) (yys->yyposn + 1),
- (unsigned long int) yyx->yystate->yyposn);
- for (yyi = 1; yyi <= yynrhs; yyi += 1)
- {
- if (yystates[yyi]->yyresolved)
- {
- if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn)
- YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "",
- yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]));
- else
- YYFPRINTF (stderr, "%*s%s <tokens %lu .. %lu>\n", yyindent+2, "",
- yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]),
- (unsigned long int) (yystates[yyi - 1]->yyposn + 1),
- (unsigned long int) yystates[yyi]->yyposn);
- }
- else
- yyreportTree (yystates[yyi]->yysemantics.yyfirstVal, yyindent+2);
- }
-}
-#endif
-
-static void
-yyreportAmbiguity (yySemanticOption* yyx0, yySemanticOption* yyx1,
- yyGLRStack* yystack)
-{
- /* `Unused' warnings. */
- (void) yyx0;
- (void) yyx1;
-
-#if YYDEBUG
- YYFPRINTF (stderr, "Ambiguity detected.\n");
- YYFPRINTF (stderr, "Option 1,\n");
- yyreportTree (yyx0, 2);
- YYFPRINTF (stderr, "\nOption 2,\n");
- yyreportTree (yyx1, 2);
- YYFPRINTF (stderr, "\n");
-#endif
- yyFail (yystack, "ambiguity detected");
-}
-
-
-/** Resolve the ambiguity represented by OPTIONLIST, perform the indicated
- * actions, and return the result. */
-static YYRESULTTAG
-yyresolveValue (yySemanticOption* yyoptionList, yyGLRStack* yystack,
- YYSTYPE* yyvalp, YYLTYPE* yylocp)
-{
- yySemanticOption* yybest;
- yySemanticOption* yyp;
- int yymerge;
-
- yybest = yyoptionList;
- yymerge = 0;
- for (yyp = yyoptionList->yynext; yyp != NULL; yyp = yyp->yynext)
- {
- if (yyidenticalOptions (yybest, yyp))
- yymergeOptionSets (yybest, yyp);
- else
- switch (yypreference (yybest, yyp))
- {
- case 0:
- yyreportAmbiguity (yybest, yyp, yystack);
- break;
- case 1:
- yymerge = 1;
- break;
- case 2:
- break;
- case 3:
- yybest = yyp;
- yymerge = 0;
- break;
- }
- }
-
- if (yymerge)
- {
- int yyprec = yydprec[yybest->yyrule];
- YYCHK (yyresolveAction (yybest, yystack, yyvalp, yylocp));
- for (yyp = yybest->yynext; yyp != NULL; yyp = yyp->yynext)
- {
- if (yyprec == yydprec[yyp->yyrule])
- {
- YYSTYPE yyval1;
- YYLTYPE yydummy;
- YYCHK (yyresolveAction (yyp, yystack, &yyval1, &yydummy));
- yyuserMerge (yymerger[yyp->yyrule], yyvalp, &yyval1);
- }
- }
- return yyok;
- }
- else
- return yyresolveAction (yybest, yystack, yyvalp, yylocp);
-}
-
-static YYRESULTTAG
-yyresolveStack (yyGLRStack* yystack)
-{
- if (yystack->yysplitPoint != NULL)
- {
- yyGLRState* yys;
- int yyn;
-
- for (yyn = 0, yys = yystack->yytops.yystates[0];
- yys != yystack->yysplitPoint;
- yys = yys->yypred, yyn += 1)
- continue;
- YYCHK (yyresolveStates (yystack->yytops.yystates[0], yyn, yystack
- ));
- }
- return yyok;
-}
-
-static void
-yycompressStack (yyGLRStack* yystack)
-{
- yyGLRState* yyp, *yyq, *yyr;
-
- if (yystack->yytops.yysize != 1 || yystack->yysplitPoint == NULL)
- return;
-
- for (yyp = yystack->yytops.yystates[0], yyq = yyp->yypred, yyr = NULL;
- yyp != yystack->yysplitPoint;
- yyr = yyp, yyp = yyq, yyq = yyp->yypred)
- yyp->yypred = yyr;
-
- yystack->yyspaceLeft += yystack->yynextFree - yystack->yyitems;
- yystack->yynextFree = ((yyGLRStackItem*) yystack->yysplitPoint) + 1;
- yystack->yyspaceLeft -= yystack->yynextFree - yystack->yyitems;
- yystack->yysplitPoint = NULL;
- yystack->yylastDeleted = NULL;
-
- while (yyr != NULL)
- {
- yystack->yynextFree->yystate = *yyr;
- yyr = yyr->yypred;
- yystack->yynextFree->yystate.yypred = & yystack->yynextFree[-1].yystate;
- yystack->yytops.yystates[0] = &yystack->yynextFree->yystate;
- yystack->yynextFree += 1;
- yystack->yyspaceLeft -= 1;
- }
-}
-
-static YYRESULTTAG
-yyprocessOneStack (yyGLRStack* yystack, int yyk,
- size_t yyposn, YYSTYPE* yylvalp, YYLTYPE* yyllocp
- )
-{
- int yyaction;
- const short int* yyconflicts;
- yyRuleNum yyrule;
- yySymbol* const yytokenp = yystack->yytokenp;
-
- while (yystack->yytops.yystates[yyk] != NULL)
- {
- yyStateNum yystate = yystack->yytops.yystates[yyk]->yylrState;
- YYDPRINTF ((stderr, "Stack %d Entering state %d\n", yyk, yystate));
-
- YYASSERT (yystate != YYFINAL);
-
- if (yyisDefaultedState (yystate))
- {
- yyrule = yydefaultAction (yystate);
- if (yyrule == 0)
- {
- YYDPRINTF ((stderr, "Stack %d dies.\n", yyk));
- yymarkStackDeleted (yystack, yyk);
- return yyok;
- }
- YYCHK (yyglrReduce (yystack, yyk, yyrule, yyfalse));
- }
- else
- {
- if (*yytokenp == YYEMPTY)
- {
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
- *yytokenp = YYTRANSLATE (yychar);
- YY_SYMBOL_PRINT ("Next token is", *yytokenp, yylvalp, yyllocp);
- }
- yygetLRActions (yystate, *yytokenp, &yyaction, &yyconflicts);
-
- while (*yyconflicts != 0)
- {
- int yynewStack = yysplitStack (yystack, yyk);
- YYDPRINTF ((stderr, "Splitting off stack %d from %d.\n",
- yynewStack, yyk));
- YYCHK (yyglrReduce (yystack, yynewStack,
- *yyconflicts, yyfalse));
- YYCHK (yyprocessOneStack (yystack, yynewStack, yyposn,
- yylvalp, yyllocp));
- yyconflicts += 1;
- }
-
- if (yyisShiftAction (yyaction))
- {
- YYDPRINTF ((stderr, "On stack %d, ", yyk));
- YY_SYMBOL_PRINT ("shifting", *yytokenp, yylvalp, yyllocp);
- yyglrShift (yystack, yyk, yyaction, yyposn+1,
- *yylvalp, yyllocp);
- YYDPRINTF ((stderr, ", now in state #%d\n",
- yystack->yytops.yystates[yyk]->yylrState));
- break;
- }
- else if (yyisErrorAction (yyaction))
- {
- YYDPRINTF ((stderr, "Stack %d dies.\n", yyk));
- yymarkStackDeleted (yystack, yyk);
- break;
- }
- else
- YYCHK (yyglrReduce (yystack, yyk, -yyaction, yyfalse));
- }
- }
- return yyok;
-}
-
-static void
-yyreportSyntaxError (yyGLRStack* yystack,
- YYSTYPE* yylvalp, YYLTYPE* yyllocp)
-{
- /* `Unused' warnings. */
- (void) yylvalp;
- (void) yyllocp;
-
- if (yystack->yyerrState == 0)
- {
-#if YYERROR_VERBOSE
- yySymbol* const yytokenp = yystack->yytokenp;
- int yyn;
- yyn = yypact[yystack->yytops.yystates[0]->yylrState];
- if (YYPACT_NINF < yyn && yyn < YYLAST)
- {
- size_t yysize = 0;
- const char* yyprefix;
- char* yymsg;
- int yyx;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 0;
-
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- yysize += strlen (yyprefix) + strlen (yytokenName (yyx));
- yycount += 1;
- if (yycount == 5)
- {
- yysize = 0;
- break;
- }
- yyprefix = " or ";
- }
- yysize += (sizeof ("syntax error, unexpected ")
- + strlen (yytokenName (*yytokenp)));
- yymsg = (char*) YYMALLOC (yysize);
- if (yymsg != 0)
- {
- char* yyp = yymsg;
- sprintf (yyp, "syntax error%s%s",
- (*yytokenp == YYEMPTY ? "" : ", unexpected "),
- yytokenName (*yytokenp));
- yyp += strlen (yyp);
- if (yycount < 5)
- {
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- sprintf (yyp, "%s%s", yyprefix, yytokenName (yyx));
- yyp += strlen (yyp);
- yyprefix = " or ";
- }
- }
- yyerror (yymsg);
- YYFREE (yymsg);
- }
- else
- yyerror ("syntax error; also virtual memory exhausted");
- }
- else
-#endif /* YYERROR_VERBOSE */
- yyerror ("syntax error");
- yynerrs += 1;
- }
-}
-
-/* Recover from a syntax error on YYSTACK, assuming that YYTOKENP,
- YYLVALP, and YYLLOCP point to the syntactic category, semantic
- value, and location of the look-ahead. */
-static void
-yyrecoverSyntaxError (yyGLRStack* yystack,
- YYSTYPE* yylvalp,
- YYLTYPE* yyllocp ATTRIBUTE_UNUSED
- )
-{
- yySymbol* const yytokenp = yystack->yytokenp;
- size_t yyk;
- int yyj;
-
- if (yystack->yyerrState == 3)
- /* We just shifted the error token and (perhaps) took some
- reductions. Skip tokens until we can proceed. */
- while (yytrue)
- {
- if (*yytokenp == YYEOF)
- {
- /* Now pop stack until empty and fail. */
- while (yystack->yytops.yystates[0] != NULL)
- {
- yyGLRState *yys = yystack->yytops.yystates[0];
-
- yydestruct ("Error: popping",
- yystos[yys->yylrState],
- &yys->yysemantics.yysval);
- yystack->yytops.yystates[0] = yys->yypred;
- yystack->yynextFree -= 1;
- yystack->yyspaceLeft += 1;
- }
- yyFail (yystack, NULL);
- }
- if (*yytokenp != YYEMPTY)
- {
- yydestruct ("Error: discarding",
- *yytokenp, yylvalp);
- }
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
- *yytokenp = YYTRANSLATE (yychar);
- YY_SYMBOL_PRINT ("Next token is", *yytokenp, yylvalp, yyllocp);
- yyj = yypact[yystack->yytops.yystates[0]->yylrState];
- if (yyis_pact_ninf (yyj))
- return;
- yyj += *yytokenp;
- if (yyj < 0 || YYLAST < yyj || yycheck[yyj] != *yytokenp)
- {
- if (yydefact[yystack->yytops.yystates[0]->yylrState] != 0)
- return;
- }
- else if (yytable[yyj] != 0 && ! yyis_table_ninf (yytable[yyj]))
- return;
- }
-
- /* Reduce to one stack. */
- for (yyk = 0; yyk < yystack->yytops.yysize; yyk += 1)
- if (yystack->yytops.yystates[yyk] != NULL)
- break;
- if (yyk >= yystack->yytops.yysize)
- yyFail (yystack, NULL);
- for (yyk += 1; yyk < yystack->yytops.yysize; yyk += 1)
- yymarkStackDeleted (yystack, yyk);
- yyremoveDeletes (yystack);
- yycompressStack (yystack);
-
- /* Now pop stack until we find a state that shifts the error token. */
- yystack->yyerrState = 3;
- while (yystack->yytops.yystates[0] != NULL)
- {
- yyGLRState *yys = yystack->yytops.yystates[0];
- yyj = yypact[yys->yylrState];
- if (! yyis_pact_ninf (yyj))
- {
- yyj += YYTERROR;
- if (0 <= yyj && yyj <= YYLAST && yycheck[yyj] == YYTERROR
- && yyisShiftAction (yytable[yyj]))
- {
- /* Shift the error token having adjusted its location. */
- YYLTYPE yyerrloc;
- YY_SYMBOL_PRINT ("Shifting", yystos[yytable[yyj]],
- yylvalp, &yyerrloc);
- yyglrShift (yystack, 0, yytable[yyj],
- yys->yyposn, *yylvalp, &yyerrloc);
- yys = yystack->yytops.yystates[0];
- break;
- }
- }
-
- yydestruct ("Error: popping",
- yystos[yys->yylrState],
- &yys->yysemantics.yysval);
- yystack->yytops.yystates[0] = yys->yypred;
- yystack->yynextFree -= 1;
- yystack->yyspaceLeft += 1;
- }
- if (yystack->yytops.yystates[0] == NULL)
- yyFail (yystack, NULL);
-}
-
-#define YYCHK1(YYE) \
- do { \
- switch (YYE) { \
- default: \
- break; \
- case yyabort: \
- yystack.yyerrflag = 1; \
- goto yyDone; \
- case yyaccept: \
- yystack.yyerrflag = 0; \
- goto yyDone; \
- case yyerr: \
- goto yyuser_error; \
- } \
- } while (0)
-
-
-/*----------.
-| yyparse. |
-`----------*/
-
-int
-yyparse (void)
-{
- yySymbol yytoken;
- yyGLRStack yystack;
- size_t yyposn;
-
-
- YYSTYPE* const yylvalp = &yylval;
- YYLTYPE* const yyllocp = &yylloc;
-
- yyinitGLRStack (&yystack, YYINITDEPTH);
- yystack.yytokenp = &yytoken;
-
- YYDPRINTF ((stderr, "Starting parse\n"));
-
- if (setjmp (yystack.yyexception_buffer) != 0)
- goto yyDone;
-
- yylval = yyval_default;
-
-
- yyglrShift (&yystack, 0, 0, 0, yylval, &yylloc);
- yytoken = YYEMPTY;
- yyposn = 0;
-
- while (yytrue)
- {
- /* For efficiency, we have two loops, the first of which is
- specialized to deterministic operation (single stack, no
- potential ambiguity). */
- /* Standard mode */
- while (yytrue)
- {
- yyRuleNum yyrule;
- int yyaction;
- const short int* yyconflicts;
-
- yyStateNum yystate = yystack.yytops.yystates[0]->yylrState;
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
- if (yystate == YYFINAL)
- goto yyDone;
- if (yyisDefaultedState (yystate))
- {
- yyrule = yydefaultAction (yystate);
- if (yyrule == 0)
- {
-
- yyreportSyntaxError (&yystack, yylvalp, yyllocp);
- goto yyuser_error;
- }
- YYCHK1 (yyglrReduce (&yystack, 0, yyrule, yytrue));
- }
- else
- {
- if (yytoken == YYEMPTY)
- {
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
- yytoken = YYTRANSLATE (yychar);
- YY_SYMBOL_PRINT ("Next token is", yytoken, yylvalp, yyllocp);
- }
- yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
- if (*yyconflicts != 0)
- break;
- if (yyisShiftAction (yyaction))
- {
- YY_SYMBOL_PRINT ("Shifting", yytoken, yylvalp, yyllocp);
- if (yytoken != YYEOF)
- yytoken = YYEMPTY;
- yyposn += 1;
- yyglrShift (&yystack, 0, yyaction, yyposn,
- yylval, yyllocp);
- if (0 < yystack.yyerrState)
- yystack.yyerrState -= 1;
- }
- else if (yyisErrorAction (yyaction))
- {
-
- yyreportSyntaxError (&yystack, yylvalp, yyllocp);
- goto yyuser_error;
- }
- else
- YYCHK1 (yyglrReduce (&yystack, 0, -yyaction, yytrue));
- }
- }
-
- while (yytrue)
- {
- int yys;
- int yyn = yystack.yytops.yysize;
- for (yys = 0; yys < yyn; yys += 1)
- YYCHK1 (yyprocessOneStack (&yystack, yys, yyposn,
- yylvalp, yyllocp));
- yytoken = YYEMPTY;
- yyposn += 1;
- yyremoveDeletes (&yystack);
- if (yystack.yytops.yysize == 0)
- {
- yyundeleteLastStack (&yystack);
- if (yystack.yytops.yysize == 0)
- yyFail (&yystack, "syntax error");
- YYCHK1 (yyresolveStack (&yystack));
- YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
-
- yyreportSyntaxError (&yystack, yylvalp, yyllocp);
- goto yyuser_error;
- }
- else if (yystack.yytops.yysize == 1)
- {
- YYCHK1 (yyresolveStack (&yystack));
- YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
- yycompressStack (&yystack);
- break;
- }
- }
- continue;
- yyuser_error:
- yyrecoverSyntaxError (&yystack, yylvalp, yyllocp);
- yyposn = yystack.yytops.yystates[0]->yyposn;
- }
- yyDone:
- /* On YYABORT, free the lookahead. */
- if (yystack.yyerrflag == 1 && yytoken != YYEMPTY)
- yydestruct ("Error: discarding lookahead",
- yytoken, yylvalp);
-
- yyfreeGLRStack (&yystack);
- return yystack.yyerrflag;
-}
-
-/* DEBUGGING ONLY */
-#ifdef YYDEBUG
-static void yypstack (yyGLRStack* yystack, int yyk) ATTRIBUTE_UNUSED;
-static void yypdumpstack (yyGLRStack* yystack) ATTRIBUTE_UNUSED;
-
-static void
-yy_yypstack (yyGLRState* yys)
-{
- if (yys->yypred)
- {
- yy_yypstack (yys->yypred);
- fprintf (stderr, " -> ");
- }
- fprintf (stderr, "%d@%lu", yys->yylrState, (unsigned long int) yys->yyposn);
-}
-
-static void
-yypstates (yyGLRState* yyst)
-{
- if (yyst == NULL)
- fprintf (stderr, "<null>");
- else
- yy_yypstack (yyst);
- fprintf (stderr, "\n");
-}
-
-static void
-yypstack (yyGLRStack* yystack, int yyk)
-{
- yypstates (yystack->yytops.yystates[yyk]);
-}
-
-#define YYINDEX(YYX) \
- ((YYX) == NULL ? -1 : (yyGLRStackItem*) (YYX) - yystack->yyitems)
-
-
-static void
-yypdumpstack (yyGLRStack* yystack)
-{
- yyGLRStackItem* yyp;
- size_t yyi;
- for (yyp = yystack->yyitems; yyp < yystack->yynextFree; yyp += 1)
- {
- fprintf (stderr, "%3lu. ", (unsigned long int) (yyp - yystack->yyitems));
- if (*(yybool *) yyp)
- {
- fprintf (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
- yyp->yystate.yyresolved, yyp->yystate.yylrState,
- (unsigned long int) yyp->yystate.yyposn,
- (long int) YYINDEX (yyp->yystate.yypred));
- if (! yyp->yystate.yyresolved)
- fprintf (stderr, ", firstVal: %ld",
- (long int) YYINDEX (yyp->yystate.yysemantics.yyfirstVal));
- }
- else
- {
- fprintf (stderr, "Option. rule: %d, state: %ld, next: %ld",
- yyp->yyoption.yyrule,
- (long int) YYINDEX (yyp->yyoption.yystate),
- (long int) YYINDEX (yyp->yyoption.yynext));
- }
- fprintf (stderr, "\n");
- }
- fprintf (stderr, "Tops:");
- for (yyi = 0; yyi < yystack->yytops.yysize; yyi += 1)
- fprintf (stderr, "%lu: %ld; ", (unsigned long int) yyi,
- (long int) YYINDEX (yystack->yytops.yystates[yyi]));
- fprintf (stderr, "\n");
-}
-#endif
-
-
-#line 77 "idx.y"
-
-
diff --git a/funtools/filter/idx.tab.h b/funtools/filter/idx.tab.h
deleted file mode 100644
index 00ac7cd..0000000
--- a/funtools/filter/idx.tab.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* A Bison parser, made by GNU Bison 2.0. */
-
-/* Skeleton parser for GLR parsing with Bison,
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- NUM = 258,
- COL = 259,
- FUNC = 260,
- REG = 261,
- INDEF = 262,
- OR = 263,
- AND = 264,
- NE = 265,
- EQ = 266,
- GE = 267,
- LE = 268,
- UMINUS = 269
- };
-#endif
-#define NUM 258
-#define COL 259
-#define FUNC 260
-#define REG 261
-#define INDEF 262
-#define OR 263
-#define AND 264
-#define NE 265
-#define EQ 266
-#define GE 267
-#define LE 268
-#define UMINUS 269
-
-
-
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 6 "idx.y"
-typedef union YYSTYPE {
- idxrowrec *row;
- idxvalrec *val;
-} YYSTYPE;
-/* Line 2089 of glr.c. */
-#line 65 "idx.tab.h"
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-extern YYSTYPE idxlval;
-
-#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
-typedef struct YYLTYPE
-{
-
- char yydummy;
-
-} YYLTYPE;
-# define YYLTYPE_IS_DECLARED 1
-# define YYLTYPE_IS_TRIVIAL 1
-#endif
-
-
-
diff --git a/funtools/filter/idx.y b/funtools/filter/idx.y
deleted file mode 100644
index 1846fec..0000000
--- a/funtools/filter/idx.y
+++ /dev/null
@@ -1,77 +0,0 @@
-%{
-#include <idx.h>
-#include <idx.tab.h>
-%}
-
-%union{
- idxrowrec *row;
- idxvalrec *val;
-}
-
-%token <val> NUM
-%token <val> COL
-%token <val> FUNC
-%token <val> REG
-%token <val> INDEF
-
-%left OR
-%left AND
-%left '|'
-%left '^'
-%left '&'
-%nonassoc EQ NE
-%nonassoc '<' LE '>' GE
-%left '+' '-'
-%left '*' '/' '%'
-%right '!' '~' UMINUS
-
-%type <row> idx
-%type <row> expr
-%type <row> rowlist
-%type <val> value
-
-%glr-parser
-%expect-rr 1
-
-%%
-
-/* combines lists of row numbers */
-idx: expr { idxall($1); }
-;
-
-expr: rowlist
-| expr OR expr { $$ = idxor($1,$3); }
-| expr AND expr { $$ = idxand($1,$3); }
-| '(' expr ')' { $$ = $2; }
-;
-
-/* generates lists of row numbers */
-rowlist:REG { $$ = idxrowreg($1); }
-| FUNC { $$ = idxrowfun($1); }
-| value EQ value { $$ = idxroweq($1,$3); }
-| value NE value { $$ = idxrowne($1,$3); }
-| value '<' value { $$ = idxrowlt($1,$3); }
-| value LE value { $$ = idxrowle($1,$3); }
-| value '>' value { $$ = idxrowgt($1,$3); }
-| value GE value { $$ = idxrowge($1,$3); }
-;
-
-value: NUM
-| COL
-| INDEF
-| FUNC
-| value '+' value { $$ = idxvaladd($1,$3); }
-| value '-' value { $$ = idxvalsub($1,$3); }
-| value '*' value { $$ = idxvalmul($1,$3); }
-| value '/' value { $$ = idxvaldiv($1,$3); }
-| value '%' value { $$ = idxvalmod($1,$3); }
-| value '&' value { $$ = idxvaland($1,$3); }
-| value '|' value { $$ = idxvalor($1,$3); }
-| value '^' value { $$ = idxvalxor($1,$3); }
-| '!' value { $$ = idxvalnot($2); }
-| '~' value { $$ = idxvalcom($2); }
-| '-' value %prec UMINUS { $$ = idxvalmin($2); }
-| '(' value ')' { $$ = $2; }
-;
-
-%%
diff --git a/funtools/filter/idxacts.c b/funtools/filter/idxacts.c
deleted file mode 100644
index 4989267..0000000
--- a/funtools/filter/idxacts.c
+++ /dev/null
@@ -1,2368 +0,0 @@
-/*
- * Copyright (c) 2005 Smithsonian Astrophysical Observatory
- */
-
-/*
- *
- * idxacts.c -- action routines for idx
- *
- */
-
-#include <filter.h>
-#include <idx.h>
-#include <idx.tab.h>
-
-#if HAVE_LONG_LONG
-#define LFMT "%lld"
-#else
-#define LFMT "%ld"
-#endif
-
-#define IDX_DEBUG 1
-#if IDX_DEBUG
-#define IPRINTF(x) if( idx_debug ) fprintf x
-#else
-#define IPRINTF(x)
-#endif
-
-/* used by idx.l, so it must be global */
-int idx_debug=0;
-
-/*
- *
- * private routines
- *
- */
-
-#define MAXD 3
-static char dbuf[MAXD][SZ_LINE];
-static int nd=0;
-
-static char _swapped[8];
-static int idx_io=IDX_IO_DEFAULT;
-
-static char *idxcolname=NULL;
-static char *idxfilename=NULL;
-static char *idxfileroot1=NULL;
-static char *idxfileroot2=NULL;
-static char *idxpath=NULL;
-static char *idxsort=NULL;
-
-static char fmt[SZ_LINE];
-
-#ifdef ANSI_FUNC
-static void *
-_swap(void *ibuf, int isize)
-#else
-static void *_swap(ibuf, isize)
- void *ibuf;
- int isize;
-#endif
-{
- return ft_dataswap(_swapped, ibuf, isize, isize*8);
-}
-
-#if IDX_DEBUG
-#ifdef ANSI_FUNC
-static char *
-rowdisp(idxrowrec *row)
-#else
-static char *rowdisp(row)
- idxrowrec *row;
-#endif
-{
- int i;
- char tbuf[SZ_LINE];
-
- if( nd >= MAXD ) nd = 0;
- *dbuf[nd] = '\0';
- switch(row->rtype){
- case IDX_ROW_LIST:
- if( row->s ){
- snprintf(dbuf[nd], SZ_LINE-1, "%s[ROW", row->s);
- }
- else{
- snprintf(dbuf[nd], SZ_LINE-1, "[ROW");
- }
- for(i=0; i<row->nrow; i++){
- strncat(dbuf[nd], " ", SZ_LINE-1);
- snprintf(tbuf, SZ_LINE-1, "%d:%d", row->startrow[i], row->stoprow[i]);
- strncat(dbuf[nd], tbuf, SZ_LINE-1);
- }
- strncat(dbuf[nd], "]", SZ_LINE-1);
- break;
- case IDX_SORT:
- snprintf(dbuf[nd], SZ_LINE-1, "[IDX_SORT]");
- break;
- case IDX_OR_SORT:
- snprintf(dbuf[nd], SZ_LINE-1, "[IDX_OR_SORT]");
- break;
- case IDX_AND_SORT:
- snprintf(dbuf[nd], SZ_LINE-1, "[IDX_AND_SORT]");
- break;
- case IDX_INDEF:
- snprintf(dbuf[nd], SZ_LINE-1, "[INDEF]");
- break;
- }
- if( !*dbuf[nd] ){
- snprintf(dbuf[nd], SZ_LINE-1, "type=%d?", row->rtype);
- }
- return dbuf[nd++];
-}
-#endif
-
-#ifdef ANSI_FUNC
-static int
-_idxvalfree(idxvalrec *v)
-#else
-static int _idxvalfree(v)
- idxvalrec *v;
-#endif
-{
- if( !v ) return 0;
- if( v->s ) xfree(v->s);
-#ifdef HAVE_SYS_MMAN_H
- if( v->idata ) munmap(v->idata, v->ilen);
-#endif
- /* these are linked (i.e. if iname does not exist, its a copy of another */
- if( v->iname && v->igio && v->ifits ){
- gclose(v->igio);
- xfree(v->iname);
- ft_headfree(v->ifits, 1);
- }
- xfree(v);
- return 1;
-}
-
-#ifdef ANSI_FUNC
-static int
-_idxrowfree(idxrowrec *r)
-#else
-static int _idxrowfree(r)
- idxrowrec *r;
-#endif
-{
- int tries=0;
- int exit_status;
-
- if( !r ) return 0;
- if( r->s ) xfree(r->s);
- if( r->startrow ) xfree(r->startrow);
- if( r->stoprow ) xfree(r->stoprow);
- if( r->ifile )
- fclose(r->ifile);
- else if( r->ichan )
- close(r->ichan);
- if( r->ochan )
- close(r->ochan);
-#if HAVE_MINGW32==0
- if( r->pid ){
- while( (waitpid(r->pid, &exit_status, WNOHANG)==0) && (tries<10) ){
- gsleep(10);
- tries++;
- }
- r->pid = 0;
- }
-#endif
- if( r->fdata ){
-#ifdef HAVE_SYS_MMAN_H
- munmap(r->fdata, r->flen);
-#endif
- }
- xfree(r);
- return 1;
-}
-
-
-#ifdef ANSI_FUNC
-static int
-_idxstartsort(int type, int *ichan, int *ochan, int *pid)
-#else
-static int _idxstartsort(type, ichan, ochan, pid)
- int type;
- int *ichan;
- int *ochan;
- int *pid;
-#endif
-{
- char *s;
- char cmd[SZ_LINE];
-
- if( !idxsort ){
- if( idxpath ) return 0;
- if( (s=(char *)getenv("PATH")) ){
- idxpath = xstrdup(s);
- }
- if( !(idxsort=Find(IDX_SORTPROG, "x", NULL, idxpath)) &&
- !(idxsort=Find(IDX_SORTPROG, "x", NULL, ".")) ){
- idxerror("index sort program cannot be found");
- return 0;
- }
- }
- /* construct command line for sort program */
- switch(type){
- case IDX_SORT:
- snprintf(cmd, SZ_LINE-1, "%s -B4 +i0", idxsort);
- break;
- case IDX_OR_SORT:
- snprintf(cmd, SZ_LINE-1, "%s -B4 +i0 -u", idxsort);
- break;
- case IDX_AND_SORT:
- snprintf(cmd, SZ_LINE-1, "%s -B4 +i0 -D", idxsort);
- break;
- default:
- snprintf(cmd, SZ_LINE-1, "%s -B4 +i0", idxsort);
- break;
- }
- /* start the sort program */
- if( !ProcessOpen(cmd, ichan, ochan, pid) ){
- idxerror("index sort process cannot be started");
- return 0;
- }
- return 1;
-}
-
-#ifdef ANSI_FUNC
-static int
-_idxwritesort(idxrowrec *x, idxrowrec *row)
-#else
-static int _idxwritesort(x, row)
- idxrowrec *x;
- idxrowrec *row;
-#endif
-{
- int i, j, k=0;
- int rowsize;
- int ioffset;
- int itype;
- int isize;
- int obuf[SZ_LINE];
- long ipos;
- char nbuf[8];
- idxvalrec *v=NULL;
-
- v = row->v;
- rowsize = ft_naxis(v->ifits, 1);
- ioffset = v->ioffset;
- itype = v->itype;
- isize = ft_sizeof(v->itype);
- for(i=0; i<row->nrow; i++){
- for(j=row->startrow[i]; j<=row->stoprow[i]; j++){
- ipos = v->ifits->data + ((j-1)*rowsize) + ioffset;
- switch( idx_io ){
- case IDX_IO_MMAP:
- if( v->idata ){
-#ifdef HAVE_SYS_MMAN_H
- memcpy(nbuf, &v->idata[ipos], isize);
-#else
- idxerror("mmap not supported on this system");
-#endif
- break;
- }
- case IDX_IO_LSEEK:
- if( gseek(v->igio, (off_t)ipos, 0) < 0 ){
- idxerror("can't lseek into index file");
- return 0;
- }
- if( !gread(v->igio, nbuf, isize, 1) ){
- idxerror("can't read index file");
- return 0;
- }
- break;
- }
- switch(itype){
- case 'B':
- obuf[k++] = (int)*(unsigned char *)(nbuf);
- break;
- case 'I':
- obuf[k++] = (int)*(short *)_swap(nbuf,2);
- break;
- case 'U':
- obuf[k++] = (int)*(unsigned short *)_swap(nbuf,2);
- break;
- case 'J':
- obuf[k++] = (int)*(int *)_swap(nbuf,4);
- break;
- case 'V':
- obuf[k++] = (int)*(unsigned int *)_swap(nbuf,4);
- break;
- case 'K':
- idxerror("64-bit integer not supported for index");
- break;
- default:
- idxerror("illegal index data type");
- }
- if( k == SZ_LINE ){
- if( write(x->ochan, obuf, k*sizeof(int)) != (int)(k*sizeof(int)) ){
- idxerror("can't write index value to sort");
- return 0;
- }
- k = 0;
- }
- }
- }
- if( k ){
- if( write(x->ochan, obuf, k*sizeof(int)) != (int)(k*sizeof(int)) ){
- idxerror("can't write index value to sort");
- return 0;
- }
- }
- return 1;
-}
-
-#ifdef ANSI_FUNC
-static int
-_idxcompare(char *buf, int type, int offset, int n,
- double d, longlong l, int t)
-#else
-static int _idxcompare(buf, type, offset, n, d, l, t)
- char *buf;
- int type;
- int offset;
- int n;
- double d;
- longlong l;
- int t;
-#endif
-{
- unsigned short sval;
- unsigned int xval;
- int xn;
- double dval=0.0;
- longlong lval=0;
- int isint=0;
-
- switch(type){
- case 'X':
- isint = 1;
- if( n == 16 ){
- xn = 1;
- n = 1;
- }
- else if( n == 32 ){
- xn = 2;
- n = 1;
- }
- else if( n == 64 ){
- xn = 3;
- n = 1;
- }
- else{
- xn = 0;
- n = (n+7)/8;
- }
- switch(xn){
- case 1:
- memcpy(&sval, _swap(buf+offset,2), sizeof(unsigned short));
- dval = (double)sval;
- lval = (longlong)sval;
- break;
- case 2:
- memcpy(&xval, _swap(buf+offset,4), sizeof(unsigned int));
- dval = (double)xval;
- lval = (longlong)xval;
- break;
- case 3:
- memcpy(&lval, _swap(buf+offset,8), sizeof(unsigned int));
- dval = (double)lval;
- break;
- case 0:
- default:
- xval = (unsigned int)*(unsigned char *)(buf+offset);
- dval = (double)xval;
- lval = (longlong)xval;
- break;
- }
- case 'B':
- isint = 1;
- dval = (double)*(unsigned char *)(buf+offset);
- lval = (longlong)*(unsigned char *)(buf+offset);
- break;
- case 'I':
- isint = 1;
- dval = (double)*(short *)_swap(buf+offset,2);
- lval = (longlong)*(short *)_swap(buf+offset,2);
- break;
- case 'U':
- isint = 1;
- dval = (double)*(unsigned short *)_swap(buf+offset,2);
- lval = (longlong)*(unsigned short *)_swap(buf+offset,2);
- break;
- case 'J':
- isint = 1;
- dval = (double)*(int *)_swap(buf+offset,4);
- lval = (longlong)*(int *)_swap(buf+offset,4);
- break;
- case 'V':
- isint = 1;
- dval = (double)*(unsigned int *)_swap(buf+offset,4);
- lval = (longlong)*(unsigned int *)_swap(buf+offset,4);
- break;
- case 'K':
- isint = 1;
- dval = (double)*(longlong *)_swap(buf+offset,8);
- lval = (longlong)*(longlong *)_swap(buf+offset,8);
- break;
- case 'E':
- isint = 0;
- dval = (double)*(float *)_swap(buf+offset,4);
- lval = (longlong)*(float *)_swap(buf+offset,4);
- break;
- case 'D':
- isint = 0;
- dval = *(double *)_swap(buf+offset,8);
- lval = *(longlong *)_swap(buf+offset,8);
- break;
- case 'L':
- isint = 1;
- dval = (double)*(unsigned char *)(buf+offset);
- lval = (longlong)*(unsigned char *)(buf+offset);
- break;
- case 'A':
- default:
- gerror(stderr, "illegal numeric value for compare: %d\n", type);
- break;
- }
- if( t == PARSE_INTEGER ){
- if( isint ){
- if( lval < l )
- return -1;
- else if( lval > l )
- return 1;
- else
- return 0;
- }
- else{
- if( dval < l )
- return -1;
- else if( dval > l )
- return 1;
- else
- return 0;
- }
- }
- else{
- if( isint ){
- if( lval < d )
- return -1;
- else if( lval > d )
- return 1;
- else
- return 0;
- }
- else{
- if( dval < d )
- return -1;
- else if( dval > d )
- return 1;
- else
- return 0;
- }
- }
-}
-
-#ifdef ANSI_FUNC
-static int
-_idxbsearch(GIO gio, FITSHead fits, int type, int offset, int n,
- int exact, int edge, double d, longlong l, int t)
-#else
-static int _idxbsearch(gio, fits, type, offset, n, exact, edge, d, l, t)
- GIO gio;
- FITSHead fits;
- int type;
- int offset;
- int n;
- int exact;
- int edge;
- double d;
- longlong l;
- int t;
-#endif
-{
- int high, low, try;
- int cmp;
- int rowsize;
- size_t got;
- long ipos;
- char *buf=NULL;
-
- /* sanity check */
- if( !gio || !fits ) return -1;
-
- /* set limits */
- low = 0;
- high = ft_naxis(fits, 2)+1;
- rowsize = ft_naxis(fits, 1);
- /* search */
- while( (high - low) > 1){
- try = (high + low) / 2;
- /* grab desired row in index */
- ipos = fits->data + ((try-1)*rowsize);
- if( gseek(gio, (off_t)ipos, 0) < 0 ) return -1;
- buf = _gread(gio, NULL, sizeof(char), rowsize, &got);
- if( !buf || (got != (size_t)rowsize) ) return -1;
- /* compare row to key value */
- cmp = _idxcompare(buf, type, offset, n, d, l, t);
- if( buf ) xfree(buf);
- switch(cmp){
- /* thisval < val */
- case -1:
- low = try;
- break;
- /* thisval == val */
- case 0:
- /* to find first record, set hi */
- if( edge == -1 )
- high = try;
- /* for last record, set lo */
- else
- low = try;
- break;
- /* thisval > val */
- case 1:
- high = try;
- break;
- }
- }
- /* check for out of bounds and get candidate row */
- if( edge == 1 ){
- if( low == 0 ) {
- if( exact )
- return -1;
- else
- return 0;
- }
- try = low;
- }
- else{
- if( high == (ft_naxis(fits, 2)+1) ){
- if( exact )
- return -1;
- else
- return ft_naxis(fits, 2)+1;;
- }
- try = high;
- }
- /* grab desired row in index */
- ipos = fits->data + ((try-1)*rowsize);
- if( gseek(gio, (off_t)ipos, 0) < 0 ) return -1;
- buf = _gread(gio, NULL, sizeof(char), rowsize, &got);
- if( !buf || (got != (size_t)rowsize) ) return -1;
- /* compare row to key value */
- cmp = _idxcompare(buf, type, offset, n, d, l, t);
- if( buf ) xfree(buf);
- /* if row == key value, we got a match */
- if( !cmp || !exact ){
- if( edge == 1 )
- return low;
- else
- return high;
- }
- else
- return -1;
-}
-
-#ifdef ANSI_FUNC
-static int
-_idxrowcommon(idxvalrec *val1, idxvalrec *val2, int exact, int which,
- idxrowrec **x, int *start, int *stop, int *nrow)
-#else
-static int _idxrowcommon(val1, val2, exact, which, x, start, stop, nrow)
- idxvalrec *val1, *val2;
- int exact;
- int which;
- idxrowrec **x;
- int *start, *stop;
- int *nrow
-#endif
-{
- idxvalrec *v1=NULL, *v2=NULL;
-
- *start = -1;
- *stop = -1;
- *nrow = -1;
- *x = idxrownew();
- if( (val1->type == COL) && (val2->type == NUM) ){
- v1 = val1;
- v2 = val2;
- }
- if( v1 && v2 ){
- (*x)->type = COL;
- (*x)->rtype = IDX_ROW_LIST;
- (*x)->dofilt = 0;
- (*x)->s = xstrdup(v1->s);
- (*x)->v = v1;
- *nrow = v1->nrow;
- if( which & IDX_EDGE_LEFT )
- *start = _idxbsearch(v1->igio, v1->ifits, v1->vtype, v1->voffset, v1->vn,
- exact, -1, v2->dval, v2->ival, v2->ntype);
- if( which & IDX_EDGE_RIGHT )
- *stop = _idxbsearch(v1->igio, v1->ifits, v1->vtype, v1->voffset, v1->vn,
- exact, 1, v2->dval, v2->ival, v2->ntype);
- return 1;
- }
- else{
- (*x)->type = IDX_INDEF;
- (*x)->rtype = IDX_INDEF;
- (*x)->dofilt = 1;
- return 0;
- }
-}
-
-#ifdef ANSI_FUNC
-static int
-_idxrowaddrow(idxrowrec *r, int start, int stop)
-#else
- static int _idxrowaddrow(r, start, stop)
- idxrowrec *r;
- int start;
- int stop;
-#endif
-{
- if( !r ) return 0;
- if( r->nrow >= r->maxrow ){
- r->maxrow += IDX_ROW_INC;
- r->startrow = xrealloc(r->startrow, r->maxrow*sizeof(int));
- r->stoprow = xrealloc(r->stoprow, r->maxrow*sizeof(int));
- }
- r->startrow[r->nrow] = start;
- r->stoprow[r->nrow] = stop;
- r->nrow++;
- return r->nrow;
-}
-
-#ifdef ANSI_FUNC
-static void
-idxrowmark(idxrowrec *row1, idxrowrec *row2, char **mbuf, int *nm)
-#else
-static void idxrowmark(row1, row2, mbuf, nm)
- idxrowrec *row1, *row2;
- char **mbuf;
- int *nm;
-#endif
-{
- int i, j;
-
- *nm=0;
- for(i=0; i<row1->nrow; i++){
- *nm = MAX(*nm, row1->stoprow[i]);
- }
- for(i=0; i<row2->nrow; i++){
- *nm = MAX(*nm, row2->stoprow[i]);
- }
- *nm += 1;
- if( !(*mbuf = xcalloc(*nm, sizeof(char))) ){
- idxerror("can't allocate memory for index");
- }
- for(i=0; i<row1->nrow; i++){
- for(j=row1->startrow[i]; j<=row1->stoprow[i]; j++){
- (*mbuf)[j-1] |= 1;
- }
- }
- for(i=0; i<row2->nrow; i++){
- for(j=row2->startrow[i]; j<=row2->stoprow[i]; j++){
- (*mbuf)[j-1] |= 2;
- }
- }
-}
-
-#ifdef ANSI_FUNC
-static idxrowrec *
-_idxrowmerge(idxrowrec *x, idxrowrec *row1, idxrowrec *row2, int type)
-#else
-static idxrowrec *_idxrowmerge(x, row1, row2, type)
- idxrowrec *x;
- idxrowrec *row1;
- idxrowrec *row2
- int type;
-#endif
-{
- int last=-1;
- int in1=-1, in2=-1, on=0;
- int igot1=-1, igot2=-1;
- int fd[2];
- int ibuf1[SZ_LINE];
- int ibuf2[SZ_LINE];
- int obuf[SZ_LINE];
- FILE *ifd1, *ifd2, *ofd;
-
-#if HAVE_MINGW32==0
- /* we fork a process that will read the output from 2 instances of sort and
- either OR and AND the results. Doing this avoids having the main process
- read the output of the sorts and write to a new merge process */
- if( pipe(fd) < 0 ){
- x->type = IDX_INDEF;
- x->rtype = IDX_INDEF;
- x->dofilt = 1;
- return x;
- }
- if( (x->pid = fork()) < 0 ){
- x->type = IDX_INDEF;
- x->rtype = IDX_INDEF;
- x->dofilt = 1;
- return x;
- } else if( x->pid != 0 ){ /* parent */
- IPRINTF((stderr, "idxmerge(%d): %s %s\n",
- type, rowdisp(row1), rowdisp(row2)));
- close(fd[1]);
- x->ichan = fd[0];
- close(row1->ichan); row1->ichan=0;
- close(row2->ichan); row2->ichan=0;
- return x;
- }
- else{ /* child */
- close(fd[0]);
- if( !(ifd1 = fdopen(row1->ichan, "r")) ||
- !(ifd2 = fdopen(row2->ichan, "r")) ||
- !(ofd = fdopen(fd[1], "w")) ){
- _exit(1);
- }
- while( 1 ){
- if( in1 == igot1 ){
- igot1 = fread(ibuf1, sizeof(int), SZ_LINE, ifd1);
- if( igot1 != 0 ){
- in1 = 0;
- }
- }
- if( in2 == igot2 ){
- igot2 = fread(ibuf2, sizeof(int), SZ_LINE, ifd2);
- if( igot2 != 0 ){
- in2 = 0;
- }
- }
- if( igot1 && igot2 ){
- if( ibuf1[in1] < ibuf2[in2] ){
- switch(type){
- case IDX_SORT:
- obuf[on++] = ibuf1[in1];
- break;
- case IDX_AND_SORT:
- if( ibuf1[in1] == last )
- obuf[on++] = ibuf1[in1];
- break;
- case IDX_OR_SORT:
- if( ibuf1[in1] != last )
- obuf[on++] = ibuf1[in1];
- break;
- }
- last = ibuf1[in1++];
- }
- else{
- switch(type){
- case IDX_SORT:
- obuf[on++] = ibuf2[in2];
- break;
- case IDX_AND_SORT:
- if( ibuf2[in2] == last )
- obuf[on++] = ibuf2[in2];
- break;
- case IDX_OR_SORT:
- if( ibuf2[in2] != last )
- obuf[on++] = ibuf2[in2];
- break;
- }
- last = ibuf2[in2++];
- }
- }
- else if( igot1 ){
- switch(type){
- case IDX_SORT:
- obuf[on++] = ibuf2[in2];
- break;
- case IDX_AND_SORT:
- if( ibuf1[in1] == last )
- obuf[on++] = ibuf1[in1];
- break;
- case IDX_OR_SORT:
- if( ibuf1[in1] != last )
- obuf[on++] = ibuf1[in1];
- break;
- }
- last = ibuf1[in1++];
- }
- else if( igot2 ){
- switch(type){
- case IDX_SORT:
- obuf[on++] = ibuf2[in2];
- break;
- case IDX_AND_SORT:
- if( ibuf2[in2] == last )
- obuf[on++] = ibuf2[in2];
- break;
- case IDX_OR_SORT:
- if( ibuf2[in2] != last )
- obuf[on++] = ibuf2[in2];
- break;
- }
- last = ibuf2[in2++];
- }
- else{
- break;
- }
- if( on == SZ_LINE ){
- fwrite(obuf, sizeof(int), on, ofd);
- fflush(ofd);
- on = 0;
- }
- }
- fwrite(obuf, sizeof(int), on, ofd);
- fflush(ofd);
- _exit(0);
- }
-#else
- idxerror("can't use index optimization with MinGW");
-#endif
- /* shouldn't get here */
- return NULL;
-}
-
-/*
- *
- * public routines
- *
- */
-
-#ifdef ANSI_FUNC
-idxrowrec *idxall(idxrowrec *row)
-#else
-idxrowrec *idxall(row)
- idxrowrec *row;
-#endif
-{
- Filter filt;
- idxrowrec *x;
-
- /* sanity check */
- if( !(filt = FilterDefault()) )
- idxerror("filter symbol table not initialized");
- /* most range list columns need to be sorted; col==val already is sorted */
- if( (row->type == COL) && (row->rtype == IDX_ROW_LIST) && row->dosort ){
- x = idxrownew();
- if( _idxstartsort(0, &(x->ichan), &(x->ochan), &(x->pid)) &&
- _idxwritesort(x, row) ){
- x->type = row->type;
- /* doesn't matter which sort we use here */
- x->rtype = IDX_SORT;
- x->dofilt = row->dofilt;
- /* close input to start sort */
- close(x->ochan);
- x->ochan = 0;
- }
- else{
- x->type = IDX_INDEF;
- x->rtype = IDX_INDEF;
- x->dofilt = 1;
- }
- }
- /* everything else is fine as is */
- else{
- x = row;
- }
- IPRINTF((stderr, "idxall(%d): %s\n", x->dofilt, rowdisp(x)));
- filt->idx = x;
- return x;
-}
-
-#ifdef ANSI_FUNC
-void *
-idxread(idxrowrec *row, GIO gio, FITSHead fits,
- void *buf, size_t size, size_t get, size_t *got, int *dofilt)
-#else
- void *idxread(row, gio, fits, buf, size, get, got, dofilt)
- idxrowrec *row;
- GIO gio;
- FITSHead fits;
- void *buf;
- size_t size;
- size_t get;
- size_t *got;
- int *dofilt;
-#endif
-{
- int j, k=0;
- int left;
- int nrow;
- int rowsize;
- int ioffset;
- int itype;
- int isize;
- int start, stop;
- int *ibuf=NULL;
- size_t i;
- char nbuf[8];
- long ipos;
- struct stat fbuf;
-
- /* initialize */
- *got = 0;
- *dofilt = row->dofilt;
-
- /* handle particular io method */
- switch( idx_io ){
- case IDX_IO_MMAP:
-#ifdef HAVE_SYS_MMAN_H
- if( !row->fdata ){
- if( fstat(fileno(gio->fp), &fbuf) < 0 ){
- *got = 0;
- idxerror("can't fstat data file");
- goto done;
- }
- row->flen = fbuf.st_size;
- if( (row->fdata = mmap(NULL, row->flen, PROT_READ, MAP_PRIVATE,
- fileno(gio->fp), 0)) == MAP_FAILED ){
- *got = 0;
- idxerror("can't mmap data file");
- perror("mmap");
- goto done;
- }
- }
-#else
- idxerror("mmap not supported on this system");
-#endif
- break;
- case IDX_IO_LSEEK:
- break;
- }
-
- /* get rows */
- switch(row->rtype){
- case IDX_ROW_LIST:
- if( !(ibuf = xcalloc(get, sizeof(int))) ){
- *got = 0;
- idxerror("can't allocate index record buffer");
- goto done;
- }
- rowsize = ft_naxis(row->v->ifits, 1);
- ioffset = row->v->ioffset;
- itype = row->v->itype;
- isize = ft_sizeof(row->v->itype);
- for(left=get, i=0; (left>0) && (i<(size_t)row->nrow); i++){
- if( (row->startrow[i]<0) && (row->stoprow[i]<0) ) continue;
- nrow = row->stoprow[i] - row->startrow[i] + 1;
- if( left > nrow ){
- start = row->startrow[i];
- stop = row->stoprow[i];
- row->startrow[i] = -1;
- row->stoprow[i] = -1;
- *got += nrow;
- left -= nrow;
- }
- else if( nrow == left ){
- start = row->startrow[i];
- stop = row->stoprow[i];
- row->startrow[i] = -1;
- row->stoprow[i] = -1;
- *got += nrow;
- left = 0;
- }
- else{
- start = row->startrow[i];
- stop = start + left - 1;
- row->startrow[i] += left;
- *got += left;
- left = 0;
- }
- for(j=start; j<=stop; j++){
- ipos = row->v->ifits->data + ((j-1)*rowsize) + ioffset;
- switch( idx_io ){
- case IDX_IO_MMAP:
- if( row->v->idata ){
-#ifdef HAVE_SYS_MMAN_H
- memcpy(nbuf, &(row->v->idata[ipos]), isize);
-#else
- idxerror("mmap not supported on this system");
-#endif
- break;
- }
- case IDX_IO_LSEEK:
- if( gseek(row->v->igio, (off_t)ipos, 0) < 0 ){
- *got = 0;
- idxerror("can't seek into index file");
- goto done;
- }
- if( !gread(row->v->igio, nbuf, isize, 1) ){
- *got = 0;
- idxerror("can't read index file");
- goto done;
- }
- break;
- }
- switch(itype){
- case 'B':
- ibuf[k++] = (int)*(unsigned char *)(nbuf);
- break;
- case 'I':
- ibuf[k++] = (int)*(short *)_swap(nbuf,2);
- break;
- case 'U':
- ibuf[k++] = (int)*(unsigned short *)_swap(nbuf,2);
- break;
- case 'J':
- ibuf[k++] = (int)*(int *)_swap(nbuf,4);
- break;
- case 'V':
- ibuf[k++] = (int)*(unsigned int *)_swap(nbuf,4);
- break;
- case 'K':
- idxerror("64-bit integer not supported for index");
- break;
- default:
- *got = 0;
- idxerror("illegal index data type");
- goto done;
- }
- }
- }
- /* now grab the row associated with each row value */
- for(i=0; i<*got; i++){
- /* grab desired row in index */
- ipos = fits->data + ((ibuf[i]-1)*size);
- switch( idx_io ){
- case IDX_IO_MMAP:
-#ifdef HAVE_SYS_MMAN_H
- memcpy((char *)buf+(i*size), &(row->fdata[ipos]), size);
-#else
- idxerror("mmap not supported on this system");
-#endif
- break;
- case IDX_IO_LSEEK:
- if( gseek(gio, (off_t)ipos, 0) < 0 ){
- return 0;
- }
- if( !gread(gio, (char *)buf+(i*size), size, 1) ){
- *got = i;
- }
- break;
- }
- }
- break;
- case IDX_SORT:
- case IDX_OR_SORT:
- case IDX_AND_SORT:
- if( !row->ifile && !(row->ifile = fdopen(row->ichan, "r")) ){
- *got = 0;
- idxerror("can't fdup input index records");
- goto done;
- }
- if( !(ibuf = xcalloc(get, sizeof(int))) ){
- *got = 0;
- idxerror("can't allocate index record buffer");
- goto done;
- }
- /* read the row values */
- *got=fread(ibuf, sizeof(int), get, row->ifile);
- /* now grab the row associated with each row value */
- for(i=0; i<*got; i++){
- /* grab desired row in index */
- ipos = fits->data + ((ibuf[i]-1)*size);
- switch( idx_io ){
- case IDX_IO_MMAP:
-#ifdef HAVE_SYS_MMAN_H
- memcpy((char *)buf+(i*size), &(row->fdata[ipos]), size);
-#else
- idxerror("mmap not supported on this system");
-#endif
- break;
- case IDX_IO_LSEEK:
- if( gseek(gio, (off_t)ipos, 0) < 0 ){
- return 0;
- }
- if( !gread(gio, (char *)buf+(i*size), size, 1) ){
- *got = i;
- }
- break;
- }
- }
- break;
- case IDX_INDEF:
- default:
- *dofilt = 1;
- _gread(gio, (void *)buf, size, get, got);
- break;
- }
-
-done:
- if( ibuf ) xfree(ibuf);
- return (void *)buf;
-}
-
-#ifdef ANSI_FUNC
-idxrowrec *idxor(idxrowrec *row1, idxrowrec *row2)
-#else
-idxrowrec *idxor(row1, row2)
- idxrowrec *row1, *row2;
-#endif
-{
- int i;
- int nm=0;
- int start=0, stop=0;
- char *mbuf=NULL;
- idxrowrec *x=NULL;
- idxrowrec *r1, *r2;;
-
- x = idxrownew();
- if( (row1->type == IDX_INDEF) || (row2->type == IDX_INDEF) ){
- /* if we have an indef we will have to go through all of the rows. */
- x->type = IDX_INDEF;
- x->rtype = IDX_INDEF;
- x->dofilt = 1;
- IPRINTF((stderr, "idxor(%d): INDEF %s\n", x->dofilt, rowdisp(x)));
- return x;
- }
- if( (row1->type == COL) && (row2->type == COL) &&
- (row1->rtype == IDX_ROW_LIST) && (row2->rtype == IDX_ROW_LIST) &&
- row1->s && row2->s && !strcmp(row1->s, row2->s) ){
- IPRINTF((stderr, "idxor: %s %s", rowdisp(row1), rowdisp(row2)));
- x->type = COL;
- x->rtype = IDX_ROW_LIST;
- x->dofilt = 0;
- x->s = xstrdup(row1->s);
- x->v = row1->v;
- /* a bit quicker when we have a simple OR */
- if( (row1->nrow == 1) && (row2->nrow == 1) ){
- if( (row1->stoprow[0] < row2->startrow[0]) ||
- (row2->stoprow[0] < row1->startrow[0]) ){
- _idxrowaddrow(x, row1->startrow[0], row1->stoprow[0]);
- _idxrowaddrow(x, row2->startrow[0], row2->stoprow[0]);
- }
- else{
- start = MIN(row1->startrow[0], row2->startrow[0]);
- stop = MAX(row1->stoprow[0], row2->stoprow[0]);
- _idxrowaddrow(x, start, stop);
- }
- IPRINTF((stderr, " =>(q) %s\n", rowdisp(x)));
- return x;
- }
- idxrowmark(row1, row2, &mbuf, &nm);
- for(i=0; i<nm; i++){
- if( mbuf[i] ){
- if( !start )
- start = i+1;
- }
- else{
- if( start ){
- stop = i;
- _idxrowaddrow(x, start, stop);
- start = 0;
- stop = 0;
- }
- }
- }
- if( start ){
- stop = nm;
- _idxrowaddrow(x, start, stop);
- start = 0;
- stop = 0;
- }
- if( mbuf ) xfree(mbuf);
- IPRINTF((stderr, " => %s\n", rowdisp(x)));
- return x;
- }
- else{
- if( (row1->type == REG) || (row2->type == REG) ){
- x->type = REG;
- x->dofilt = 1;
- }
- else{
- x->type = COL;
- x->dofilt = 0;
- }
- x->rtype = IDX_OR_SORT;
- /* two row lists: we sort both at once */
- if( (row1->rtype == IDX_ROW_LIST) && (row2->rtype == IDX_ROW_LIST) ){
- IPRINTF((stderr, "idxor sort: %s %s\n", rowdisp(row1), rowdisp(row2)));
- /* open sort program and return only unique records */
- if( !_idxstartsort(IDX_OR_SORT, &(x->ichan), &(x->ochan), &(x->pid)) ||
- !_idxwritesort(x, row1) || !_idxwritesort(x, row2) ){
- x->type = IDX_INDEF;
- x->rtype = IDX_INDEF;
- x->dofilt = 1;
- return x;
- }
- /* close input to start sort */
- close(x->ochan);
- x->ochan = 0;
- /* return here */
- return x;
- }
- /* at least one sorted process: we set up a merge (and maybe a sort) */
- else if( row1->rtype == IDX_ROW_LIST ){
- IPRINTF((stderr, "idxor sort/merge: %s %s\n",
- rowdisp(row1), rowdisp(row2)));
- r1 = row2;
- r2 = idxrownew();
- r2->type = row1->type;
- r2->rtype = row1->rtype;
- r2->s = xstrdup(row1->s);
- r2->dofilt = row1->dofilt;
- /* open sort program to return all records */
- if( !_idxstartsort(0, &(r2->ichan), &(r2->ochan), &(r2->pid)) ||
- !_idxwritesort(r2, row1) ){
- x->type = IDX_INDEF;
- x->rtype = IDX_INDEF;
- x->dofilt = 1;
- return x;
- }
- /* close input to start sort */
- close(r2->ochan);
- r2->ochan = 0;
- /* common merge code */
- return _idxrowmerge(x, r1, r2, IDX_OR_SORT);
- }
- /* at least one sorted process: we set up a merge (and maybe a sort) */
- else if( row2->rtype == IDX_ROW_LIST ){
- r1 = row1;
- IPRINTF((stderr, "idxor sort/merge: %s %s\n",
- rowdisp(row1), rowdisp(row2)));
- r2 = idxrownew();
- r2->type = row2->type;
- r2->rtype = row2->rtype;
- r2->s = xstrdup(row2->s);
- r2->dofilt = row2->dofilt;
- /* open sort program to return all records */
- if( !_idxstartsort(0, &(r2->ichan), &(r2->ochan), &(r2->pid)) ||
- !_idxwritesort(r2, row2) ){
- x->type = IDX_INDEF;
- x->rtype = IDX_INDEF;
- x->dofilt = 1;
- return x;
- }
- /* close input to start sort */
- close(r2->ochan);
- r2->ochan = 0;
- /* common merge code */
- return _idxrowmerge(x, r1, r2, IDX_OR_SORT);
- }
- else{
- return _idxrowmerge(x, row1, row2, IDX_OR_SORT);
- }
- }
-}
-
-#ifdef ANSI_FUNC
-idxrowrec *idxand(idxrowrec *row1, idxrowrec *row2)
-#else
-idxrowrec *idxand(row1, row2)
- idxrowrec *row1, *row2;
-#endif
-{
- int i;
- int nm=0;
- int start=0, stop=0;
- char *mbuf=NULL;
- idxrowrec *x=NULL;
- idxrowrec *r1, *r2;
-
- if( (row1->type == IDX_INDEF) || (row2->type == IDX_INDEF) ){
- /* if we have an indef we return the other row and turn dofilter on.
- this works with AND but not with OR */
- if( (row1->type != IDX_INDEF) ){
- x = row1;
- x->dofilt = 1;
- }
- else if( (row2->type != IDX_INDEF) ){
- x = row2;
- x->dofilt = 1;
- }
- /* can't happen */
- else{
- x = idxrownew();
- x->type = IDX_INDEF;
- x->rtype = IDX_INDEF;
- x->dofilt = 1;
- }
- IPRINTF((stderr, "idxand(%d): INDEF %s\n", x->dofilt, rowdisp(x)));
- return x;
- }
- x = idxrownew();
- if( (row1->type == COL) && (row2->type == COL) &&
- (row1->rtype == IDX_ROW_LIST) && (row2->rtype == IDX_ROW_LIST) &&
- row1->s && row2->s && !strcmp(row1->s, row2->s) ){
- IPRINTF((stderr, "idxand: %s %s", rowdisp(row1), rowdisp(row2)));
- x->type = COL;
- x->rtype = IDX_ROW_LIST;
- x->dofilt = 0;
- x->s = xstrdup(row1->s);
- x->v = row1->v;
- /* a bit quicker when we have a simple AND */
- if( (row1->nrow == 1) && (row2->nrow == 1) ){
- start = MAX(row1->startrow[0], row2->startrow[0]);
- stop = MIN(row1->stoprow[0], row2->stoprow[0]);
- if( start <= stop ){
- _idxrowaddrow(x, start, stop);
- }
- IPRINTF((stderr, " =>(q) %s\n", rowdisp(x)));
- return x;
- }
- idxrowmark(row1, row2, &mbuf, &nm);
- for(i=0; i<nm; i++){
- if( mbuf[i] == 3 ){
- if( !start )
- start = i+1;
- }
- else{
- if( start ){
- stop = i;
- _idxrowaddrow(x, start, stop);
- start = 0;
- stop = 0;
- }
- }
- }
- if( start ){
- stop = nm;
- _idxrowaddrow(x, start, stop);
- start = 0;
- stop = 0;
- }
- if( mbuf ) xfree(mbuf);
- IPRINTF((stderr, " => %s\n", rowdisp(x)));
- return x;
- }
- else{
- if( (row1->type == REG) || (row2->type == REG) ){
- x->type = REG;
- x->dofilt = 1;
- }
- else{
- x->type = COL;
- x->dofilt = 0;
- }
- x->rtype = IDX_OR_SORT;
- /* two row lists: we sort both at once */
- if( (row1->rtype == IDX_ROW_LIST) && (row2->rtype == IDX_ROW_LIST) ){
- IPRINTF((stderr, "idxand sort: %s %s\n", rowdisp(row1), rowdisp(row2)));
- /* open sort program and return only dup records */
- if( !_idxstartsort(IDX_AND_SORT, &(x->ichan), &(x->ochan), &(x->pid)) ||
- !_idxwritesort(x, row1) || !_idxwritesort(x, row2) ){
- x->type = IDX_INDEF;
- x->rtype = IDX_INDEF;
- x->dofilt = 1;
- return x;
- }
- /* close input to start sort */
- close(x->ochan);
- x->ochan = 0;
- /* return here */
- return x;
- }
- /* at least one sorted process: we set up a merge (and maybe a sort) */
- else if( row1->rtype == IDX_ROW_LIST ){
- IPRINTF((stderr, "idxor sort/merge: %s %s\n",
- rowdisp(row1), rowdisp(row2)));
- r1 = row2;
- r2 = idxrownew();
- r2->type = row1->type;
- r2->rtype = row1->rtype;
- r2->s = xstrdup(row1->s);
- r2->dofilt = row1->dofilt;
- /* open sort program to return all records */
- if( !_idxstartsort(0, &(r2->ichan), &(r2->ochan), &(r2->pid)) ||
- !_idxwritesort(r2, row1) ){
- x->type = IDX_INDEF;
- x->rtype = IDX_INDEF;
- x->dofilt = 1;
- return x;
- }
- /* close input to start sort */
- close(r2->ochan);
- r2->ochan = 0;
- /* common merge code */
- return _idxrowmerge(x, r1, r2, IDX_AND_SORT);
- }
- /* at least one sorted process: we set up a merge (and maybe a sort) */
- else if( row2->rtype == IDX_ROW_LIST ){
- r1 = row1;
- IPRINTF((stderr, "idxor sort/merge: %s %s\n",
- rowdisp(row1), rowdisp(row2)));
- r2 = idxrownew();
- r2->type = row2->type;
- r2->rtype = row2->rtype;
- r2->s = xstrdup(row2->s);
- r2->dofilt = row2->dofilt;
- /* open sort program to return all records */
- if( !_idxstartsort(0, &(r2->ichan), &(r2->ochan), &(r2->pid)) ||
- !_idxwritesort(r2, row2) ){
- x->type = IDX_INDEF;
- x->rtype = IDX_INDEF;
- x->dofilt = 1;
- return x;
- }
- /* close input to start sort */
- close(r2->ochan);
- r2->ochan = 0;
- /* common merge code */
- return _idxrowmerge(x, r1, r2, IDX_AND_SORT);
- }
- else{
- return _idxrowmerge(x, row1, row2, IDX_AND_SORT);
- }
- }
-}
-
-#ifdef ANSI_FUNC
-idxrowrec *idxrowreg(idxvalrec *val)
-#else
-idxrowrec *idxrowreg(idxvalrec *val)
- idxvalrec *val;
-#endif
-{
- int i=0, j=0;
- idxrowrec *x=NULL;
- idxrowrec *r[2];
- int start[2], stop[2];
-
- x = idxrownew();
- if( (val->type == INDEF) ||
- ((val->rv[0]->type == INDEF) && (val->rv[1]->type == INDEF)) ){
- x->type = IDX_INDEF;
- x->rtype = IDX_INDEF;
- x->dofilt = 1;
- return x;
- }
- for(i=0; i<2; i++){
- r[i] = idxrownew();
- /* handle case where one of the regions has no index */
- if( val->rv[i]->type == INDEF ){
- r[i]->type = IDX_INDEF;
- r[i]->rtype = IDX_INDEF;
- r[i]->dofilt = 1;
- continue;
- }
- /* j will be the index of the valid val record we use in the output row */
- j = i;
- r[i]->type = REG;
- r[i]->rtype = IDX_ROW_LIST;
- r[i]->s = xstrdup(val->rv[i]->s);
- r[i]->v = val->rv[i];
- start[i] = _idxbsearch(val->rv[i]->igio,
- val->rv[i]->ifits, val->rv[i]->vtype,
- val->rv[i]->voffset, val->rv[i]->vn,
- 0, -1, val->rlo[i], (longlong)0, PARSE_FLOAT);
- stop[i] = _idxbsearch(val->rv[i]->igio,
- val->rv[i]->ifits, val->rv[i]->vtype,
- val->rv[i]->voffset, val->rv[i]->vn,
- 0, 1, val->rhi[i], (longlong)0, PARSE_FLOAT);
- if( (start[i] > 0) && (stop[i] > 0) ){
- _idxrowaddrow(r[i], start[i], stop[i]);
- }
- }
- x = idxand(r[0], r[1]);
- x->type = REG;
- x->dofilt = 1;
- x->v = val->rv[j];
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxrowrec *idxrowfun(idxvalrec *UNUSED(val))
-#else
-idxrowrec *idxrowfun(idxvalrec *val)
- idxvalrec *val;
-#endif
-{
- idxrowrec *x=NULL;
-
- x = idxrownew();
- x->type = IDX_INDEF;
- x->rtype = IDX_INDEF;
- x->dofilt = 1;
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxrowrec *idxroweq(idxvalrec *val1, idxvalrec *val2)
-#else
-idxrowrec *idxroweq(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- int start, stop;
- int nrow;
- idxrowrec *x=NULL;
-
- if( (val1->type == NUM) && (val2->type == COL) ){
- return idxroweq(val2, val1);
- }
- IPRINTF((stderr, "idxeq: "));
- if( _idxrowcommon(val1, val2, 1, IDX_EDGE_BOTH, &x, &start, &stop, &nrow) ){
- IPRINTF((stderr, "%s start=%d,stop=%d", x->s, start, stop));
- if( (start > 0) && (stop > 0) ){
- _idxrowaddrow(x, start, stop);
- }
- IPRINTF((stderr, " => "));
- }
- IPRINTF((stderr, "%s\n", rowdisp(x)));
- /* this is the only operator resulting in a sorted range list */
- x->dosort = 0;
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxrowrec *idxrowne(idxvalrec *val1, idxvalrec *val2)
-#else
-idxrowrec *idxrowne(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- int start, stop;
- int nrow;
- int i=0;
- idxrowrec *x=NULL;
-
- if( (val1->type == NUM) && (val2->type == COL) ){
- return idxrowne(val2, val1);
- }
- IPRINTF((stderr, "idxne: "));
- if( _idxrowcommon(val1, val2, 0, IDX_EDGE_BOTH, &x, &start, &stop, &nrow) ){
- IPRINTF((stderr, "%s start=%d,stop=%d", x->s, start, stop));
- if( start > 1 ){
- _idxrowaddrow(x, 1, start-1);
- i++;
- }
- if( stop && (stop < nrow) ){
- _idxrowaddrow(x, stop+1, nrow);
- IPRINTF((stderr, " start=%d,stop=%d", x->startrow[i], x->stoprow[i]));
- }
- IPRINTF((stderr, " => "));
- }
- IPRINTF((stderr, "%s\n", rowdisp(x)));
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxrowrec *idxrowlt(idxvalrec *val1, idxvalrec *val2)
-#else
-idxrowrec *idxrowlt(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- int start, stop;
- int nrow;
- int i=0;
- idxrowrec *x=NULL;
-
- if( (val1->type == NUM) && (val2->type == COL) ){
- return idxrowgt(val2, val1);
- }
- IPRINTF((stderr, "idxlt: "));
- if( _idxrowcommon(val1, val2, 0, IDX_EDGE_LEFT, &x, &start, &stop, &nrow) ){
- IPRINTF((stderr, "%s start=%d,stop=%d", x->s, start, stop));
- if( start > 1 ){
- _idxrowaddrow(x, 1, start-1);
- i++;
- }
- IPRINTF((stderr, " => "));
- }
- IPRINTF((stderr, "%s\n", rowdisp(x)));
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxrowrec *idxrowle(idxvalrec *val1, idxvalrec *val2)
-#else
-idxrowrec *idxrowle(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- int start, stop;
- int nrow;
- idxrowrec *x=NULL;
-
- if( (val1->type == NUM) && (val2->type == COL) ){
- return idxrowge(val2, val1);
- }
- IPRINTF((stderr, "idxle: "));
- if( _idxrowcommon(val1, val2, 0, IDX_EDGE_RIGHT, &x, &start, &stop, &nrow) ){
- IPRINTF((stderr, "%s start=%d,stop=%d", x->s, start, stop));
- if( stop > 0 ){
- _idxrowaddrow(x, 1, stop);
- }
- IPRINTF((stderr, " => "));
- }
- IPRINTF((stderr, "%s\n", rowdisp(x)));
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxrowrec *idxrowgt(idxvalrec *val1, idxvalrec *val2)
-#else
-idxrowrec *idxrowgt(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- int start, stop;
- int nrow;
- int i=0;
- idxrowrec *x=NULL;
-
- if( (val1->type == NUM) && (val2->type == COL) ){
- return idxrowlt(val2, val1);
- }
- IPRINTF((stderr, "idxgt: "));
- if( _idxrowcommon(val1, val2, 0, IDX_EDGE_RIGHT, &x, &start, &stop, &nrow) ){
- IPRINTF((stderr, "%s start=%d,stop=%d ", x->s, start, stop));
- if( (stop >= 0) && (stop < nrow) ){
- _idxrowaddrow(x, stop+1, nrow);
- i++;
- }
- IPRINTF((stderr, " => "));
- }
- IPRINTF((stderr, "%s\n", rowdisp(x)));
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxrowrec *idxrowge(idxvalrec *val1, idxvalrec *val2)
-#else
-idxrowrec *idxrowge(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- int start, stop;
- int nrow;
- int i=0;
- idxrowrec *x=NULL;
-
- if( (val1->type == NUM) && (val2->type == COL) ){
- return idxrowle(val2, val1);
- }
- IPRINTF((stderr, "idxge: "));
- if( _idxrowcommon(val1, val2, 0, IDX_EDGE_LEFT, &x, &start, &stop, &nrow) ){
- IPRINTF((stderr, "%s start=%d,stop=%d ", x->s, start, stop));
- if( (start > 0) && (start <= nrow) ){
- _idxrowaddrow(x, start, nrow);
- i++;
- }
- IPRINTF((stderr, " => "));
- }
- IPRINTF((stderr, "%s\n", rowdisp(x)));
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxvalrec *idxvaladd(idxvalrec *val1, idxvalrec *val2)
-#else
-idxvalrec *idxvaladd(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- idxvalrec *x=NULL;
-
- x = idxvalnew(NULL);
- if( (val1->type == NUM) && (val2->type == NUM) ){
- x->type = NUM;
- if( (val1->ntype == PARSE_FLOAT) || (val2->ntype == PARSE_FLOAT) ){
- x->ntype = PARSE_FLOAT;
- x->dval = val1->dval + val2->dval;
- IPRINTF((stderr, "valadd: %f + %f => %f\n",
- val1->dval, val2->dval, x->dval));
- }
- else{
- x->ntype = PARSE_INTEGER;
- x->ival = val1->ival + val2->ival;
- x->dval = x->ival;
- snprintf(fmt, SZ_LINE, "valadd: %s + %s => %s\n", LFMT, LFMT, LFMT);
- IPRINTF((stderr, fmt, val1->ival, val2->ival, x->ival));
- }
- }
- else{
- x->type = INDEF;
- }
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxvalrec *idxvalsub(idxvalrec *val1, idxvalrec *val2)
-#else
-idxvalrec *idxvalsub(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- idxvalrec *x=NULL;
-
- x = idxvalnew(NULL);
- if( (val1->type == NUM) && (val2->type == NUM) ){
- x->type = NUM;
- if( (val1->ntype == PARSE_FLOAT) || (val2->ntype == PARSE_FLOAT) ){
- x->ntype = PARSE_FLOAT;
- x->dval = val1->dval - val2->dval;
- IPRINTF((stderr, "valsub: %f - %f => %f\n",
- val1->dval, val2->dval, x->dval));
- }
- else{
- x->ntype = PARSE_INTEGER;
- x->ival = val1->ival - val2->ival;
- x->dval = x->ival;
- snprintf(fmt, SZ_LINE, "valsub: %s - %s => %s\n", LFMT, LFMT, LFMT);
- IPRINTF((stderr, fmt, val1->ival, val2->ival, x->ival));
- }
- }
- else{
- x->type = INDEF;
- }
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxvalrec *idxvalmul(idxvalrec *val1, idxvalrec *val2)
-#else
-idxvalrec *idxvalmul(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- idxvalrec *x=NULL;
-
- x = idxvalnew(NULL);
- if( (val1->type == NUM) && (val2->type == NUM) ){
- x->type = NUM;
- if( (val1->ntype == PARSE_FLOAT) || (val2->ntype == PARSE_FLOAT) ){
- x->ntype = PARSE_FLOAT;
- x->dval = val1->dval * val2->dval;
- IPRINTF((stderr, "valmul: %f * %f => %f\n",
- val1->dval, val2->dval, x->dval));
- }
- else{
- x->ntype = PARSE_INTEGER;
- x->ival = val1->ival * val2->ival;
- x->dval = x->ival;
- snprintf(fmt, SZ_LINE, "valmul: %s * %s => %s\n", LFMT, LFMT, LFMT);
- IPRINTF((stderr, fmt, val1->ival, val2->ival, x->ival));
- }
- }
- else{
- x->type = INDEF;
- }
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxvalrec *idxvaldiv(idxvalrec *val1, idxvalrec *val2)
-#else
-idxvalrec *idxvaldiv(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- idxvalrec *x=NULL;
-
- x = idxvalnew(NULL);
- if( (val1->type == NUM) && (val2->type == NUM) ){
- x->type = NUM;
- if( val2->dval == 0.0 )
- idxerror("can't divide by zero");
- if( (val1->ntype == PARSE_FLOAT) || (val2->ntype == PARSE_FLOAT) ){
- x->dval = val1->dval / val2->dval;
- x->ntype = PARSE_FLOAT;
- }
- else{
- x->ival = val1->ival / val2->ival;
- x->ntype = PARSE_INTEGER;
- }
- IPRINTF((stderr, "valdiv: %f / %f => %f\n",
- val1->dval, val2->dval, x->dval));
- }
- else{
- x->type = INDEF;
- }
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxvalrec *idxvalmod(idxvalrec *val1, idxvalrec *val2)
-#else
-idxvalrec *idxvalmod(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- idxvalrec *x=NULL;
-
- x = idxvalnew(NULL);
- if( (val1->type == NUM) && (val2->type == NUM) ){
- x->type = NUM;
- if( (val1->ntype == PARSE_FLOAT) || (val2->ntype == PARSE_FLOAT) ){
- idxerror("can't use mod operator with floating point value");
- }
- else{
- x->ntype = PARSE_INTEGER;
- x->ival = val1->ival % val2->ival;
- x->dval = x->ival;
- snprintf(fmt, SZ_LINE, "valmod: %s mod %s => %s\n", LFMT, LFMT, LFMT);
- IPRINTF((stderr, fmt, val1->ival, val2->ival, x->ival));
- }
- }
- else{
- x->type = INDEF;
- }
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxvalrec *idxvaland(idxvalrec *val1, idxvalrec *val2)
-#else
-idxvalrec *idxvaland(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- idxvalrec *x=NULL;
-
- x = idxvalnew(NULL);
- if( (val1->type == NUM) && (val2->type == NUM) ){
- x->type = NUM;
- x->ntype = PARSE_INTEGER;
- if( (val1->ntype == PARSE_FLOAT) || (val2->ntype == PARSE_FLOAT) )
- x->ival = (longlong)val1->dval & (longlong)val2->dval;
- else
- x->ival = val1->ival & val2->ival;
- x->dval = x->ival;
- snprintf(fmt, SZ_LINE, "valand: %s & %s => %s\n", LFMT, LFMT, LFMT);
- IPRINTF((stderr, fmt, val1->ival, val2->ival, x->ival));
- }
- else{
- x->type = INDEF;
- }
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxvalrec *idxvalor(idxvalrec *val1, idxvalrec *val2)
-#else
-idxvalrec *idxvalor(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- idxvalrec *x=NULL;
-
- x = idxvalnew(NULL);
- if( (val1->type == NUM) && (val2->type == NUM) ){
- x->type = NUM;
- x->ntype = PARSE_INTEGER;
- if( (val1->ntype == PARSE_FLOAT) || (val2->ntype == PARSE_FLOAT) )
- x->ival = (longlong)val1->dval | (longlong)val2->dval;
- else
- x->ival = val1->ival | val2->ival;
- x->dval = x->ival;
- snprintf(fmt, SZ_LINE, "valor: %s | %s => %s\n", LFMT, LFMT, LFMT);
- IPRINTF((stderr, fmt, val1->ival, val2->ival, x->ival));
- }
- else{
- x->type = INDEF;
- }
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxvalrec *idxvalxor(idxvalrec *val1, idxvalrec *val2)
-#else
-idxvalrec *idxvalxor(val1, val2)
- idxvalrec *val1, *val2;
-#endif
-{
- idxvalrec *x=NULL;
-
- x = idxvalnew(NULL);
- if( (val1->type == NUM) && (val2->type == NUM) ){
- x->type = NUM;
- x->ntype = PARSE_INTEGER;
- if( (val1->ntype == PARSE_FLOAT) || (val2->ntype == PARSE_FLOAT) )
- x->ival = (longlong)val1->dval ^ (longlong)val2->dval;
- else
- x->ival = val1->ival ^ val2->ival;
- x->dval = x->ival;
- snprintf(fmt, SZ_LINE, "valxor: %s ^ %s => %s\n", LFMT, LFMT, LFMT);
- IPRINTF((stderr, fmt, val1->ival, val2->ival, x->ival));
- }
- else{
- x->type = INDEF;
- }
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxvalrec *idxvalnot(idxvalrec *val)
-#else
-idxvalrec *idxvalnot(val)
- idxvalrec *val;
-#endif
-{
- idxvalrec *x=NULL;
-
- x = idxvalnew(NULL);
- x->type = NUM;
- x->ntype = PARSE_INTEGER;
- if( val->ntype == PARSE_FLOAT )
- x->ival = !val->dval;
- else
- x->ival = !val->ival;
- x->dval = x->ival;
- snprintf(fmt, SZ_LINE, "valnot: %s => %s\n", LFMT, LFMT);
- IPRINTF((stderr, fmt, val->ival, x->ival));
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxvalrec *idxvalcom(idxvalrec *val)
-#else
-idxvalrec *idxvalcom(val)
- idxvalrec *val;
-#endif
-{
- idxvalrec *x=NULL;
-
- x = idxvalnew(NULL);
- x->type = NUM;
- x->ntype = PARSE_INTEGER;
- if( val->ntype == PARSE_FLOAT )
- x->ival = ~(longlong)val->dval;
- else
- x->ival = ~val->ival;
- x->dval = x->ival;
- snprintf(fmt, SZ_LINE, "valcom: %s => %s\n", LFMT, LFMT);
- IPRINTF((stderr, fmt, val->ival, x->ival));
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxvalrec *idxvalmin(idxvalrec *val)
-#else
-idxvalrec *idxvalmin(val)
- idxvalrec *val;
-#endif
-{
- idxvalrec *x=NULL;
-
- x = idxvalnew(NULL);
- x->type = NUM;
- x->ntype = val->ntype;
- x->dval = -val->dval;
- x->ival = -val->ival;
- if( val->ntype == PARSE_FLOAT ){
- IPRINTF((stderr, "valmin: %f => %f\n", val->dval, x->dval));
- }
- else{
- snprintf(fmt, SZ_LINE, "valmin: %s => %s\n", LFMT, LFMT);
- IPRINTF((stderr, fmt, val->ival, x->ival));
- }
- return x;
-}
-
-#ifdef ANSI_FUNC
-idxvalrec *idxvalnew(char *s)
-#else
-idxvalrec *idxvalnew(s)
- char *s;
-#endif
-{
- idxvalrec *v=NULL;
- Filter filt;
-
- if( !(filt = FilterDefault()) )
- idxerror("filter symbol table not initialized");
- if( !(v=xcalloc(1, sizeof(struct _idxvalrec))) )
- idxerror("can't allocate idxvalrec");
- if( s ) v->s = xstrdup(s);
- v->next = filt->valhead;
- filt->valhead = v;
- return v;
-}
-
-
-#ifdef ANSI_FUNC
-int idxvalfree(idxvalrec *v)
-#else
-int idxvalfree(v)
- idxvalrec *v;
-#endif
-{
- idxvalrec *t;
- int n=0;
- Filter filt;
-
- if( !(filt = FilterDefault()) )
- idxerror("filter symbol table not initialized");
- if( v ){
- if( filt->valhead == v ){
- filt->valhead = v->next;
- }
- else{
- for(t=filt->valhead; t; t=t->next){
- if( t->next == v ){
- t->next = v->next;
- break;
- }
- }
- }
- _idxvalfree(v);
- n = 1;
- }
- else{
- for(v=filt->valhead; v; n++){
- t = v->next;
- _idxvalfree(v);
- v = t;
- }
- filt->valhead = NULL;
- }
- return n;
-}
-
-#ifdef ANSI_FUNC
-idxvalrec *
-idxlookupfilename(char *iname)
-#else
-idxvalrec *idxlookupfilename(iname)
- char *iname
-#endif
-{
- idxvalrec *t;
- Filter filt;
-
- if( !(filt = FilterDefault()) )
- return NULL;
- for(t=filt->valhead; t; t=t->next){
- if( t->iname && !strcmp(t->iname, iname) ){
- return t;
- }
- }
- return NULL;
-}
-
-#ifdef ANSI_FUNC
-idxrowrec *idxrownew(void)
-#else
-idxrowrec *idxrownew()
-#endif
-{
- idxrowrec *r=NULL;
- Filter filt;
-
- if( !(filt = FilterDefault()) )
- idxerror("filter symbol table not initialized");
- if( !(r=xcalloc(1, sizeof(struct _idxrowrec))) )
- idxerror("can't allocate idxrowrec");
- r->maxrow = IDX_ROW_INC;
- r->startrow = xcalloc(r->maxrow, sizeof(int));
- r->stoprow = xcalloc(r->maxrow, sizeof(int));
- r->nrow = 0;
- r->dosort = 1;
- r->next = filt->rowhead;
- filt->rowhead = r;
- return r;
-}
-
-#ifdef ANSI_FUNC
-int idxrowfree(idxrowrec *r)
-#else
-int idxrowfree(r)
- idxrowrec *r;
-#endif
-{
- idxrowrec *t;
- int n=0;
- Filter filt;
-
- if( !(filt = FilterDefault()) )
- idxerror("filter symbol table not initialized");
- if( r ){
- if( filt->rowhead == r ){
- filt->rowhead = r->next;
- }
- else{
- for(t=filt->rowhead; t; t=t->next){
- if( t->next == r ){
- t->next = r->next;
- break;
- }
- }
- }
- _idxrowfree(r);
- n = 1;
- }
- else{
- for(r=filt->rowhead; r; n++){
- t = r->next;
- _idxrowfree(r);
- r = t;
- }
- filt->rowhead = NULL;
- }
- return n;
-}
-
-#ifdef ANSI_FUNC
-int
-idxinitfilenames(char *t, int *flag)
-#else
-int idxinitfilenames(t, flag)
- char *t;
- int *flag;
-#endif
-{
- char *u=NULL;
- int havegz=0;
-
- /* initialize */
- if( flag ) *flag = 0;
- /* free current values */
- idxfreefilenames();
-
- /* sanity check */
- if( !t || !*t) return 0;
-
- if( (u=strchr(t, ':')) ){
- if( !strncasecmp(t, "pipe:", 5) || !strncasecmp(t, "mmap:", 5) ||
- !strncasecmp(t, "shm:", 4) || !strncasecmp(t, "mem:", 4) ||
- !strncasecmp(t, "buf:", 4) || !strncasecmp(t, "file:", 5) ||
- !strncasecmp(t, "gzip:", 5) || !strncasecmp(t, "unfile:", 7) ){
- t = u+1;
- }
- }
- idxfilename = xstrdup(t);
- if( (idxfileroot2=xstrdup(t)) ){
- if( (t=strrchr(idxfileroot2, '.')) ){
- if( !strcmp(t, ".gz") ){
- havegz=1;
- *t = '\0';
- if( (t=strrchr(idxfileroot2, '.')) ){
- *t = '\0';
- }
- }
- else{
- *t = '\0';
- }
- }
- if( (t=strrchr(idxfileroot2, '/')) ){
- idxfileroot1 = xstrdup(t+1);
- }
- else{
- idxfileroot1 = xstrdup(idxfileroot2);
- }
- }
- if( flag ) *flag = havegz;
- return 1;
-}
-
-#ifdef ANSI_FUNC
-void
-idxfreefilenames(void)
-#else
-void idxfreefilenames()
-#endif
-{
- if( idxfilename ){
- xfree(idxfilename);
- idxfilename=NULL;
- }
- if( idxfileroot1 ){
- xfree(idxfileroot1);
- idxfileroot1=NULL;
- }
- if( idxfileroot2 ){
- xfree(idxfileroot2);
- idxfileroot2=NULL;
- }
-}
-
-#ifdef ANSI_FUNC
-void
-idxfreeglobals(void)
-#else
-void idxfreeglobals()
-#endif
-{
- if( idxcolname ){
- xfree(idxcolname);
- idxcolname=NULL;
- }
- if( idxpath ){
- xfree(idxpath);
- idxpath=NULL;
- }
- if( idxsort ){
- xfree(idxsort);
- idxsort=NULL;
- }
- idxfreefilenames();
-}
-
-#ifdef ANSI_FUNC
-char *
-idxindexfilename(char *col, int *size)
-#else
-char *idxindexfilename(col, size)
- char *col;
- int *size;
-#endif
-{
- int i;
- char *iname=NULL;
- char *fname=NULL;
- char *idxname=NULL;
- char *suffix="";
- char colbuf[SZ_LINE];
- char tbuf[SZ_LINE];
- char tbuf1[SZ_LINE];
- char tbuf2[SZ_LINE];
- struct stat ibuf;
- struct stat fbuf;
-
- /* sanity checks */
- if( !col ) return NULL;
- if( !idxinfo(IDX_FILENAME) ) return NULL;
- if( !idxinfo(IDX_FILEROOT1) || !idxinfo(IDX_FILEROOT2) ) return NULL;
-
- /* we try using the column name as is, in lower case, and in upper case */
- /* we also try with and without a .gz extension */
- strncpy(colbuf, col, SZ_LINE-1);
- for(i=0; i<6; i++){
- switch(i){
- case 0:
- break;
- case 1:
- culc(colbuf);
- break;
- case 2:
- cluc(colbuf);
- break;
- case 3:
- suffix=".gz";
- break;
- case 4:
- culc(colbuf);
- suffix=".gz";
- break;
- case 5:
- cluc(colbuf);
- suffix=".gz";
- break;
- }
- snprintf(tbuf1, SZ_LINE-1, "%s_%s.idx%s", idxinfo(IDX_FILEROOT1),
- colbuf, suffix);
- snprintf(tbuf2, SZ_LINE-1, "%s_%s.idx%s", idxinfo(IDX_FILEROOT2),
- colbuf, suffix);
- if( (iname=Find(tbuf1, "r", NULL, "." )) ||
- (iname=Find(tbuf1, "r", NULL, FilterPath())) ||
- (iname=Find(tbuf2, "r", NULL, "." )) ||
- (iname=Find(tbuf2, "r", NULL, FilterPath())) ){
- if( (fname=Find(idxinfo(IDX_FILENAME), "r", NULL, "." )) ||
- (fname=Find(idxinfo(IDX_FILENAME), "r", NULL, FilterPath())) ){
- if( (stat(fname, &fbuf) <0) || (stat(iname, &ibuf) <0) ){
- goto done;
- }
- else if( fbuf.st_mtime > ibuf.st_mtime ){
- goto done;
- }
- }
- snprintf(tbuf, SZ_LINE-1, "%s[1]", iname);
- idxname = xstrdup(tbuf);
- break;
- }
- }
-
-done:
- if( iname ) xfree(iname);
- if( fname ) xfree(fname);
- if( size ) *size = ibuf.st_size;
- return idxname;
-}
-
-#ifdef ANSI_FUNC
-int
-idxinitparser(char *s)
-#else
-int idxinitparser(s)
- char *s;
-#endif
-{
- char *t;
- int havegz=0;
- Filter filt;
-
- /* sanity checks */
- if( !(filt = FilterDefault()) ) return 0;
- if( !filt->fhd->filename ) return 0;
-
- /* initialize index file name info */
- idxinitfilenames(filt->fhd->filename, &havegz);
-
- /* process index environent */
- if( (t=getenv("FILTER_IDX_COLNAME")) ){
- idxcolname = xstrdup(t);
- }
- else{
- idxcolname = xstrdup("n");
- }
- if( (t=getenv("FILTER_IDX_IO")) ){
- if( !strncasecmp(t, "mmap", 4) ){
-#ifdef HAVE_SYS_MMAN_H
- idx_io = IDX_IO_MMAP;
-#else
- idx_io = IDX_IO_LSEEK;
-#endif
- }
- else if( !strncasecmp(t, "lseek", 5) ){
- idx_io = IDX_IO_LSEEK;
- }
- else{
- idx_io = IDX_IO_DEFAULT;
- }
- }
- /* oops ... if we have a gz file, we can't use mmap */
- if( havegz ){
- idx_io = IDX_IO_LSEEK;
- }
- if( s ) idxstring(s);
- return 1;
-}
-
-#ifdef ANSI_FUNC
-void
-idxendparser(void)
-#else
-void idxendparser()
-#endif
-{
- idxvalfree(NULL);
- idxrowfree(NULL);
- idxfreeglobals();
-}
-
-#ifdef ANSI_FUNC
-char *
-idxinfo(int which)
-#else
-char *idxinfo(which)
- int which;
-#endif
-{
- switch(which){
- case IDX_COLNAME:
- return idxcolname;
- case IDX_FILENAME:
- return idxfilename;
- case IDX_FILEROOT1:
- return idxfileroot1;
- case IDX_FILEROOT2:
- return idxfileroot2;
- case IDX_PATHNAME:
- return idxpath;
- case IDX_SORTNAME:
- return idxsort;
- default:
- return NULL;
- }
-}
-
-#ifdef ANSI_FUNC
-int
-idxdebug(int debug)
-#else
-int idxdebug(debug)
- int debug;
-#endif
-{
- int odebug;
-
- odebug = idx_debug;
- idx_debug = debug;
- return odebug;
-}
diff --git a/funtools/filter/image_c.h b/funtools/filter/image_c.h
deleted file mode 100644
index 4db125b..0000000
--- a/funtools/filter/image_c.h
+++ /dev/null
@@ -1 +0,0 @@
-static char *IMAGE_C="\n\n#ifdef TEST\n#include <stdio.h>\n#include <math.h>\n#define IMFILTRTN _FilterImage\n#define NMASK 0\n#define MASKDIM 0\n#define _masks NULL\n#define NSHAPE 2\n#define NREGION 2\n#define FILTER ((imcircle(g,1,1,1,4,(double)x,(double)y,8.0,8.0,5.0)))&&(imcircle(g,2,2,0,1,(double)x,(double)y,8.0,8.0,3.0))\n#define FILTSTR \"((imcircle(g,1,1,1,4,(double)x,(double)y,8.0,8.0,5.0)))&&(imcircle(g,2,2,0,1,(double)x,(double)y,8.0,8.0,3.0))\"\n#define FINIT imcirclei(g,1,1,1,4,(double)x,(double)y,8.0,8.0,5.0);imcirclei(g,2,2,0,1,(double)x,(double)y,8.0,8.0,3.0);\n#include \"regions.h\"\n#endif\n\n\nFilterMask masks=NULL; \nint maxmask; \nint nmask; \nint nreg; \nint rid; \nint x, y; \nint rlen; \nint *rbuf; \nint *rptr; \n\nvoid incnmask(void)\n{\n int omax;\n nmask++;\n if( nmask >= maxmask ){\n omax = maxmask;\n maxmask += MASKINC;\n masks = (FilterMask)realloc(masks, maxmask*sizeof(FilterMaskRec));\n memset(masks+omax, 0, (maxmask-omax)*sizeof(FilterMaskRec));\n }\n}\n\nFilterMask\nIMFILTRTN(int txmin, int txmax, int tymin, int tymax, int tblock, int *got)\n{\n int i, j;\n int fieldonly;\n GFilt g;\n Scan scan, tscan;\n\n \n if( NSHAPE <=0 ){\n *got = 0;\n return NULL;\n }\n \n g = (GFilt)calloc(1, sizeof(GFiltRec));\n \n fieldonly = (NSHAPE==1) && strstr(FILTSTR, \"field\");\n \n g->nshapes = NSHAPE;\n g->maxshapes = (NSHAPE*(XSNO+1))+1;\n g->shapes = (Shape)calloc(g->maxshapes, sizeof(ShapeRec));\n \n g->block= max(1,tblock);\n g->xmin = max(1,txmin); \n g->xmax = txmax;\n g->ymin = max(1,tymin);\n g->ymax = tymax;\n \n g->x0 = 1;\n g->y0 = 1;\n g->x1 = (g->xmax-g->xmin)/g->block+1;\n g->y1 = (g->ymax-g->ymin)/g->block+1;\n \n rlen = g->x1 - g->x0 + 1;\n rbuf = (int *)calloc(rlen+1, sizeof(int));\n \n maxmask = MASKINC;\n masks = (FilterMask)calloc(maxmask, sizeof(FilterMaskRec));\n \n nmask = 0;\n masks[nmask].region = 0;\n \n nreg = 0;\n \n g->ybuf = (int *)calloc(g->y1+1, sizeof(int));\n g->x0s = (int *)calloc(g->y1+1, sizeof(int));\n g->x1s = (int *)calloc(g->y1+1, sizeof(int));\n \n for(i=0; i<=g->y1; i++) g->x0s[i] = g->x1;\n for(i=0; i<=g->y1; i++) g->x1s[i] = g->x0;\n \n if( NMASK ){\n g->nmask = NMASK; \n g->maskdim = MASKDIM;\n g->masks = _masks;\n }\n \n FINIT;\n \n for(y=g->y0; y<=g->y1; y++){\n if( fieldonly ){\n \n masks[nmask].region = 1;\n masks[nmask].y = y - g->y0 + 1;\n masks[nmask].xstart = 1;\n masks[nmask].xstop = (g->x1 - g->x0 + 1);\n incnmask();\n continue;\n }\n if( g->ybuf[y] ){\n \n if( masks[nmask].region ){\n \n incnmask();\n masks[nmask].region = 0;\n }\n \n for(x=g->x0s[y], rptr=&rbuf[1+(g->x0s[y]-g->x0)]; x<=g->x1s[y];\n x++, rptr++){\n \n g->rid = 0;\n if( FILTER ){\n \n if( *rptr == 0 ){\n nreg++;\n *rptr = g->rid ? g->rid : -1;\n }\n \n else if( (*rptr == -1) && (g->rid >0) ){\n *rptr = g->rid;\n }\n }\n }\n }\n \n if( nreg ){\n for(i=1; i<=rlen; i++){\n if( rbuf[i] != masks[nmask].region ){\n \n if( masks[nmask].region ){\n masks[nmask].xstop = i - 1;\n \n incnmask();\n }\n masks[nmask].y = y - g->y0 + 1;\n masks[nmask].region = rbuf[i];\n masks[nmask].xstart = i;\n }\n }\n \n if( masks[nmask].region ){\n masks[nmask].xstop = (g->x1 - g->x0 + 1);\n \n incnmask();\n }\n \n (void)memset(rbuf, 0, (rlen+1)*sizeof(int));\n rptr = rbuf;\n nreg = 0;\n }\n }\n \n if( rbuf) free(rbuf);\n \n if( g ){\n for(i=0; i<g->maxshapes; i++){\n if( g->shapes[i].scanlist ){\n for(j=0; j<=g->y1; j++){\n if( g->shapes[i].scanlist[j] ){\n for(scan=g->shapes[i].scanlist[j]; scan; ){\n tscan = scan->next;\n free(scan);\n scan = tscan;\n }\n }\n }\n free(g->shapes[i].scanlist);\n }\n if( g->shapes[i].pts ) free(g->shapes[i].pts);\n if( g->shapes[i].xv ) free(g->shapes[i].xv);\n }\n if( g->masks ) free(g->masks);\n if( g->shapes ) free(g->shapes);\n if( g->ybuf ) free(g->ybuf);\n if( g->x0s ) free(g->x0s);\n if( g->x1s ) free(g->x1s);\n if( g ) free(g);\n }\n \n *got = nmask;\n return masks;\n}\n\nint main(int argc, char **argv)\n{\n int i;\n int get, got;\n#if DO_FILTER_SWAP\n int sgot;\n#endif\n#if HAVE_MINGW32==0\n int pipes[4];\n#endif\n int txmin, txmax, tymin, tymax, tblock;\n char tbuf[SZ_LINE];\n char *s=NULL, *t=NULL, *u=NULL;\n#if USE_WIN32\n HANDLE hStdin, hStdout; \n DWORD dwRead, dwWritten; \n#endif\n\n \n#if HAVE_MINGW32==0\n if( (s=getenv(\"LAUNCH_PIPES\")) ){\n t = (char *)strdup(s);\n for(i=0, u=(char *)strtok(t, \",\"); i<4 && u; \n i++, u=(char *)strtok(NULL,\",\")){\n pipes[i] = atoi(u);\n }\n if( t ) free(t);\n if( i < 4 ) return(1);\n close(pipes[0]);\n close(pipes[3]);\n dup2(pipes[2], 0); close(pipes[2]);\n dup2(pipes[1], 1); close(pipes[1]);\n }\n#endif\n\n#if USE_WIN32\n hStdout = GetStdHandle(STD_OUTPUT_HANDLE); \n hStdin = GetStdHandle(STD_INPUT_HANDLE); \n if( (hStdout == INVALID_HANDLE_VALUE) || (hStdin == INVALID_HANDLE_VALUE) ){\n unlink(argv[0]);\n return 0;\n }\n#endif\n\n \n#ifdef TEST\n while( fgets(tbuf, SZ_LINE, stdin) ){\n#else\n#if USE_WIN32\n while((ReadFile(hStdin, &get, sizeof(int), &dwRead, NULL) != FALSE) && \n (dwRead == sizeof(int)) ){\n#else\n while( read(0, &get, sizeof(int)) == sizeof(int) ){\n#endif\n#if DO_FILTER_SWAP\n switch(sizeof(int)){\n case 2:\n _sw2((char *)&get,2,NULL,0);\n break;\n case 4:\n _sw4((char *)&get,4,NULL,0);\n break;\n case 8:\n _sw8((char *)&get,8,NULL,0);\n break;\n }\n#endif\n#if USE_WIN32\n if((ReadFile(hStdin, tbuf, get, &dwRead, NULL)==FALSE) || (dwRead != get))\n break;\n#else\n if(read(0, tbuf, get) != get) \n break;\n#endif\n#endif \n if(sscanf(tbuf, \"%d %d %d %d %d\",\n &txmin, &txmax, &tymin, &tymax, &tblock)!=5){\n break;\n }\n masks = IMFILTRTN(txmin, txmax, tymin, tymax, tblock, &got);\n#ifdef TEST\n \n fprintf(stdout, \"nmask=%d\\n\", nmask);\n for(i=0; i<nmask; i++){\n fprintf(stdout, \"region: %d\tx: (%d,%d)\ty: %d\\n\",\n masks[i].region, masks[i].xstart, masks[i].xstop, masks[i].y);\n }\n fflush(stdout);\n#else\n \n got = got * sizeof(FilterMaskRec);\n#if DO_FILTER_SWAP\n sgot = got;\n switch(sizeof(int)){\n case 2:\n _sw2((char *)&sgot,2,NULL,0);\n break;\n case 4:\n _sw4((char *)&sgot,4,NULL,0);\n break;\n case 8:\n _sw8((char *)&sgot,8,NULL,0);\n break;\n }\n#if USE_WIN32\n WriteFile(hStdout, &sgot, sizeof(int), &dwWritten, NULL); \n#else\n write(1, &sgot, sizeof(int));\n#endif\n#else\n#if USE_WIN32\n WriteFile(hStdout, &got, sizeof(int), &dwWritten, NULL); \n#else\n write(1, &got, sizeof(int));\n#endif\n#endif\n#if DO_FILTER_SWAP\n switch(sizeof(int)){\n case 2:\n _sw2((char *)masks,got,NULL,0);\n break;\n case 4:\n _sw4((char *)masks,got,NULL,0);\n break;\n case 8:\n _sw8((char *)masks,got,NULL,0);\n break;\n }\n#endif\n#if USE_WIN32\n WriteFile(hStdout, masks, got, &dwWritten, NULL); \n#else\n write(1, masks, got);\n#endif\n#endif\n \n if( masks ) free(masks);\n }\n#ifndef TEST\n unlink(argv[0]);\n#endif\n return 0;\n}\n";
diff --git a/funtools/filter/imfilter.c b/funtools/filter/imfilter.c
deleted file mode 100644
index d2495da..0000000
--- a/funtools/filter/imfilter.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/* for TEST: gcc -DTEST -g -o foo imfilter.c imregions.o -lm */
-#ifdef TEST
-#include <stdio.h>
-#include <math.h>
-#define IMFILTRTN _FilterImage
-#define NMASK 0
-#define MASKDIM 0
-#define _masks NULL
-#define NSHAPE 2
-#define NREGION 2
-#define FILTER ((imcircle(g,1,1,1,4,(double)x,(double)y,8.0,8.0,5.0)))&&(imcircle(g,2,2,0,1,(double)x,(double)y,8.0,8.0,3.0))
-#define FILTSTR "((imcircle(g,1,1,1,4,(double)x,(double)y,8.0,8.0,5.0)))&&(imcircle(g,2,2,0,1,(double)x,(double)y,8.0,8.0,3.0))"
-#define FINIT imcirclei(g,1,1,1,4,(double)x,(double)y,8.0,8.0,5.0);imcirclei(g,2,2,0,1,(double)x,(double)y,8.0,8.0,3.0);
-#include "regions.h"
-#endif
-
-/* these are global for use with special region routines */
-FilterMask masks=NULL; /* array valid region masks for one row */
-int maxmask; /* max masks allocated thus far */
-int nmask; /* number of mask segments */
-int nreg; /* number of regions in this set of rows */
-int rid; /* first valid region for current pixel */
-int x, y; /* current row and column */
-int rlen; /* length of temp region buf */
-int *rbuf; /* temp region flags */
-int *rptr; /* pointer into region buffer */
-
-void incnmask(void)
-{
- int omax;
- nmask++;
- if( nmask >= maxmask ){
- omax = maxmask;
- maxmask += MASKINC;
- masks = (FilterMask)realloc(masks, maxmask*sizeof(FilterMaskRec));
- memset(masks+omax, 0, (maxmask-omax)*sizeof(FilterMaskRec));
- }
-}
-
-FilterMask
-IMFILTRTN(int txmin, int txmax, int tymin, int tymax, int tblock, int *got)
-{
- int i, j;
- int fieldonly;
- GFilt g;
- Scan scan, tscan;
-
- /* make sure we have something to process */
- if( NSHAPE <=0 ){
- *got = 0;
- return NULL;
- }
- /* allocate space for the globals */
- g = (GFilt)calloc(1, sizeof(GFiltRec));
- /* see if we have only the field shape */
- fieldonly = (NSHAPE==1) && strstr(FILTSTR, "field");
- /* allocate region records */
- g->nshapes = NSHAPE;
- g->maxshapes = (NSHAPE*(XSNO+1))+1;
- g->shapes = (Shape)calloc(g->maxshapes, sizeof(ShapeRec));
- /* make sure we start at 1 */
- g->block= max(1,tblock);
- g->xmin = max(1,txmin);
- g->xmax = txmax;
- g->ymin = max(1,tymin);
- g->ymax = tymax;
- /* get x and y limits on subsection */
- g->x0 = 1;
- g->y0 = 1;
- g->x1 = (g->xmax-g->xmin)/g->block+1;
- g->y1 = (g->ymax-g->ymin)/g->block+1;
- /* allocate a temp region buffer */
- rlen = g->x1 - g->x0 + 1;
- rbuf = (int *)calloc(rlen+1, sizeof(int));
- /* allocate an array of masks, which will be written to caller */
- maxmask = MASKINC;
- masks = (FilterMask)calloc(maxmask, sizeof(FilterMaskRec));
- /* seed the first region mask value */
- nmask = 0;
- masks[nmask].region = 0;
- /* keep track of how many hits we had for this set of rows */
- nreg = 0;
- /* allocate a buffer for valid y row flags */
- g->ybuf = (int *)calloc(g->y1+1, sizeof(int));
- g->x0s = (int *)calloc(g->y1+1, sizeof(int));
- g->x1s = (int *)calloc(g->y1+1, sizeof(int));
- /* seed impossible values for x limits */
- for(i=0; i<=g->y1; i++) g->x0s[i] = g->x1;
- for(i=0; i<=g->y1; i++) g->x1s[i] = g->x0;
- /* save image mask values */
- if( NMASK ){
- g->nmask = NMASK;
- g->maskdim = MASKDIM;
- g->masks = _masks;
- }
- /* initialize ybuf */
- FINIT;
- /* process all valid rows */
- for(y=g->y0; y<=g->y1; y++){
- if( fieldonly ){
- /* inc the mask count, (extend mask array, if necessary) */
- masks[nmask].region = 1;
- masks[nmask].y = y - g->y0 + 1;
- masks[nmask].xstart = 1;
- masks[nmask].xstop = (g->x1 - g->x0 + 1);
- incnmask();
- continue;
- }
- if( g->ybuf[y] ){
- /* to start this line, we make a seed mask with no region */
- if( masks[nmask].region ){
- /* inc the mask count, (extend mask array, if necessary) */
- incnmask();
- masks[nmask].region = 0;
- }
- /* process each pixel in this row where there is a region */
- for(x=g->x0s[y], rptr=&rbuf[1+(g->x0s[y]-g->x0)]; x<=g->x1s[y];
- x++, rptr++){
- /* get filter result, which is the region id or 0 */
- g->rid = 0;
- if( FILTER ){
- /* never change a region id to a -1 */
- if( *rptr == 0 ){
- nreg++;
- *rptr = g->rid ? g->rid : -1;
- }
- /* but always overwrite a -1 */
- else if( (*rptr == -1) && (g->rid >0) ){
- *rptr = g->rid;
- }
- }
- }
- }
- /* if we have processed a row, make up the segments */
- if( nreg ){
- for(i=1; i<=rlen; i++){
- if( rbuf[i] != masks[nmask].region ){
- /* if previous was non-zero region, finish it and bump to next */
- if( masks[nmask].region ){
- masks[nmask].xstop = i - 1;
- /* inc the mask count, (extend mask array, if necessary) */
- incnmask();
- }
- masks[nmask].y = y - g->y0 + 1;
- masks[nmask].region = rbuf[i];
- masks[nmask].xstart = i;
- }
- }
- /* finish last non-zero segment, inc number of mask segs */
- if( masks[nmask].region ){
- masks[nmask].xstop = (g->x1 - g->x0 + 1);
- /* inc the mask count, (extend mask array, if necessary) */
- incnmask();
- }
- /* reset counters for next set of rows */
- (void)memset(rbuf, 0, (rlen+1)*sizeof(int));
- rptr = rbuf;
- nreg = 0;
- }
- }
- /* free buffers */
- if( rbuf) free(rbuf);
- /* free region information */
- if( g ){
- for(i=0; i<g->maxshapes; i++){
- if( g->shapes[i].scanlist ){
- for(j=0; j<=g->y1; j++){
- if( g->shapes[i].scanlist[j] ){
- for(scan=g->shapes[i].scanlist[j]; scan; ){
- tscan = scan->next;
- free(scan);
- scan = tscan;
- }
- }
- }
- free(g->shapes[i].scanlist);
- }
- if( g->shapes[i].pts ) free(g->shapes[i].pts);
- if( g->shapes[i].xv ) free(g->shapes[i].xv);
- }
- if( g->masks ) free(g->masks);
- if( g->shapes ) free(g->shapes);
- if( g->ybuf ) free(g->ybuf);
- if( g->x0s ) free(g->x0s);
- if( g->x1s ) free(g->x1s);
- if( g ) free(g);
- }
- /* return mask info */
- *got = nmask;
- return masks;
-}
-
-int main(int argc, char **argv)
-{
- int i;
- int get, got;
-#if DO_FILTER_SWAP
- int sgot;
-#endif
-#if HAVE_MINGW32==0
- int pipes[4];
-#endif
- int txmin, txmax, tymin, tymax, tblock;
- char tbuf[SZ_LINE];
- char *s=NULL, *t=NULL, *u=NULL;
-#if USE_WIN32
- HANDLE hStdin, hStdout;
- DWORD dwRead, dwWritten;
-#endif
-
- /* Launch() sometimes rearranges passed pipes to be stdin/stdout */
-#if HAVE_MINGW32==0
- if( (s=getenv("LAUNCH_PIPES")) ){
- t = (char *)strdup(s);
- for(i=0, u=(char *)strtok(t, ","); i<4 && u;
- i++, u=(char *)strtok(NULL,",")){
- pipes[i] = atoi(u);
- }
- if( t ) free(t);
- if( i < 4 ) return(1);
- close(pipes[0]);
- close(pipes[3]);
- dup2(pipes[2], 0); close(pipes[2]);
- dup2(pipes[1], 1); close(pipes[1]);
- }
-#endif
-
-#if USE_WIN32
- hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
- hStdin = GetStdHandle(STD_INPUT_HANDLE);
- if( (hStdout == INVALID_HANDLE_VALUE) || (hStdin == INVALID_HANDLE_VALUE) ){
- unlink(argv[0]);
- return 0;
- }
-#endif
-
- /* process requests for region information for sections of the image */
-#ifdef TEST
- while( fgets(tbuf, SZ_LINE, stdin) ){
-#else
-#if USE_WIN32
- while((ReadFile(hStdin, &get, sizeof(int), &dwRead, NULL) != FALSE) &&
- (dwRead == sizeof(int)) ){
-#else
- while( read(0, &get, sizeof(int)) == sizeof(int) ){
-#endif
-#if DO_FILTER_SWAP
- switch(sizeof(int)){
- case 2:
- _sw2((char *)&get,2,NULL,0);
- break;
- case 4:
- _sw4((char *)&get,4,NULL,0);
- break;
- case 8:
- _sw8((char *)&get,8,NULL,0);
- break;
- }
-#endif
-#if USE_WIN32
- if((ReadFile(hStdin, tbuf, get, &dwRead, NULL)==FALSE) || (dwRead != get))
- break;
-#else
- if(read(0, tbuf, get) != get)
- break;
-#endif
-#endif /* #ifdef TEST */
- if(sscanf(tbuf, "%d %d %d %d %d",
- &txmin, &txmax, &tymin, &tymax, &tblock)!=5){
- break;
- }
- masks = IMFILTRTN(txmin, txmax, tymin, tymax, tblock, &got);
-#ifdef TEST
- /* display segments for debugging */
- fprintf(stdout, "nmask=%d\n", nmask);
- for(i=0; i<nmask; i++){
- fprintf(stdout, "region: %d\tx: (%d,%d)\ty: %d\n",
- masks[i].region, masks[i].xstart, masks[i].xstop, masks[i].y);
- }
- fflush(stdout);
-#else
- /* calculate size of data we will write */
- got = got * sizeof(FilterMaskRec);
-#if DO_FILTER_SWAP
- sgot = got;
- switch(sizeof(int)){
- case 2:
- _sw2((char *)&sgot,2,NULL,0);
- break;
- case 4:
- _sw4((char *)&sgot,4,NULL,0);
- break;
- case 8:
- _sw8((char *)&sgot,8,NULL,0);
- break;
- }
-#if USE_WIN32
- WriteFile(hStdout, &sgot, sizeof(int), &dwWritten, NULL);
-#else
- write(1, &sgot, sizeof(int));
-#endif
-#else
-#if USE_WIN32
- WriteFile(hStdout, &got, sizeof(int), &dwWritten, NULL);
-#else
- write(1, &got, sizeof(int));
-#endif
-#endif
-#if DO_FILTER_SWAP
- switch(sizeof(int)){
- case 2:
- _sw2((char *)masks,got,NULL,0);
- break;
- case 4:
- _sw4((char *)masks,got,NULL,0);
- break;
- case 8:
- _sw8((char *)masks,got,NULL,0);
- break;
- }
-#endif
-#if USE_WIN32
- WriteFile(hStdout, masks, got, &dwWritten, NULL);
-#else
- write(1, masks, got);
-#endif
-#endif
- /* free mask records */
- if( masks ) free(masks);
- }
-#ifndef TEST
- unlink(argv[0]);
-#endif
- return 0;
-}
diff --git a/funtools/filter/imregions.c b/funtools/filter/imregions.c
deleted file mode 100644
index 6067d53..0000000
--- a/funtools/filter/imregions.c
+++ /dev/null
@@ -1,2585 +0,0 @@
-/*
- NB: MAKE SURE YOU EDIT THE TEMPLATE FILE!!!!
-*/
-
-#ifndef FILTER_PTYPE
-#include <regions.h>
-#endif
-
-#ifndef UNUSED
-#ifdef __GNUC__
-# define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
-#else
-# define UNUSED(x) UNUSED_ ## x
-#endif
-#endif
-
-/* panda and pie incorrectly used astronomical angles. fixed 4/2004 */
-#define USE_ASTRO_ANGLE 0
-
-/* we might want to avoid (x86) extended precision problems */
-#define USE_FPU_DOUBLE 0
-#if USE_FPU_DOUBLE
-#include <fpu_control.h>
-static fpu_control_t _cw;
-#define FPU_DOUBLE {fpu_control_t _cw2; _FPU_GETCW(_cw); _cw2 = _cw & ~_FPU_EXTENDED; _cw2 |= _FPU_DOUBLE; _FPU_SETCW(_cw2);}
-#define FPU_RESTORE {_FPU_SETCW(_cw);}
-#else
-#define FPU_DOUBLE
-#define FPU_RESTORE
-#endif
-
-/* add to FilterOpen to cause this module to be loaded for dynamic linking */
-static int imregno=0;
-void initimregions(void)
-{
- imregno++;
- return;
-}
-
-static void markx(GFilt g, int UNUSED(sno), int flag, int type, int x, int y)
-{
- /* don't mark exclude regions */
- if( type == TOK_EREG )
- return;
- /* for include, we might extend the x limits */
- if( flag ){
- if( x <= g->x0s[y] )
- g->x0s[y] = max(x,g->x0);
- if( x >= g->x1s[y] )
- g->x1s[y] = min(x,g->x1);
- }
- /* for exclude, we have to look at the full line */
- else{
- g->x0s[y] = g->x0;
- g->x1s[y] = g->x1;
- }
-}
-
-static void marky(GFilt g, int sno, int flag, int type)
-{
- int i;
- /* don't mark exclude regions */
- if( type == TOK_EREG )
- return;
- /* mark include shape */
- if( flag ){
- for(i=max(g->y0,g->shapes[sno].ystart);
- i<=min(g->y1,g->shapes[sno].ystop);
- i++)
- g->ybuf[i] = 1;
- }
- /* mark exclude shape */
- else{
- for(i=g->y0; i<=g->shapes[sno].ystart-1; i++)
- g->ybuf[i] = 1;
- for(i=g->shapes[sno].ystop+1; i<=g->y1; i++)
- g->ybuf[i] = 1;
- }
-}
-
-static int
-imagemaskcmp(const void *s1, const void *s2)
-{
- FilterMask f1 = (FilterMask)s1;
- FilterMask f2 = (FilterMask)s2;
-
- if( f1->y < f2->y ){
- return -1;
- }
- else if( f1->y > f2->y ){
- return 1;
- }
- else{
- if( f1->xstart < f2->xstart ){
- return -1;
- }
- else{
- return 1;
- }
- }
-}
-
-/* ***************************** shape support ***************************** */
-
-static void quadeq(double a, double b, double c,
- double *x1, double *x2, int *nr, int *nc)
-{
- double dis, q;
- if( feq(a,0.0) ){
- *nc = 0;
- if( feq(b,0.0) ){
- *nr = 0; *x1 = 0.0;
- }
- else{
- *nr = 1; *x1 = -c / b;
- }
- *x2 = *x1;
- }
- else{
- dis = b*b - 4.0 * a * c;
- if( dis > 0.0 ){
- *nr = 2; *nc = 0;
- dis = sqrt(dis);
- if( b < 0.0 ) dis = -dis;
- q = -0.5 * (b + dis);
- *x1 = q/a; *x2 = c/q;
- if(*x1 > *x2){
- q = *x1; *x1 = *x2; *x2 = q;
- }
- }
- else if( feq(dis,0.0) ){
- *nr = 1; *nc = 0; *x1 = - 0.5 * b / a; *x2 = *x1;
- }
- else{
- *nr = 0; *nc = 2; *x1 = - 0.5 * b / a; *x2 = 0.5 * sqrt(-dis) / a;
- }
- }
-}
-
-static void rgs_mark(GFilt g, Scan *scanlist,
- int sno, int flag, int type, int xval, int yval )
-{
- Scan scanmark, mark;
- /* since yval is used as an index, make sure its within limits */
- if(yval < g->y0) yval = g->y0;
- if(yval > g->y1) yval = g->y1;
- mark = (Scan)calloc(1, sizeof(ScanRec));
- mark->x = xval;
- /* sanity check */
- if( !scanlist ) return;
- /* starts are installed at back of list for given x */
- if( !scanlist[yval] || ((scanlist[yval])->x > xval) ){
- mark->next = scanlist[yval];
- scanlist[yval] = mark;
- } else {
- scanmark = scanlist[yval];
- while( scanmark->next && ((scanmark->next)->x < xval) )
- scanmark = scanmark->next;
- mark->next = scanmark->next;
- scanmark->next = mark;
- }
- markx(g, sno, flag, type, xval, yval);
-}
-
-static void rgs_segment(GFilt g, Scan *scanlist, int width, int height,
- int sno, int flag, int type,
- double x1, double y1, double x2, double y2)
-{
- int ystart, ystop, yval, xval;
- double invslope, xoffset;
-
- ystart = PIXINCL(y1);
- if( ystart < 1 ) ystart = 1;
- /* note: PIXINCL(stop) is 1st pixel not counted */
- ystop = PIXINCL(y2) - 1;
- if( ystop > height ) ystop = height;
- /* ignore segment if there is no positive slope in integer coords */
- if( (ystart > ystop) || (ystop < 1) )
- return;
- /* use inverse slope (run/rise) to get x given y with a multiply */
- invslope = (x1 - x2) / (y1 - y2);
- xoffset = x1 + ((ystart - y1) * invslope);
- for(yval=ystart; yval<=ystop; yval++){
- xval = PIXINCL(xoffset);
- /* clip line to edges of image area (actually bend line) */
- if(xval < 1) xval = 1;
- if(xval > width) xval = width + 1;
- rgs_mark(g, scanlist, sno, flag, type, xval, yval);
- xoffset = xoffset + invslope;
- }
-}
-
-static void _polygoni(GFilt g, int qt, int UNUSED(rno), int sno, int flag,
- int type, double *vx, double *vy, int count)
-{
- int i, j;
- double xlo, xhi;
- double ylo, yhi;
-
-#ifdef ALREADY_DONE
- /* divide by block factor to get real endpoints */
- for(i=0; i<count; i++){
- vx[i] = (vx[i] - g->xmin)/g->block + 1.0;
- vy[i] = (vy[i] - g->ymin)/g->block + 1.0;
- }
-#endif
- /* find the limits */
- xlo = vx[0];
- xhi = xlo;
- ylo = vy[0];
- yhi = ylo;
- for(i=0; i<count; i++){
- if(vx[i] > xhi) xhi = vx[i];
- if(vx[i] < xlo) xlo = vx[i];
- if(vy[i] > yhi) yhi = vy[i];
- if(vy[i] < ylo) ylo = vy[i];
- }
- if( qt && (sno > 1) ){
- g->shapes[sno].ystart = g->shapes[sno-1].ystart;
- g->shapes[sno].ystop = g->shapes[sno-1].ystop;
- }
- else{
- g->shapes[sno].ystart = max(g->y0,PIXINCL(ylo));
- g->shapes[sno].ystop = min(g->y1,PIXINCL(yhi) - 1);
- }
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- marky(g, sno, flag, type);
-
- /* mark all horizontal segment crossings */
- /* start with segment between last and first point */
- j = count-1;
- for(i=0; i<count; i++){
- /* make segments always run from lower y to higher y */
- if(vy[i] > vy[j]){
- rgs_segment(g, g->shapes[sno].scanlist, g->x1, g->y1,
- sno, flag, type, vx[j], vy[j], vx[i], vy[i]);
- }
- else{
- rgs_segment(g, g->shapes[sno].scanlist, g->x1, g->y1,
- sno, flag, type, vx[i], vy[i], vx[j], vy[j]);
- }
- j = i;
- }
-}
-
-static int corner_vertex(int index, int width, int height,
- double *x, double *y)
-{
- switch (index) {
- case 1:
- *x = 0.0;
- *y = height + 1;
- break;
- case 2:
- *x = 0.0;
- *y = 0.0;
- break;
- case 3:
- *x = width + 1;
- *y = 0.0;
- break;
- case 4:
- *x = width + 1;
- *y = height + 1;
- default:
- break;
- }
- index = index + 1;
- if(index > 4) index = 1;
- return(index);
-}
-
-static int pie_intercept(int width, int height, double xcen, double ycen,
- double angle, double *xcept, double *ycept)
-{
- double angl, slope; /* l: angle and slope of ray */
- angl = angle;
- /* put angles in normal range */
- while (angl < 0.0)
- angl = angl + 360.0;
- while (angl >= 360.0)
- angl = angl - 360.0;
- /* check for a horizontal angle */
-#if USE_ASTRO_ANGLE
- if(fabs(angl - 90.0) < SMALL_NUMBER) {
-#else
- if(fabs(angl - 180.0) < SMALL_NUMBER) {
-#endif
- *xcept = 0.0;
- *ycept = ycen;
- return(2);
- }
-#if USE_ASTRO_ANGLE
- if(fabs(angl - 270.0) < SMALL_NUMBER) {
-#else
- if(fabs(angl - 0.0) < SMALL_NUMBER) {
-#endif
- *xcept = width + 1;
- *ycept = ycen;
- return(4);
- }
-#if USE_ASTRO_ANGLE
- /* convert to a Cartesian angle */
- angl = angl + 90.0;
-#endif
- if(angl >= 360.0)
- angl = angl - 360.0;
- if(angl < 180.0) {
- *ycept = height + 1;
- /* rule out vertical line */
- if(fabs(angl - 90.0) < SMALL_NUMBER) {
- *xcept = xcen;
- return(1);
- }
- } else {
- *ycept = 0.0;
- /* rule out vertical line */
- if(fabs(angl - 270.0) < SMALL_NUMBER) {
- *xcept = xcen;
- return(3);
- }
- }
- /* convert to radians */
- angl = (angl / 180.0) * M_PI;
- /* calculate slope */
- slope = tan(angl);
- /* calculate intercept with designated y edge */
- *xcept = xcen + ((*ycept - ycen) / slope);
- if(*xcept < 0) {
- *ycept = (ycen - (xcen * slope));
- *xcept = 0.0;
- return(2);
- } else if(*xcept > (width + 1)) {
- *ycept = (ycen + ((width + 1 - xcen) * slope));
- *xcept = width + 1;
- return(4);
- } else {
- if(*ycept < height)
- return(3);
- else
- return(1);
- }
-}
-
-void _impiei(GFilt g, int qt, int rno, int sno, int flag, int type,
- double UNUSED(x), double UNUSED(y),
- double xcen, double ycen, double angle1, double angle2)
-{
- int width, height; /* l: image mask width and height */
- double sweep; /* l: sweep between cut angles */
- double vx[7], vy[7]; /* l: arrays of vertices for polygon */
- int count; /* l: number of polygon vertices */
- int intrcpt1, intrcpt2; /* l: side intercepted by each cut */
- double x2, y2; /* l: coordinates of second intercept */
-
- /* NB: do not use x and y variables, they have bogus values */
- /* divide by block factor to get "real" parameters */
- xcen = (xcen - g->xmin)/g->block + 1.0;
- ycen = (ycen - g->ymin)/g->block + 1.0;
- /* temps */
- width = g->x1;
- height = g->y1;
- /* start listing vertices of polygon */
- vx[0] = xcen;
- vy[0] = ycen;
- sweep = angle2 - angle1;
- /* if sweep is too small to be noticed, don't bother */
- if(fabs(sweep) < SMALL_NUMBER)
- return;
- if (sweep < 0.0) sweep = sweep + 360.0;
- intrcpt1 = pie_intercept(width, height, xcen, ycen, angle1,
- &(vx[1]), &(vy[1]));
- intrcpt2 = pie_intercept(width, height, xcen, ycen, angle2,
- &x2, &y2);
- count = 2;
- /* if angles intercept same side and slice is between them, no corners */
- /* else, mark corners until reaching side with second angle intercept */
- if((intrcpt1 != intrcpt2) || (sweep > 180.0)){
- do{
- intrcpt1 = corner_vertex(intrcpt1, width, height,
- &(vx[count]), &(vy[count]));
- count = count + 1;
- }while(intrcpt1 != intrcpt2);
- }
- vx[count] = x2;
- vy[count] = y2;
- count++;
- _polygoni(g, qt, rno, sno, flag, type, vx, vy, count);
-}
-
-/* ***************************** shapes ********************************** */
-
-void imannulusi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double iradius, double oradius)
-{
- int yy;
- double dval;
- double xoff, yoff;
- Scan *scanlist;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- if( iradius == 0 ){
- imcirclei(g, rno, sno, flag, type, x, y, xcen, ycen, oradius);
- return;
- }
- /* divide by block factor to get "real" parameters */
- xcen = (xcen - g->xmin)/g->block + 1.0;
- ycen = (ycen - g->ymin)/g->block + 1.0;
- iradius /= (double)g->block;
- oradius /= (double)g->block;
- /* set y limits */
- if( PIXSTART(ycen - oradius) < PIXSTOP(ycen + oradius) ){
- g->shapes[sno].ystart = max(g->y0,PIXSTART(ycen - oradius));
- g->shapes[sno].ystop = min(g->y1,PIXSTOP(ycen + oradius));
- }
- else{
- g->shapes[sno].ystart = min(g->y1,PIXSTOP(ycen + oradius));
- g->shapes[sno].ystop = max(g->y0,PIXSTART(ycen - oradius));
- }
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- scanlist = g->shapes[sno].scanlist;
- marky(g, sno, flag, type);
- /* calculate start/stop values for each y line */
- for(yy=g->shapes[sno].ystart; yy<=g->shapes[sno].ystop; yy++){
- yoff = PIXCEN(yy) - ycen;
- if( (dval=(oradius * oradius) - (yoff * yoff)) > 0.0 ){
- xoff = sqrt(dval);
- if( PIXSTART(xcen - xoff) <= PIXSTOP(xcen + xoff) ){
- rgs_mark(g, scanlist, sno, flag, type, PIXSTART(xcen - xoff), yy);
- rgs_mark(g, scanlist, sno, flag, type, PIXSTOP(xcen + xoff), yy);
- }
- if( (dval=(iradius * iradius) - (yoff * yoff)) > 0.0 ){
- xoff = sqrt(dval);
- if( PIXSTART(xcen - xoff) <= PIXSTOP(xcen + xoff) ){
- rgs_mark(g, scanlist, sno, flag, type, PIXSTART(xcen - xoff), yy);
- rgs_mark(g, scanlist, sno, flag, type, PIXSTOP(xcen + xoff), yy);
- }
- }
- }
- }
-}
-
-int imannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double iradius, double oradius)
-{
- Scan scan;
-
- if( iradius == 0 ){
- return(imcircle(g, rno, sno, flag, type, x, y, xcen, ycen, oradius));
- }
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- if( flag ){
- if(y < g->shapes[sno].ystart ) return 0;
- if(y > g->shapes[sno].ystop ) return 0;
- }
- scan = g->shapes[sno].scanlist[(int)y];
- if( (scan &&
- ((y >= g->shapes[sno].ystart) && (y <= g->shapes[sno].ystop)) &&
- (scan->next->next ?
- (((x >= scan->x) && (x <= scan->next->next->next->x)) &&
- !((x >= scan->next->x) && (x <= scan->next->next->x))) :
- ((x >= scan->x) && (x <= scan->next->x))))
- ==flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-void imboxi(GFilt g, int rno, int sno, int flag, int type,
- double UNUSED(x), double UNUSED(y),
- double xcen, double ycen, double xwidth, double yheight,
- double angle)
-{
- double angl; /* l: Cartesian angle in radians */
- double half_width, half_height;/* l: radii (1/2 width and height) */
- double cosangl, sinangl; /* l: sine, cosine of the Cartesian angle */
- double hw_cos, hw_sin; /* l: products of half_width with sin, cos */
- double hh_cos, hh_sin; /* l: products of half_height with sin, cos */
- double cornerx[4], cornery[4]; /* l: arrays of x and y coords of 4 corners */
-
- /* NB: do not use x and y variables, they have bogus values */
- if( (xwidth == 0) && (yheight==0) ){
- return;
- }
- /* divide by block factor to get "real" parameters */
- xcen = (xcen - g->xmin)/g->block + 1.0;
- ycen = (ycen - g->ymin)/g->block + 1.0;
- xwidth /= (double)g->block;
- yheight /= (double)g->block;
-#if USE_ASTRO_ANGLE
- /* convert to a Cartesian angle; save angle for use in multi or slices */
- angl = angle + 90.0;
-#else
- angl = angle;
-#endif
- while (angl >= 360.0) angl = angl - 360.0;
- /* convert to radians */
- angl = (angl / 180.0) * M_PI;
- sinangl = sin (angl);
- cosangl = cos (angl);
-#if USE_ASTRO_ANGLE
- /* since we rotate by 90.0 degrees to get from astro angle to cartesian, */
- /* we also need to switch the width and height. we do this secretly so */
- /* that the display will turn out right, by doing it in the half terms */
- half_width = yheight / 2.0;
- half_height = xwidth / 2.0;
-#else
- half_width = xwidth / 2.0;
- half_height = yheight / 2.0;
-#endif
- hw_cos = half_width * cosangl;
- hw_sin = half_width * sinangl;
- hh_cos = half_height * cosangl;
- hh_sin = half_height * sinangl;
-#if USE_ASTRO_ANGLE
- cornerx[0] = xcen - hw_cos - hh_sin;
- cornery[0] = ycen - hw_sin + hh_cos;
- cornerx[1] = xcen + hw_cos - hh_sin;
- cornery[1] = ycen + hw_sin + hh_cos;
- cornerx[2] = xcen + hw_cos + hh_sin;
- cornery[2] = ycen + hw_sin - hh_cos;
- cornerx[3] = xcen - hw_cos + hh_sin;
- cornery[3] = ycen - hw_sin - hh_cos;
-#else
- cornerx[0] = xcen - hw_cos + hh_sin;
- cornery[0] = ycen - hh_cos - hw_sin;
- cornerx[1] = xcen - hw_cos - hh_sin;
- cornery[1] = ycen + hh_cos - hw_sin;
- cornerx[2] = xcen + hw_cos - hh_sin;
- cornery[2] = ycen + hh_cos + hw_sin;
- cornerx[3] = xcen + hw_cos + hh_sin;
- cornery[3] = ycen - hh_cos + hw_sin;
-#endif
- _polygoni(g, 0, rno, sno, flag, type, cornerx, cornery, 4);
-}
-
-int imbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double UNUSED(xcen), double UNUSED(ycen),
- double xwidth, double yheight,
- double UNUSED(angle))
-{
- if( (xwidth == 0) && (yheight==0) ){
- return(!flag);
- }
- return impolygon(g, rno, sno, flag, type, x, y);
-}
-
-void imcirclei(GFilt g, int UNUSED(rno), int sno, int flag, int type,
- double UNUSED(x), double UNUSED(y),
- double xcen, double ycen, double radius)
-{
- int yy;
- double dval;
- double xoff, yoff;
- Scan *scanlist;
-
- /* NB: do not use x and y variables, they have bogus values */
- if( radius == 0 ){
- return;
- }
- /* divide by block factor to get "real" parameters */
- xcen = (xcen - g->xmin)/g->block + 1.0;
- ycen = (ycen - g->ymin)/g->block + 1.0;
- radius /= (double)g->block;
- /* set y limits */
- if( PIXSTART(ycen - radius) < PIXSTOP(ycen + radius) ){
- g->shapes[sno].ystart = max(g->y0,PIXSTART(ycen - radius));
- g->shapes[sno].ystop = min(g->y1,PIXSTOP(ycen + radius));
- }
- else{
- g->shapes[sno].ystart = min(g->y1,PIXSTOP(ycen + radius));
- g->shapes[sno].ystop = max(g->y0,PIXSTART(ycen - radius));
- }
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- scanlist = g->shapes[sno].scanlist;
- marky(g, sno, flag, type);
- /* calculate start/stop values for each y line */
- for(yy=g->shapes[sno].ystart; yy<=g->shapes[sno].ystop; yy++){
- yoff = PIXCEN(yy) - ycen;
- if( (dval=(radius * radius) - (yoff * yoff))>=0.0 ){
- xoff = sqrt(dval);
- if( PIXSTART(xcen - xoff) <= PIXSTOP(xcen + xoff) ){
- rgs_mark(g, scanlist, sno, flag, type, PIXSTART(xcen - xoff), yy);
- rgs_mark(g, scanlist, sno, flag, type, PIXSTOP(xcen + xoff), yy);
- }
- }
- }
-}
-
-int imcircle(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y,
- double UNUSED(xcen), double UNUSED(ycen), double radius)
-{
- Scan scan;
-
- if( radius == 0 ){
- return(!flag);
- }
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- if( flag ){
- if(y < g->shapes[sno].ystart ) return 0;
- if(y > g->shapes[sno].ystop ) return 0;
- }
- scan = g->shapes[sno].scanlist[(int)y];
- if( (scan &&
- ((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- ((x >= scan->x) && (x <= (scan->next)->x))) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else{
- return 0;
- }
-}
-
-void imellipsei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double xrad, double yrad,
- double angle)
-{
- int yy;
- int nr, nc;
- double yhi;
- double yoff;
- double xboff, xfoff;
- double angl;
- double sinangl, cosangl;
- double cossq, sinsq, xradsq, yradsq;
- double a, b_partial, c_partial;
- double b, c;
- Scan *scanlist;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- if( xrad == yrad ){
- imcirclei(g, rno, sno, flag, type, x, y, xcen, ycen, xrad);
- return;
- }
- /* divide by block factor to get "real" parameters */
- xcen = (xcen - g->xmin)/g->block + 1.0;
- ycen = (ycen - g->ymin)/g->block + 1.0;
- xrad /= (double)g->block;
- yrad /= (double)g->block;
- /* set worst case limits (xrad axis parallel to vertical axis) */
-#if USE_ASTRO_ANGLE
- /* convert to a Cartesian angle; save "angle" for use by other routines */
- angl = angle + 90.0;
-#else
- angl = angle;
-#endif
- while( angl >= 360.0 )
- angl = angl - 360.0;
- /* convert to radians */
- angl = (angl / 180.0) * M_PI;
- sinangl = sin(angl);
- cosangl = cos(angl);
- /* calculate approximate y limits */
- /* choose lesser of containing rotbox and circle */
- FPU_DOUBLE
-#if USE_ASTRO_ANGLE
- yhi = fabs(sinangl * yrad) + fabs(cosangl * xrad);
-#else
- yhi = fabs(sinangl * xrad) + fabs(cosangl * yrad);
-#endif
- yhi = min(yhi, max(yrad, xrad));
- /* set y limits */
- if( PIXSTART(ycen - yhi) < PIXSTOP(ycen + yhi) ){
- g->shapes[sno].ystart = max(g->y0,PIXSTART(ycen - yhi));
- g->shapes[sno].ystop = min(g->y1,PIXSTOP(ycen + yhi));
- }
- else{
- g->shapes[sno].ystart = min(g->y1,PIXSTOP(ycen + yhi));
- g->shapes[sno].ystop = max(g->y0,PIXSTART(ycen - yhi));
- }
- FPU_RESTORE
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- scanlist = g->shapes[sno].scanlist;
- marky(g, sno, flag, type);
- /* prepare partials for quadratic equation solutions to coordinates */
- cossq = cosangl * cosangl;
- sinsq = sinangl * sinangl;
-#if USE_ASTRO_ANGLE
- /* because we rotate by 90.0 degrees to get from astro angle to */
- /* cartesian, we also need to switch the x and y axes. we do this */
- /* secretly so that the display will turn out right, by doing it in */
- /* the sq terms */
- xradsq = yrad * yrad;
- yradsq = xrad * xrad;
-#else
- xradsq = xrad * xrad;
- yradsq = yrad * yrad;
-#endif
- /* fill in as much of a,b,c as we can */
- a = (cossq / xradsq) + (sinsq / yradsq);
- b_partial = (2.0 * sinangl) * ((cosangl / xradsq) - (cosangl / yradsq));
- c_partial = (sinsq / xradsq) + (cossq / yradsq);
- /* calculate start/stop values for each y line */
- for(yy=g->shapes[sno].ystart; yy<=g->shapes[sno].ystop; yy++){
- yoff = yy - ycen;
- b = b_partial * yoff;
- c = (c_partial * yoff * yoff) - 1.0;
- /* solve quadratic */
- quadeq (a, b, c, &xboff, &xfoff, &nr, &nc);
- /* if real roots */
- if( nr != 0 ) {
- /* translate x coordinates */
- rgs_mark(g, scanlist, sno, flag, type, PIXSTART(xcen + xboff), yy);
- rgs_mark(g, scanlist, sno, flag, type, PIXSTOP(xcen + xfoff), yy);
- }
- }
-}
-
-int imellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double xrad, double yrad,
- double UNUSED(angle))
-{
- Scan scan;
-
- if( xrad == yrad ){
- return(imcircle(g, rno, sno, flag, type, x, y, xcen, ycen, xrad));
- }
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- if( flag ){
- if(y < g->shapes[sno].ystart ) return 0;
- if(y > g->shapes[sno].ystop ) return 0;
- }
- scan = g->shapes[sno].scanlist[(int)y];
- FPU_DOUBLE
- if( (scan &&
- ((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- ((x >= scan->x) && (x <= (scan->next)->x))) == flag ){
- if( rno && flag ) g->rid = rno;
- FPU_RESTORE
- return 1;
- }
- else{
- FPU_RESTORE
- return 0;
- }
-}
-
-void imfieldi(GFilt g, int UNUSED(rno), int sno, int flag, int type,
- double UNUSED(x), double UNUSED(y))
-{
- int yy;
- Scan *scanlist;
-
- /* NB: do not use x and y variables, they have bogus values */
- g->shapes[sno].ystart = g->y0;
- g->shapes[sno].ystop = g->y1;
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- scanlist = g->shapes[sno].scanlist;
- marky(g, sno, flag, type);
- /* calculate start/stop values for each y line */
- for(yy=g->shapes[sno].ystart; yy<=g->shapes[sno].ystop; yy++){
- rgs_mark(g, scanlist, sno, flag, type, g->x0, yy);
- rgs_mark(g, scanlist, sno, flag, type, g->x1, yy);
- }
-}
-
-int imfield(GFilt g, int rno, int UNUSED(sno), int flag, int UNUSED(type),
- double UNUSED(x), double UNUSED(y))
-{
- if( flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else{
- return 0;
- }
-}
-
-void imlinei(GFilt g, int UNUSED(rno), int sno, int flag, int type,
- double UNUSED(x), double UNUSED(y),
- double x1, double y1, double x2, double y2)
-{
- double vx[2];
- double vy[2];
- int xval, yval;
- double invslope, xoffset;
-
- /* NB: do not use x and y variables, they have bogus values */
- /* divide by block factor to get "real" parameters */
- x1 = (x1 - g->xmin)/g->block + 1.0;
- y1 = (y1 - g->ymin)/g->block + 1.0;
- x2 = (x2 - g->xmin)/g->block + 1.0;
- y2 = (y2 - g->ymin)/g->block + 1.0;
- /* order by increasing y */
- if( y1 < y2 ){
- vx[0] = x1;
- vy[0] = y1;
- vx[1] = x2;
- vy[1] = y2;
- }
- else{
- vx[0] = x2;
- vy[0] = y2;
- vx[1] = x1;
- vy[1] = y1;
- }
- /* set y limits */
- g->shapes[sno].ystart = PIXNUM(vy[0]);
- g->shapes[sno].ystop = PIXNUM(vy[1]);
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- marky(g, sno, flag, type);
- if( feq(vy[0],vy[1]) ){
- rgs_mark(g, g->shapes[sno].scanlist, sno, flag, type,
- (int)min(vx[0],vx[1]), (int)vy[0]);
- rgs_mark(g, g->shapes[sno].scanlist, sno, flag, type,
- (int)max(vx[0],vx[1]), (int)vy[0]);
- }
- else{
- /* mark all horizontal segment crossings */
- invslope = (vx[0] - vx[1]) / (vy[0] - vy[1]);
- xoffset = vx[0];
- for(yval=vy[0]; yval<=vy[1]; yval++){
- xval = xoffset;
- rgs_mark(g, g->shapes[sno].scanlist, sno, flag, type, xval, yval);
- xoffset = xoffset + invslope;
- }
- }
-}
-
-int imline(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y,
- double UNUSED(x1), double UNUSED(y1),
- double UNUSED(x2), double UNUSED(y2))
-{
- Scan scan;
-
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- if( flag ){
- if(y < g->shapes[sno].ystart ) return 0;
- if(y > g->shapes[sno].ystop ) return 0;
- }
- scan = g->shapes[sno].scanlist[(int)y];
- if( (scan &&
- ((x==(int)scan->x) ||
- (scan->next&&((x>=(int)scan->x)&&(x<=(int)scan->next->x)))))==flag ) {
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-void impiei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2)
-{
- _impiei(g, 0, rno, sno, flag, type, x, y, xcen, ycen, angle1, angle2);
-}
-
-int impie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double UNUSED(xcen), double UNUSED(ycen),
- double UNUSED(angle1), double UNUSED(angle2))
-{
- return impolygon(g, rno, sno, flag, type, x, y);
-}
-
-void imqtpiei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2)
-{
- _impiei(g, 1, rno, sno, flag, type, x, y, xcen, ycen, angle1, angle2);
-}
-
-int imqtpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double UNUSED(xcen), double UNUSED(ycen),
- double UNUSED(angle1), double UNUSED(angle2))
-{
- return impolygon(g, rno, sno, flag, type, x, y);
-}
-
-void impointi(GFilt g, int UNUSED(rno), int sno, int flag, int type,
- double UNUSED(x), double UNUSED(y),
- double xcen, double ycen)
-{
- /* NB: do not use x and y variables, they have bogus values */
- /* divide by block factor to get "real" parameters */
- xcen = (xcen - g->xmin)/g->block + 1.0;
- ycen = (ycen - g->ymin)/g->block + 1.0;
- /* set y limits */
- g->shapes[sno].ystart = PIXNUM(ycen);
- g->shapes[sno].ystop = PIXNUM(ycen);
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- marky(g, sno, flag, type);
- rgs_mark(g, g->shapes[sno].scanlist, sno, flag, type,
- PIXNUM(xcen), PIXNUM(ycen));
-}
-
-int impoint(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y,
- double UNUSED(xcen), double UNUSED(ycen))
-{
- Scan scan;
-
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- if( flag ){
- if(y < g->shapes[sno].ystart ) return 0;
- if(y > g->shapes[sno].ystop ) return 0;
- }
- scan = g->shapes[sno].scanlist[(int)y];
- if( (scan &&
- (y == (int)g->shapes[sno].ystart) &&
- (x == (int)scan->x))==flag ) {
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-#ifdef __STDC__
-void
-impolygoni(GFilt g, int rno, int sno, int flag, int type,
- double UNUSED(x), double y, ...)
-{
- double *vx=NULL, *vy=NULL;
- int count, maxcount;
- va_list args;
- va_start(args, y);
-#else
-void impolygoni(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double *vx=NULL, *vy=NULL;
- int count, maxcount;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
-#endif
- /* NB: do not use x and y variables, they have bogus values */
- /* allocate space for x,y arguments */
- maxcount = MASKINC;
- vx = (double *)calloc(maxcount, sizeof(double));
- vy = (double *)calloc(maxcount, sizeof(double));
- /* look for x,y arguments */
- count = 0;
- while( 1 ){
- if( (count + 1) >= maxcount ){
- maxcount += MASKINC;
- vx = (double *)realloc(vx, maxcount*sizeof(double));
- vy = (double *)realloc(vy, maxcount*sizeof(double));
- }
- vx[count] = va_arg(args, double);
- vy[count] = va_arg(args, double);
- if( feq(vx[count],PSTOP) && feq(vy[count],PSTOP) )
- break;
- vx[count] = (vx[count] - g->xmin)/g->block + 1.0;
- vy[count] = (vy[count] - g->ymin)/g->block + 1.0;
- count ++;
- }
- va_end(args);
- /* realloc to actual size */
- vx = (double *)realloc(vx, count*sizeof(double));
- vy = (double *)realloc(vy, count*sizeof(double));
- /* call the common routine */
- _polygoni(g, 0, rno, sno, flag, type, vx, vy, count);
- if( vx ) free(vx);
- if( vy ) free(vy);
-}
-
-#ifdef __STDC__
-int
-impolygon(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y, ...)
-{
- int crossings;
- Scan scan;
- va_list args;
- va_start(args, y);
-#else
-int impolygon(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- int crossings;
- Scan scan;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
-#endif
- va_end(args);
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- if( flag ){
- if(y < g->shapes[sno].ystart ) return 0;
- if(y > g->shapes[sno].ystop ) return 0;
- }
- /* no initialization of x for this row, just jump right in */
- if( (y>=g->shapes[sno].ystart)&&(y<=g->shapes[sno].ystop) ){
- crossings = 0;
- for(scan=g->shapes[sno].scanlist[(int)y]; scan; scan=scan->next){
- if( x >= scan->x )
- crossings++;
- else
- break;
- }
- if( (crossings%2) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else{
- return 0;
- }
- }
- else{
- return !flag;
- }
-}
-
-void imnannulusi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lo, double hi, int n)
-{
- int i;
- int xsno;
- double dinc;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- dinc = (hi - lo)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init all shapes */
- imannulusi(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi);
- for(i=0; i<n; i++){
- imannulusi(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc));
- }
-}
-
-void imnboxi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double ang)
-{
- int i;
- int xsno;
- double dincx;
- double dincy;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- dincx = (hix - lox)/n;
- dincy = (hiy - loy)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init all shapes */
- imboxi(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang);
- imboxi(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang);
- for(i=0; i<n; i++){
- imboxi(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang);
- }
-}
-
-void imnellipsei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double ang)
-{
- int i;
- int xsno;
- double dincx;
- double dincy;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- dincx = (hix - lox)/n;
- dincy = (hiy - loy)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init all shapes */
- imellipsei(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang);
- imellipsei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang);
- for(i=0; i<n; i++){
- imellipsei(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang);
- }
-}
-
-void imnpiei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lo, double hi, int n)
-{
- int i;
- int xsno;
- double dinc;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- while( lo > hi ) lo -= 360.0;
- dinc = (hi - lo)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init all shapes */
- impiei(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi);
- for(i=0; i<n; i++){
- impiei(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc));
- }
-}
-
-void impandai(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double radlo, double radhi, double radn)
-{
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, rinc;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- while( anglo > anghi ) anglo -= 360.0;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- rinc = (radhi - radlo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init pies and annuli */
- imannulusi(g, 0, xsno, flag, type, x, y, xcen, ycen, radlo, radhi);
- imqtpiei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi);
- for(a=0; a<ahi; a++){
- for(r=0; r<rhi; r++){
- imannulusi(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, radlo+(r*rinc), radlo+((r+1)*rinc));
- imqtpiei(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc));
- n++;
- }
- }
-}
-
-void imbpandai(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double xlo, double ylo, double xhi, double yhi, double radn,
- double ang)
-{
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, xinc, yinc;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- anglo += ang;
- anghi += ang;
- while( anglo > anghi ) anglo -= 360.0;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- xinc = (xhi - xlo)/radn;
- yinc = (yhi - ylo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init pies and ellipses */
- imboxi(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi, ang);
- imqtpiei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi);
- imboxi(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo, ang);
- for(a=0; a<ahi; a++){
- for(r=1; r<=rhi; r++){
- imboxi(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang);
- imqtpiei(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc));
- n++;
- }
- }
-}
-
-void imepandai(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double xlo, double ylo, double xhi, double yhi, double radn,
- double ang)
-{
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, xinc, yinc;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- anglo += ang;
- anghi += ang;
- while( anglo > anghi ) anglo -= 360.0;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- xinc = (xhi - xlo)/radn;
- yinc = (yhi - ylo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init pies and ellipses */
- imellipsei(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi, ang);
- imqtpiei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi);
- imellipsei(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo, ang);
- for(a=0; a<ahi; a++){
- for(r=1; r<=rhi; r++){
- imellipsei(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang);
- imqtpiei(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc));
- n++;
- }
- }
-}
-
-/* accelerator regions -- lower and upper limits are given for n regions */
-
-int imnannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lo, double hi, int n)
-{
- int i;
- int xsno;
- double dinc;
-
- /* get limits */
- dinc = (hi - lo)/(double)n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( imannulus(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc)) ){
- return(1);
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, lo, hi) ){
- return(1);
- }
- return(0);
- }
-}
-
-int imnbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double ang)
-{
- int i;
- int xsno;
- double dincx;
- double dincy;
-
- /* get limits */
- dincx = (hix - lox)/n;
- dincy = (hiy - loy)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imbox(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( imbox(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( imbox(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imbox(g, 0, xsno, 1, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- if( imbox(g, 0, xsno+1, 1, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-int imnellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double ang)
-{
- int i;
- int xsno;
- double dincx;
- double dincy;
-
- /* get limits */
- dincx = (hix - lox)/n;
- dincy = (hiy - loy)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( imellipse(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( imellipse(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- if( imellipse(g, 0, xsno+1, 1, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-int imnpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lo, double hi, int n)
-{
- int i;
- int xsno;
- double dinc;
-
- /* get limits */
- while( lo > hi ) lo -= 360.0;
- dinc = (hi - lo)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* check limits */
- if( !impie(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( impie(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc)) ){
- return(1);
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !impie(g, 0, xsno, 1, type, x, y, xcen, ycen, lo, hi) ){
- return(1);
- }
- return(0);
- }
-}
-
-int impanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double radlo, double radhi, double radn)
-{
-
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, rinc;
-
- /* get limits */
- while( anglo > anghi ) anglo -= 360.0;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- rinc = (radhi - radlo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, radlo, radhi) ||
- !impie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(a=1; a<=ahi; a++){
- for(r=1; r<=rhi; r++){
- if( imannulus(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, radlo+((r-1)*rinc), radlo+(r*rinc)) &&
- impie(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+((a-1)*ainc), anglo+(a*ainc)) ){
- return(1);
- }
- n++;
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, radlo, radhi) )
- return(1);
- else if( !impie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){
- return(1);
- }
- else{
- return(0);
- }
- }
-}
-
-int imbpanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double xlo, double ylo, double xhi, double yhi, double radn,
- double ang)
-{
-
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, xinc, yinc;
-
- /* get limits */
- anglo += ang;
- anghi += ang;
- while( anglo > anghi ) anglo -= 360.0;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- xinc = (xhi - xlo)/radn;
- yinc = (yhi - ylo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imbox(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi,
- ang) ){
- return(0);
- }
- /* but if its in the inner region we lose */
- else if( imbox(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo,
- ang) ){
- return(0);
- }
- /* its in the box .. must also be in the pie */
- else if( !impie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi)){
- return(0);
- }
- /* look through all of them to find the right one */
- for(a=0; a<ahi; a++){
- for(r=1; r<=rhi; r++){
- if( imbox(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang) &&
- imqtpie(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc)) ){
- return(1);
- }
- n++;
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imbox(g, 0, xsno, 1, type, x, y, xcen, ycen, xhi, yhi, ang) )
- return(1);
- /* if its in the inner region we win */
- else if( !imbox(g, 0, xsno+2, 1, type, x, y, xcen, ycen, xlo, ylo,
- ang) )
- return(1);
- /* if its not in the pie, we win */
- else if( !impie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){
- return(1);
- }
- else{
- return(0);
- }
- }
-}
-
-int imepanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double xlo, double ylo, double xhi, double yhi, double radn,
- double ang)
-{
-
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, xinc, yinc;
-
- /* get limits */
- anglo += ang;
- anghi += ang;
- while( anglo > anghi ) anglo -= 360.0;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- xinc = (xhi - xlo)/radn;
- yinc = (yhi - ylo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi,
- ang) ){
- return(0);
- }
- /* but if its in the inner region we lose */
- else if( imellipse(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo,
- ang) ){
- return(0);
- }
- /* its in the ellipse .. must also be in the pie */
- else if( !impie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi)){
- return(0);
- }
- /* look through all of them to find the right one */
- for(a=0; a<ahi; a++){
- for(r=1; r<=rhi; r++){
- if( imellipse(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang) &&
- imqtpie(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc)) ){
- return(1);
- }
- n++;
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, xhi, yhi, ang) )
- return(1);
- /* if its in the inner region we win */
- else if( !imellipse(g, 0, xsno+2, 1, type, x, y, xcen, ycen, xlo, ylo,
- ang) )
- return(1);
- /* if its not in the pie, we win */
- else if( !impie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){
- return(1);
- }
- else{
- return(0);
- }
- }
-}
-
-#ifdef __STDC__
-void
-imvannulusi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvannulusi(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* this should be impossible ... */
- if( n == 2 ){
- imannulusi(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1]);
- return;
- }
- imannulusi(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]);
- for(i=0; i<(n-1); i++){
- imannulusi(g, rno+i, sno+i, flag, type, x, y, xcen, ycen, xv[i], xv[i+1]);
- }
-}
-
-#ifdef __STDC__
-void
-imvboxi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double ang;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvboxi(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- ang = xv[--n];
- /* this should be impossible ... */
- if( n == 2 ){
- imboxi(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang);
- return;
- }
- imboxi(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1], ang);
- imboxi(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang);
- for(i=2, j=0; i<n; i+=2, j++){
- imboxi(g, rno+j, sno+j, flag, type, x, y, xcen, ycen, xv[i], xv[i+1], ang);
- }
-}
-
-#ifdef __STDC__
-void
-imvellipsei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double ang;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvellipsei(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- ang = xv[--n];
- /* this should be impossible ... */
- if( n == 2 ){
- imellipsei(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang);
- return;
- }
- imellipsei(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1], ang);
- imellipsei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang);
- for(i=2, j=0; i<n; i+=2, j++){
- imellipsei(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1], ang);
- }
-}
-
-#ifdef __STDC__
-void
-imvpiei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvpiei(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* this should be impossible ... */
- if( n == 2 ){
- impiei(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1]);
- return;
- }
- impiei(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]);
- for(i=0; i<(n-1); i++){
- impiei(g, rno+i, sno+i, flag, type, x, y, xcen, ycen, xv[i], xv[i+1]);
- }
-}
-
-#ifdef __STDC__
-void
-imvpointi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, y);
-#else
-int imvpointi(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- for(i=0, j=0; i<n; i+=2, j++){
- impointi(g, rno+j, sno+j, flag, type, x, y, xv[i], xv[i+1]);
- }
-}
-
-/* varargs regions -- a series of lower and upper limits is specified */
-
-#ifdef __STDC__
-int
-imvannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvannulus(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double *xv;
- int i, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* this should be impossible ... */
- if( n == 2 ){
- return(imannulus(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1]));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( imannulus(g, rno+i, sno+i, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1]) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(1);
- }
- return(0);
- }
-}
-
-#ifdef __STDC__
-int
-imvbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double ang;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvbox(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- ang = xv[--n];
- /* this should be impossible ... */
- if( n == 2 ){
- return(imbox(g, rno, sno, flag, type, x, y,
- xcen, ycen, xv[0], xv[1], ang));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imbox(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1],
- ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( imbox(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=2, j=0; i<n; i+=2, j++){
- if( imbox(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1], ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imbox(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[n-2], xv[n-1], ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- else if( imbox(g, 0, xsno+1, 1, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-#ifdef __STDC__
-int
-imvellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double ang;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvellipse(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- ang = xv[--n];
- /* this should be impossible ... */
- if( n == 2 ){
- return(imellipse(g, rno, sno, flag, type, x, y,
- xcen, ycen, xv[0], xv[1], ang));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1],
- ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( imellipse(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1],
- ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=2, j=0; i<n; i+=2, j++){
- if( imellipse(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1], ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we lose ... */
- if( !imellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[n-2], xv[n-1],
- ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- if( imellipse(g, 0, xsno+1, 1, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-#ifdef __STDC__
-int
-imvpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvpie(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double *xv;
- int i, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* this should be impossible ... */
- if( n == 2 ){
- return(impie(g, rno, sno, flag, type, x, y,
- xcen, ycen, xv[0], xv[1]));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !impie(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( impie(g, rno+i, sno+i, flag, type, x, y, xcen, ycen, xv[i], xv[i+1]) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we lose ... */
- if( !impie(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(1);
- }
- return(1);
- }
-}
-
-#ifdef __STDC__
-int
-imvpoint(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, y);
-#else
-int imvpoint(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* look through all of them to find the right one */
- for(i=0, j=0; i<n; i+=2, j++){
- if( impoint(g, rno+j, sno+j, flag, type, x, y, xv[i], xv[i+1]) ){
- return(1);
- }
- }
- return(0);
-}
-
-void imimagemaski(GFilt g, int UNUSED(rno), int UNUSED(sno),
- int UNUSED(flag), int UNUSED(type),
- double UNUSED(x), double UNUSED(y))
-{
- int i, j;
- int got;
- int fsize;
- int mblock;
- FilterMask xmasks;
-
- /* NB: do not use x and y variables, they have bogus values */
- /* scale mask x, y values to match the incoming image section */
- mblock = (int)(((double)((g->xmax - g->xmin + 1)/g->block)/(double)g->maskdim) + 0.5);
- if( mblock < 1 ){
- g->masks = NULL;
- g->nmask = 0;
- }
- /* copy all masks and translate x,y positions as needed */
- fsize = g->nmask * sizeof(FilterMaskRec) * mblock;
- xmasks = (FilterMask)calloc(1, fsize);
- for(got=0, i=0; i<g->nmask; i++){
- xmasks[got].region = g->masks[i].region;
- xmasks[got].y = (g->masks[i].y - 1.0) * mblock + 1.0;
- xmasks[got].xstart = (g->masks[i].xstart - 1.0) * mblock + 1.0;
- xmasks[got].xstop = (g->masks[i].xstop - 1.0) * mblock + 1.0;
- /* replicate the segment up to the block factor */
- for(j=1; j<mblock; j++){
- xmasks[got+j].region = xmasks[got].region;
- xmasks[got+j].y = xmasks[got].y+j;
- xmasks[got+j].xstart = xmasks[got].xstart;
- xmasks[got+j].xstop = xmasks[got].xstop;
- }
- got += mblock;
- }
- /* sort by y and x */
- qsort(xmasks, got, sizeof(FilterMaskRec), imagemaskcmp);
- /* we don't free previous masks, just overwrite, because they were not
- allocated in the first place */
- /* if( g->masks ) free(g->masks); */
- /* set up new mask records */
- g->masks = xmasks;
- g->nmask = got;
-
- /* now mark each y line that has a y mask value */
- for(i=0; i<got; i++){
- if( !g->ybuf[g->masks[i].y] )
- g->ybuf[g->masks[i].y] = i+1;
- }
-}
-
-int imimagemask(GFilt g, int UNUSED(rno), int UNUSED(sno),
- int UNUSED(flag), int UNUSED(type),
- double x, double y)
-{
- int i;
- int ix, iy;
-
- if( g->nmask == 0 )
- return(0);
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- ix = (int)x;
- iy = (int)y;
- /* look for mask segment containing ix, iy */
- i = g->ybuf[iy];
- /* ybuf contains offset+1 of first mask record containing iy */
- if( i != 0 ){
- i--;
- for(; i<g->nmask; i++){
- if( g->masks[i].y > iy ){
- return(0);
- }
- if( (ix >= g->masks[i].xstart) && (ix <= g->masks[i].xstop) ){
- g->rid = g->masks[i].region;
- return(1);
- }
- }
- }
- return(0);
-}
-
diff --git a/funtools/filter/imregions_c.h b/funtools/filter/imregions_c.h
deleted file mode 100644
index bb6cdc0..0000000
--- a/funtools/filter/imregions_c.h
+++ /dev/null
@@ -1 +0,0 @@
-static char *IMREGIONS_C="\n/*\n NB: MAKE SURE YOU EDIT THE TEMPLATE FILE!!!!\n*/\n\n#ifndef FILTER_PTYPE\n#include <regions.h>\n#endif\n\n#ifndef UNUSED\n#ifdef __GNUC__\n# define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))\n#else\n# define UNUSED(x) UNUSED_ ## x\n#endif\n#endif\n\n\n#define USE_ASTRO_ANGLE 0\n\n\n#define USE_FPU_DOUBLE 0\n#if USE_FPU_DOUBLE\n#include <fpu_control.h>\nstatic fpu_control_t _cw;\n#define FPU_DOUBLE {fpu_control_t _cw2; _FPU_GETCW(_cw); _cw2 = _cw & ~_FPU_EXTENDED; _cw2 |= _FPU_DOUBLE; _FPU_SETCW(_cw2);}\n#define FPU_RESTORE {_FPU_SETCW(_cw);}\n#else\n#define FPU_DOUBLE\n#define FPU_RESTORE\n#endif\n\n\nstatic int imregno=0;\nvoid initimregions(void)\n{\n imregno++;\n return;\n}\n\nstatic void markx(GFilt g, int UNUSED(sno), int flag, int type, int x, int y)\n{\n \n if( type == TOK_EREG )\n return;\n \n if( flag ){\n if( x <= g->x0s[y] )\n g->x0s[y] = max(x,g->x0);\n if( x >= g->x1s[y] )\n g->x1s[y] = min(x,g->x1);\n }\n \n else{\n g->x0s[y] = g->x0;\n g->x1s[y] = g->x1;\n }\n}\n\nstatic void marky(GFilt g, int sno, int flag, int type)\n{\n int i;\n \n if( type == TOK_EREG )\n return;\n \n if( flag ){\n for(i=max(g->y0,g->shapes[sno].ystart);\n i<=min(g->y1,g->shapes[sno].ystop);\n i++)\n g->ybuf[i] = 1;\n }\n \n else{\n for(i=g->y0; i<=g->shapes[sno].ystart-1; i++)\n g->ybuf[i] = 1;\n for(i=g->shapes[sno].ystop+1; i<=g->y1; i++)\n g->ybuf[i] = 1;\n }\n}\n\nstatic int\nimagemaskcmp(const void *s1, const void *s2)\n{\n FilterMask f1 = (FilterMask)s1;\n FilterMask f2 = (FilterMask)s2;\n \n if( f1->y < f2->y ){\n return -1;\n }\n else if( f1->y > f2->y ){\n return 1;\n }\n else{\n if( f1->xstart < f2->xstart ){\n return -1;\n }\n else{\n return 1;\n }\n }\n}\n\n\n\nstatic void quadeq(double a, double b, double c,\n double *x1, double *x2, int *nr, int *nc)\n{\n double dis, q;\n if( feq(a,0.0) ){\n *nc = 0;\n if( feq(b,0.0) ){\n *nr = 0; *x1 = 0.0;\n }\n else{\n *nr = 1; *x1 = -c / b;\n }\n *x2 = *x1;\n }\n else{\n dis = b*b - 4.0 * a * c;\n if( dis > 0.0 ){\n *nr = 2; *nc = 0;\n dis = sqrt(dis);\n if( b < 0.0 ) dis = -dis;\n q = -0.5 * (b + dis);\n *x1 = q/a; *x2 = c/q;\n if(*x1 > *x2){\n q = *x1; *x1 = *x2; *x2 = q;\n }\n } \n else if( feq(dis,0.0) ){\n *nr = 1; *nc = 0; *x1 = - 0.5 * b / a; *x2 = *x1;\n }\n else{\n *nr = 0; *nc = 2; *x1 = - 0.5 * b / a; *x2 = 0.5 * sqrt(-dis) / a;\n }\n }\n}\n\nstatic void rgs_mark(GFilt g, Scan *scanlist,\n int sno, int flag, int type, int xval, int yval )\n{\n Scan scanmark, mark;\n \n if(yval < g->y0) yval = g->y0;\n if(yval > g->y1) yval = g->y1;\n mark = (Scan)calloc(1, sizeof(ScanRec));\n mark->x = xval;\n \n if( !scanlist ) return;\n \n if( !scanlist[yval] || ((scanlist[yval])->x > xval) ){\n mark->next = scanlist[yval];\n scanlist[yval] = mark;\n } else {\n scanmark = scanlist[yval];\n while( scanmark->next && ((scanmark->next)->x < xval) )\n scanmark = scanmark->next;\n mark->next = scanmark->next;\n scanmark->next = mark;\n }\n markx(g, sno, flag, type, xval, yval);\n}\n\nstatic void rgs_segment(GFilt g, Scan *scanlist, int width, int height,\n int sno, int flag, int type,\n double x1, double y1, double x2, double y2)\n{\n int ystart, ystop, yval, xval;\n double invslope, xoffset;\n\n ystart = PIXINCL(y1);\n if( ystart < 1 ) ystart = 1;\n \n ystop = PIXINCL(y2) - 1;\n if( ystop > height ) ystop = height;\n \n if( (ystart > ystop) || (ystop < 1) )\n return;\n \n invslope = (x1 - x2) / (y1 - y2);\n xoffset = x1 + ((ystart - y1) * invslope);\n for(yval=ystart; yval<=ystop; yval++){\n xval = PIXINCL(xoffset);\n \n if(xval < 1) xval = 1;\n if(xval > width) xval = width + 1;\n rgs_mark(g, scanlist, sno, flag, type, xval, yval);\n xoffset = xoffset + invslope;\n }\n}\n\nstatic void _polygoni(GFilt g, int qt, int UNUSED(rno), int sno, int flag,\n int type, double *vx, double *vy, int count)\n{\n int i, j;\n double xlo, xhi;\n double ylo, yhi;\n\n#ifdef ALREADY_DONE\n \n for(i=0; i<count; i++){\n vx[i] = (vx[i] - g->xmin)/g->block + 1.0;\n vy[i] = (vy[i] - g->ymin)/g->block + 1.0;\n }\n#endif\n \n xlo = vx[0];\n xhi = xlo;\n ylo = vy[0];\n yhi = ylo;\n for(i=0; i<count; i++){\n if(vx[i] > xhi) xhi = vx[i];\n if(vx[i] < xlo) xlo = vx[i];\n if(vy[i] > yhi) yhi = vy[i];\n if(vy[i] < ylo) ylo = vy[i];\n }\n if( qt && (sno > 1) ){\n g->shapes[sno].ystart = g->shapes[sno-1].ystart;\n g->shapes[sno].ystop = g->shapes[sno-1].ystop;\n }\n else{\n g->shapes[sno].ystart = max(g->y0,PIXINCL(ylo));\n g->shapes[sno].ystop = min(g->y1,PIXINCL(yhi) - 1);\n }\n g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));\n marky(g, sno, flag, type);\n\n \n \n j = count-1;\n for(i=0; i<count; i++){\n \n if(vy[i] > vy[j]){\n rgs_segment(g, g->shapes[sno].scanlist, g->x1, g->y1,\n sno, flag, type, vx[j], vy[j], vx[i], vy[i]);\n }\n else{\n rgs_segment(g, g->shapes[sno].scanlist, g->x1, g->y1,\n sno, flag, type, vx[i], vy[i], vx[j], vy[j]);\n }\n j = i;\n }\n}\n\nstatic int corner_vertex(int index, int width, int height,\n double *x, double *y)\n{\n switch (index) {\n case 1:\n *x = 0.0;\n *y = height + 1;\n break;\n case 2:\n *x = 0.0;\n *y = 0.0;\n break;\n case 3:\n *x = width + 1;\n *y = 0.0;\n break;\n case 4:\n *x = width + 1;\n *y = height + 1;\n default:\n break;\n }\n index = index + 1;\n if(index > 4) index = 1;\n return(index);\n}\n\nstatic int pie_intercept(int width, int height, double xcen, double ycen,\n double angle, double *xcept, double *ycept)\n{\n double angl, slope; \n angl = angle;\n \n while (angl < 0.0)\n angl = angl + 360.0;\n while (angl >= 360.0)\n angl = angl - 360.0;\n \n#if USE_ASTRO_ANGLE\n if(fabs(angl - 90.0) < SMALL_NUMBER) {\n#else\n if(fabs(angl - 180.0) < SMALL_NUMBER) {\n#endif\n *xcept = 0.0;\n *ycept = ycen;\n return(2);\n }\n#if USE_ASTRO_ANGLE\n if(fabs(angl - 270.0) < SMALL_NUMBER) {\n#else\n if(fabs(angl - 0.0) < SMALL_NUMBER) {\n#endif\n *xcept = width + 1;\n *ycept = ycen;\n return(4);\n }\n#if USE_ASTRO_ANGLE\n \n angl = angl + 90.0;\n#endif\n if(angl >= 360.0)\n angl = angl - 360.0;\n if(angl < 180.0) {\n *ycept = height + 1;\n \n if(fabs(angl - 90.0) < SMALL_NUMBER) {\n *xcept = xcen;\n return(1);\n }\n } else {\n *ycept = 0.0;\n \n if(fabs(angl - 270.0) < SMALL_NUMBER) {\n *xcept = xcen;\n return(3);\n }\n }\n \n angl = (angl / 180.0) * M_PI;\n \n slope = tan(angl);\n \n *xcept = xcen + ((*ycept - ycen) / slope);\n if(*xcept < 0) {\n *ycept = (ycen - (xcen * slope));\n *xcept = 0.0;\n return(2);\n } else if(*xcept > (width + 1)) {\n *ycept = (ycen + ((width + 1 - xcen) * slope));\n *xcept = width + 1;\n return(4);\n } else {\n if(*ycept < height)\n return(3);\n else\n return(1);\n }\n}\n\nvoid _impiei(GFilt g, int qt, int rno, int sno, int flag, int type,\n double UNUSED(x), double UNUSED(y),\n double xcen, double ycen, double angle1, double angle2)\n{\n int width, height; \n double sweep; \n double vx[7], vy[7]; \n int count; \n int intrcpt1, intrcpt2; \n double x2, y2; \n\n \n \n xcen = (xcen - g->xmin)/g->block + 1.0;\n ycen = (ycen - g->ymin)/g->block + 1.0;\n \n width = g->x1;\n height = g->y1;\n \n vx[0] = xcen;\n vy[0] = ycen;\n sweep = angle2 - angle1;\n \n if(fabs(sweep) < SMALL_NUMBER)\n return;\n if (sweep < 0.0) sweep = sweep + 360.0;\n intrcpt1 = pie_intercept(width, height, xcen, ycen, angle1,\n &(vx[1]), &(vy[1]));\n intrcpt2 = pie_intercept(width, height, xcen, ycen, angle2,\n &x2, &y2);\n count = 2;\n \n \n if((intrcpt1 != intrcpt2) || (sweep > 180.0)){\n do{\n intrcpt1 = corner_vertex(intrcpt1, width, height, \n &(vx[count]), &(vy[count]));\n count = count + 1;\n }while(intrcpt1 != intrcpt2);\n }\n vx[count] = x2;\n vy[count] = y2;\n count++;\n _polygoni(g, qt, rno, sno, flag, type, vx, vy, count);\n}\n\n\n\nvoid imannulusi(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double iradius, double oradius)\n{\n int yy;\n double dval;\n double xoff, yoff;\n Scan *scanlist;\n\n \n\n if( iradius == 0 ){\n imcirclei(g, rno, sno, flag, type, x, y, xcen, ycen, oradius);\n return;\n }\n \n xcen = (xcen - g->xmin)/g->block + 1.0;\n ycen = (ycen - g->ymin)/g->block + 1.0;\n iradius /= (double)g->block;\n oradius /= (double)g->block;\n \n if( PIXSTART(ycen - oradius) < PIXSTOP(ycen + oradius) ){\n g->shapes[sno].ystart = max(g->y0,PIXSTART(ycen - oradius));\n g->shapes[sno].ystop = min(g->y1,PIXSTOP(ycen + oradius));\n }\n else{\n g->shapes[sno].ystart = min(g->y1,PIXSTOP(ycen + oradius));\n g->shapes[sno].ystop = max(g->y0,PIXSTART(ycen - oradius));\n }\n g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));\n scanlist = g->shapes[sno].scanlist;\n marky(g, sno, flag, type);\n \n for(yy=g->shapes[sno].ystart; yy<=g->shapes[sno].ystop; yy++){\n yoff = PIXCEN(yy) - ycen;\n if( (dval=(oradius * oradius) - (yoff * yoff)) > 0.0 ){\n xoff = sqrt(dval);\n if( PIXSTART(xcen - xoff) <= PIXSTOP(xcen + xoff) ){\n rgs_mark(g, scanlist, sno, flag, type, PIXSTART(xcen - xoff), yy);\n rgs_mark(g, scanlist, sno, flag, type, PIXSTOP(xcen + xoff), yy);\n }\n if( (dval=(iradius * iradius) - (yoff * yoff)) > 0.0 ){\n xoff = sqrt(dval);\n if( PIXSTART(xcen - xoff) <= PIXSTOP(xcen + xoff) ){\n rgs_mark(g, scanlist, sno, flag, type, PIXSTART(xcen - xoff), yy);\n rgs_mark(g, scanlist, sno, flag, type, PIXSTOP(xcen + xoff), yy);\n }\n }\n }\n }\n}\n\nint imannulus(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double iradius, double oradius)\n{\n Scan scan;\n\n if( iradius == 0 ){\n return(imcircle(g, rno, sno, flag, type, x, y, xcen, ycen, oradius));\n }\n if( g->evsect ){\n if( g->usebinsiz ){\n x = (int)((x - g->tlminx)/g->binsizx + 1.0);\n y = (int)((y - g->tlminy)/g->binsizy + 1.0);\n }\n else{\n x = (int)((x - g->tlminx) + 1.0);\n y = (int)((y - g->tlminy) + 1.0);\n }\n x = (int)((x - g->xmin)/g->block + 1.0);\n y = (int)((y - g->ymin)/g->block + 1.0);\n if(y < g->y0) return 0;\n if(y > g->y1) return 0;\n if(x < g->x0) return 0;\n if(x > g->x1) return 0;\n }\n if( flag ){\n if(y < g->shapes[sno].ystart ) return 0;\n if(y > g->shapes[sno].ystop ) return 0;\n }\n scan = g->shapes[sno].scanlist[(int)y];\n if( (scan && \n ((y >= g->shapes[sno].ystart) && (y <= g->shapes[sno].ystop)) &&\n (scan->next->next ?\n (((x >= scan->x) && (x <= scan->next->next->next->x)) &&\n !((x >= scan->next->x) && (x <= scan->next->next->x))) :\n ((x >= scan->x) && (x <= scan->next->x))))\n ==flag ){\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else\n return 0;\n}\n\nvoid imboxi(GFilt g, int rno, int sno, int flag, int type,\n double UNUSED(x), double UNUSED(y),\n double xcen, double ycen, double xwidth, double yheight,\n double angle)\n{\n double angl; \n double half_width, half_height;\n double cosangl, sinangl; \n double hw_cos, hw_sin; \n double hh_cos, hh_sin; \n double cornerx[4], cornery[4]; \n\n \n if( (xwidth == 0) && (yheight==0) ){\n return;\n }\n \n xcen = (xcen - g->xmin)/g->block + 1.0;\n ycen = (ycen - g->ymin)/g->block + 1.0;\n xwidth /= (double)g->block;\n yheight /= (double)g->block;\n#if USE_ASTRO_ANGLE\n \n angl = angle + 90.0;\n#else\n angl = angle;\n#endif\n while (angl >= 360.0) angl = angl - 360.0;\n \n angl = (angl / 180.0) * M_PI;\n sinangl = sin (angl);\n cosangl = cos (angl);\n#if USE_ASTRO_ANGLE\n \n \n \n half_width = yheight / 2.0;\n half_height = xwidth / 2.0;\n#else\n half_width = xwidth / 2.0;\n half_height = yheight / 2.0;\n#endif\n hw_cos = half_width * cosangl;\n hw_sin = half_width * sinangl;\n hh_cos = half_height * cosangl;\n hh_sin = half_height * sinangl;\n#if USE_ASTRO_ANGLE\n cornerx[0] = xcen - hw_cos - hh_sin;\n cornery[0] = ycen - hw_sin + hh_cos;\n cornerx[1] = xcen + hw_cos - hh_sin;\n cornery[1] = ycen + hw_sin + hh_cos;\n cornerx[2] = xcen + hw_cos + hh_sin;\n cornery[2] = ycen + hw_sin - hh_cos;\n cornerx[3] = xcen - hw_cos + hh_sin;\n cornery[3] = ycen - hw_sin - hh_cos;\n#else\n cornerx[0] = xcen - hw_cos + hh_sin;\n cornery[0] = ycen - hh_cos - hw_sin;\n cornerx[1] = xcen - hw_cos - hh_sin;\n cornery[1] = ycen + hh_cos - hw_sin;\n cornerx[2] = xcen + hw_cos - hh_sin;\n cornery[2] = ycen + hh_cos + hw_sin;\n cornerx[3] = xcen + hw_cos + hh_sin;\n cornery[3] = ycen - hh_cos + hw_sin;\n#endif\n _polygoni(g, 0, rno, sno, flag, type, cornerx, cornery, 4);\n}\n\nint imbox(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double UNUSED(xcen), double UNUSED(ycen),\n double xwidth, double yheight,\n double UNUSED(angle))\n{\n if( (xwidth == 0) && (yheight==0) ){\n return(!flag);\n }\n return impolygon(g, rno, sno, flag, type, x, y);\n}\n\nvoid imcirclei(GFilt g, int UNUSED(rno), int sno, int flag, int type,\n double UNUSED(x), double UNUSED(y),\n double xcen, double ycen, double radius)\n{\n int yy;\n double dval;\n double xoff, yoff;\n Scan *scanlist;\n\n \n if( radius == 0 ){\n return;\n }\n \n xcen = (xcen - g->xmin)/g->block + 1.0;\n ycen = (ycen - g->ymin)/g->block + 1.0;\n radius /= (double)g->block;\n \n if( PIXSTART(ycen - radius) < PIXSTOP(ycen + radius) ){\n g->shapes[sno].ystart = max(g->y0,PIXSTART(ycen - radius));\n g->shapes[sno].ystop = min(g->y1,PIXSTOP(ycen + radius));\n }\n else{\n g->shapes[sno].ystart = min(g->y1,PIXSTOP(ycen + radius));\n g->shapes[sno].ystop = max(g->y0,PIXSTART(ycen - radius));\n }\n g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));\n scanlist = g->shapes[sno].scanlist;\n marky(g, sno, flag, type);\n \n for(yy=g->shapes[sno].ystart; yy<=g->shapes[sno].ystop; yy++){\n yoff = PIXCEN(yy) - ycen;\n if( (dval=(radius * radius) - (yoff * yoff))>=0.0 ){\n xoff = sqrt(dval);\n if( PIXSTART(xcen - xoff) <= PIXSTOP(xcen + xoff) ){\n rgs_mark(g, scanlist, sno, flag, type, PIXSTART(xcen - xoff), yy);\n rgs_mark(g, scanlist, sno, flag, type, PIXSTOP(xcen + xoff), yy);\n }\n }\n }\n}\n\nint imcircle(GFilt g, int rno, int sno, int flag, int UNUSED(type),\n double x, double y,\n double UNUSED(xcen), double UNUSED(ycen), double radius)\n{\n Scan scan;\n\n if( radius == 0 ){\n return(!flag);\n }\n if( g->evsect ){\n if( g->usebinsiz ){\n x = (int)((x - g->tlminx)/g->binsizx + 1.0);\n y = (int)((y - g->tlminy)/g->binsizy + 1.0);\n }\n else{\n x = (int)((x - g->tlminx) + 1.0);\n y = (int)((y - g->tlminy) + 1.0);\n }\n x = (int)((x - g->xmin)/g->block + 1.0);\n y = (int)((y - g->ymin)/g->block + 1.0);\n if(y < g->y0) return 0;\n if(y > g->y1) return 0;\n if(x < g->x0) return 0;\n if(x > g->x1) return 0;\n }\n if( flag ){\n if(y < g->shapes[sno].ystart ) return 0;\n if(y > g->shapes[sno].ystop ) return 0;\n }\n scan = g->shapes[sno].scanlist[(int)y];\n if( (scan && \n ((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&\n ((x >= scan->x) && (x <= (scan->next)->x))) == flag ){\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else{\n return 0;\n }\n}\n\nvoid imellipsei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double xrad, double yrad,\n double angle)\n{\n int yy;\n int nr, nc;\n double yhi;\n double yoff;\n double xboff, xfoff;\n double angl;\n double sinangl, cosangl;\n double cossq, sinsq, xradsq, yradsq;\n double a, b_partial, c_partial;\n double b, c;\n Scan *scanlist;\n\n \n\n if( xrad == yrad ){\n imcirclei(g, rno, sno, flag, type, x, y, xcen, ycen, xrad);\n return;\n }\n \n xcen = (xcen - g->xmin)/g->block + 1.0;\n ycen = (ycen - g->ymin)/g->block + 1.0;\n xrad /= (double)g->block;\n yrad /= (double)g->block;\n \n#if USE_ASTRO_ANGLE\n \n angl = angle + 90.0;\n#else\n angl = angle;\n#endif\n while( angl >= 360.0 )\n angl = angl - 360.0;\n \n angl = (angl / 180.0) * M_PI;\n sinangl = sin(angl);\n cosangl = cos(angl);\n \n \n FPU_DOUBLE\n#if USE_ASTRO_ANGLE\n yhi = fabs(sinangl * yrad) + fabs(cosangl * xrad);\n#else\n yhi = fabs(sinangl * xrad) + fabs(cosangl * yrad);\n#endif\n yhi = min(yhi, max(yrad, xrad));\n \n if( PIXSTART(ycen - yhi) < PIXSTOP(ycen + yhi) ){\n g->shapes[sno].ystart = max(g->y0,PIXSTART(ycen - yhi));\n g->shapes[sno].ystop = min(g->y1,PIXSTOP(ycen + yhi));\n }\n else{\n g->shapes[sno].ystart = min(g->y1,PIXSTOP(ycen + yhi));\n g->shapes[sno].ystop = max(g->y0,PIXSTART(ycen - yhi));\n }\n FPU_RESTORE\n g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));\n scanlist = g->shapes[sno].scanlist;\n marky(g, sno, flag, type);\n \n cossq = cosangl * cosangl;\n sinsq = sinangl * sinangl;\n#if USE_ASTRO_ANGLE\n \n \n \n \n xradsq = yrad * yrad;\n yradsq = xrad * xrad;\n#else\n xradsq = xrad * xrad;\n yradsq = yrad * yrad;\n#endif\n \n a = (cossq / xradsq) + (sinsq / yradsq);\n b_partial = (2.0 * sinangl) * ((cosangl / xradsq) - (cosangl / yradsq));\n c_partial = (sinsq / xradsq) + (cossq / yradsq);\n \n for(yy=g->shapes[sno].ystart; yy<=g->shapes[sno].ystop; yy++){\n yoff = yy - ycen;\n b = b_partial * yoff;\n c = (c_partial * yoff * yoff) - 1.0;\n \n quadeq (a, b, c, &xboff, &xfoff, &nr, &nc);\n \n if( nr != 0 ) {\n \n rgs_mark(g, scanlist, sno, flag, type, PIXSTART(xcen + xboff), yy);\n rgs_mark(g, scanlist, sno, flag, type, PIXSTOP(xcen + xfoff), yy);\n }\n }\n}\n\nint imellipse(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double xrad, double yrad,\n double UNUSED(angle))\n{\n Scan scan;\n\n if( xrad == yrad ){\n return(imcircle(g, rno, sno, flag, type, x, y, xcen, ycen, xrad));\n }\n if( g->evsect ){\n if( g->usebinsiz ){\n x = (int)((x - g->tlminx)/g->binsizx + 1.0);\n y = (int)((y - g->tlminy)/g->binsizy + 1.0);\n }\n else{\n x = (int)((x - g->tlminx) + 1.0);\n y = (int)((y - g->tlminy) + 1.0);\n }\n x = (int)((x - g->xmin)/g->block + 1.0);\n y = (int)((y - g->ymin)/g->block + 1.0);\n if(y < g->y0) return 0;\n if(y > g->y1) return 0;\n if(x < g->x0) return 0;\n if(x > g->x1) return 0;\n }\n if( flag ){\n if(y < g->shapes[sno].ystart ) return 0;\n if(y > g->shapes[sno].ystop ) return 0;\n }\n scan = g->shapes[sno].scanlist[(int)y];\n FPU_DOUBLE\n if( (scan && \n ((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&\n ((x >= scan->x) && (x <= (scan->next)->x))) == flag ){\n if( rno && flag ) g->rid = rno;\n FPU_RESTORE\n return 1;\n }\n else{\n FPU_RESTORE\n return 0;\n }\n}\n\nvoid imfieldi(GFilt g, int UNUSED(rno), int sno, int flag, int type,\n double UNUSED(x), double UNUSED(y))\n{\n int yy;\n Scan *scanlist;\n\n \n g->shapes[sno].ystart = g->y0;\n g->shapes[sno].ystop = g->y1;\n g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));\n scanlist = g->shapes[sno].scanlist;\n marky(g, sno, flag, type);\n \n for(yy=g->shapes[sno].ystart; yy<=g->shapes[sno].ystop; yy++){\n rgs_mark(g, scanlist, sno, flag, type, g->x0, yy);\n rgs_mark(g, scanlist, sno, flag, type, g->x1, yy);\n }\n}\n\nint imfield(GFilt g, int rno, int UNUSED(sno), int flag, int UNUSED(type),\n double UNUSED(x), double UNUSED(y))\n{\n if( flag ){\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else{\n return 0;\n }\n}\n\nvoid imlinei(GFilt g, int UNUSED(rno), int sno, int flag, int type,\n double UNUSED(x), double UNUSED(y),\n double x1, double y1, double x2, double y2)\n{\n double vx[2];\n double vy[2];\n int xval, yval;\n double invslope, xoffset;\n\n \n \n x1 = (x1 - g->xmin)/g->block + 1.0;\n y1 = (y1 - g->ymin)/g->block + 1.0;\n x2 = (x2 - g->xmin)/g->block + 1.0;\n y2 = (y2 - g->ymin)/g->block + 1.0;\n \n if( y1 < y2 ){\n vx[0] = x1;\n vy[0] = y1;\n vx[1] = x2;\n vy[1] = y2;\n }\n else{\n vx[0] = x2;\n vy[0] = y2;\n vx[1] = x1;\n vy[1] = y1;\n }\n \n g->shapes[sno].ystart = PIXNUM(vy[0]);\n g->shapes[sno].ystop = PIXNUM(vy[1]);\n g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));\n marky(g, sno, flag, type);\n if( feq(vy[0],vy[1]) ){\n rgs_mark(g, g->shapes[sno].scanlist, sno, flag, type,\n (int)min(vx[0],vx[1]), (int)vy[0]);\n rgs_mark(g, g->shapes[sno].scanlist, sno, flag, type,\n (int)max(vx[0],vx[1]), (int)vy[0]);\n }\n else{\n \n invslope = (vx[0] - vx[1]) / (vy[0] - vy[1]);\n xoffset = vx[0];\n for(yval=vy[0]; yval<=vy[1]; yval++){\n xval = xoffset;\n rgs_mark(g, g->shapes[sno].scanlist, sno, flag, type, xval, yval);\n xoffset = xoffset + invslope;\n }\n }\n}\n\nint imline(GFilt g, int rno, int sno, int flag, int UNUSED(type),\n double x, double y,\n double UNUSED(x1), double UNUSED(y1),\n double UNUSED(x2), double UNUSED(y2))\n{\n Scan scan;\n\n if( g->evsect ){\n if( g->usebinsiz ){\n x = (int)((x - g->tlminx)/g->binsizx + 1.0);\n y = (int)((y - g->tlminy)/g->binsizy + 1.0);\n }\n else{\n x = (int)((x - g->tlminx) + 1.0);\n y = (int)((y - g->tlminy) + 1.0);\n }\n x = (int)((x - g->xmin)/g->block + 1.0);\n y = (int)((y - g->ymin)/g->block + 1.0);\n if(y < g->y0) return 0;\n if(y > g->y1) return 0;\n if(x < g->x0) return 0;\n if(x > g->x1) return 0;\n }\n if( flag ){\n if(y < g->shapes[sno].ystart ) return 0;\n if(y > g->shapes[sno].ystop ) return 0;\n }\n scan = g->shapes[sno].scanlist[(int)y];\n if( (scan &&\n ((x==(int)scan->x) ||\n (scan->next&&((x>=(int)scan->x)&&(x<=(int)scan->next->x)))))==flag ) {\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else\n return 0;\n}\n\nvoid impiei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double angle1, double angle2)\n{\n _impiei(g, 0, rno, sno, flag, type, x, y, xcen, ycen, angle1, angle2);\n}\n\nint impie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double UNUSED(xcen), double UNUSED(ycen),\n double UNUSED(angle1), double UNUSED(angle2))\n{\n return impolygon(g, rno, sno, flag, type, x, y);\n}\n\nvoid imqtpiei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double angle1, double angle2)\n{\n _impiei(g, 1, rno, sno, flag, type, x, y, xcen, ycen, angle1, angle2);\n}\n\nint imqtpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double UNUSED(xcen), double UNUSED(ycen),\n double UNUSED(angle1), double UNUSED(angle2))\n{\n return impolygon(g, rno, sno, flag, type, x, y);\n}\n\nvoid impointi(GFilt g, int UNUSED(rno), int sno, int flag, int type,\n double UNUSED(x), double UNUSED(y),\n double xcen, double ycen)\n{\n \n \n xcen = (xcen - g->xmin)/g->block + 1.0;\n ycen = (ycen - g->ymin)/g->block + 1.0;\n \n g->shapes[sno].ystart = PIXNUM(ycen);\n g->shapes[sno].ystop = PIXNUM(ycen);\n g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));\n marky(g, sno, flag, type);\n rgs_mark(g, g->shapes[sno].scanlist, sno, flag, type,\n PIXNUM(xcen), PIXNUM(ycen));\n}\n\nint impoint(GFilt g, int rno, int sno, int flag, int UNUSED(type),\n double x, double y,\n double UNUSED(xcen), double UNUSED(ycen))\n{\n Scan scan;\n\n if( g->evsect ){\n if( g->usebinsiz ){\n x = (int)((x - g->tlminx)/g->binsizx + 1.0);\n y = (int)((y - g->tlminy)/g->binsizy + 1.0);\n }\n else{\n x = (int)((x - g->tlminx) + 1.0);\n y = (int)((y - g->tlminy) + 1.0);\n }\n x = (int)((x - g->xmin)/g->block + 1.0);\n y = (int)((y - g->ymin)/g->block + 1.0);\n if(y < g->y0) return 0;\n if(y > g->y1) return 0;\n if(x < g->x0) return 0;\n if(x > g->x1) return 0;\n }\n if( flag ){\n if(y < g->shapes[sno].ystart ) return 0;\n if(y > g->shapes[sno].ystop ) return 0;\n }\n scan = g->shapes[sno].scanlist[(int)y];\n if( (scan &&\n (y == (int)g->shapes[sno].ystart) && \n (x == (int)scan->x))==flag ) {\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else\n return 0;\n}\n\n#ifdef __STDC__\nvoid\nimpolygoni(GFilt g, int rno, int sno, int flag, int type,\n double UNUSED(x), double y, ...)\n{\n double *vx=NULL, *vy=NULL;\n int count, maxcount;\n va_list args;\n va_start(args, y);\n#else\nvoid impolygoni(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double *vx=NULL, *vy=NULL;\n int count, maxcount;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n#endif\n \n \n maxcount = MASKINC;\n vx = (double *)calloc(maxcount, sizeof(double));\n vy = (double *)calloc(maxcount, sizeof(double));\n \n count = 0;\n while( 1 ){\n if( (count + 1) >= maxcount ){\n maxcount += MASKINC;\n vx = (double *)realloc(vx, maxcount*sizeof(double));\n vy = (double *)realloc(vy, maxcount*sizeof(double));\n }\n vx[count] = va_arg(args, double);\n vy[count] = va_arg(args, double);\n if( feq(vx[count],PSTOP) && feq(vy[count],PSTOP) )\n break;\n vx[count] = (vx[count] - g->xmin)/g->block + 1.0;\n vy[count] = (vy[count] - g->ymin)/g->block + 1.0;\n count ++;\n }\n va_end(args);\n \n vx = (double *)realloc(vx, count*sizeof(double));\n vy = (double *)realloc(vy, count*sizeof(double));\n \n _polygoni(g, 0, rno, sno, flag, type, vx, vy, count);\n if( vx ) free(vx);\n if( vy ) free(vy);\n}\n\n#ifdef __STDC__\nint\nimpolygon(GFilt g, int rno, int sno, int flag, int UNUSED(type),\n double x, double y, ...)\n{\n int crossings;\n Scan scan;\n va_list args;\n va_start(args, y);\n#else\nint impolygon(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n int crossings;\n Scan scan;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n#endif\n va_end(args);\n if( g->evsect ){\n if( g->usebinsiz ){\n x = (int)((x - g->tlminx)/g->binsizx + 1.0);\n y = (int)((y - g->tlminy)/g->binsizy + 1.0);\n }\n else{\n x = (int)((x - g->tlminx) + 1.0);\n y = (int)((y - g->tlminy) + 1.0);\n }\n x = (int)((x - g->xmin)/g->block + 1.0);\n y = (int)((y - g->ymin)/g->block + 1.0);\n if(y < g->y0) return 0;\n if(y > g->y1) return 0;\n if(x < g->x0) return 0;\n if(x > g->x1) return 0;\n }\n if( flag ){\n if(y < g->shapes[sno].ystart ) return 0;\n if(y > g->shapes[sno].ystop ) return 0;\n }\n \n if( (y>=g->shapes[sno].ystart)&&(y<=g->shapes[sno].ystop) ){\n crossings = 0;\n for(scan=g->shapes[sno].scanlist[(int)y]; scan; scan=scan->next){\n if( x >= scan->x )\n crossings++;\n else\n break;\n }\n if( (crossings%2) == flag ){\n if( rno && flag ) g->rid = rno;\n return 1;\n }\n else{\n return 0;\n }\n }\n else{\n return !flag;\n }\n}\n\nvoid imnannulusi(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lo, double hi, int n)\n{\n int i;\n int xsno;\n double dinc;\n\n \n\n \n dinc = (hi - lo)/n;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n \n imannulusi(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi);\n for(i=0; i<n; i++){\n imannulusi(g, rno+i, sno+i, flag, type, x, y,\n xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc));\n }\n}\n\nvoid imnboxi(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lox, double loy, double hix, double hiy, int n,\n double ang)\n{\n int i;\n int xsno;\n double dincx;\n double dincy;\n\n \n\n \n dincx = (hix - lox)/n;\n dincy = (hiy - loy)/n;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n \n imboxi(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang);\n imboxi(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang);\n for(i=0; i<n; i++){\n imboxi(g, rno+i, sno+i, flag, type, x, y,\n xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang);\n }\n}\n\nvoid imnellipsei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lox, double loy, double hix, double hiy, int n,\n double ang)\n{\n int i;\n int xsno;\n double dincx;\n double dincy;\n\n \n\n \n dincx = (hix - lox)/n;\n dincy = (hiy - loy)/n;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n \n imellipsei(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang);\n imellipsei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang);\n for(i=0; i<n; i++){\n imellipsei(g, rno+i, sno+i, flag, type, x, y,\n xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang);\n }\n}\n\nvoid imnpiei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lo, double hi, int n)\n{\n int i;\n int xsno;\n double dinc;\n\n \n\n \n while( lo > hi ) lo -= 360.0;\n dinc = (hi - lo)/n;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n \n impiei(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi);\n for(i=0; i<n; i++){\n impiei(g, rno+i, sno+i, flag, type, x, y,\n xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc));\n }\n}\n\nvoid impandai(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double anglo, double anghi, double angn,\n double radlo, double radhi, double radn)\n{\n int a, r;\n int ahi, rhi;\n int xsno;\n int n=0;\n double ainc, rinc;\n\n \n\n \n while( anglo > anghi ) anglo -= 360.0;\n ainc = (anghi - anglo)/angn;\n ahi = (int)angn;\n rinc = (radhi - radlo)/radn;\n rhi = (int)radn;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n \n imannulusi(g, 0, xsno, flag, type, x, y, xcen, ycen, radlo, radhi);\n imqtpiei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi);\n for(a=0; a<ahi; a++){\n for(r=0; r<rhi; r++){\n imannulusi(g, rno+n, sno+(2*n), flag, type, x, y,\n xcen, ycen, radlo+(r*rinc), radlo+((r+1)*rinc));\n imqtpiei(g, rno+n, sno+(2*n+1), flag, type, x, y,\n xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc));\n n++;\n }\n }\n}\n\nvoid imbpandai(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double anglo, double anghi, double angn,\n double xlo, double ylo, double xhi, double yhi, double radn,\n double ang)\n{\n int a, r;\n int ahi, rhi;\n int xsno;\n int n=0;\n double ainc, xinc, yinc;\n\n \n\n \n anglo += ang;\n anghi += ang;\n while( anglo > anghi ) anglo -= 360.0;\n ainc = (anghi - anglo)/angn;\n ahi = (int)angn;\n xinc = (xhi - xlo)/radn;\n yinc = (yhi - ylo)/radn;\n rhi = (int)radn;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n \n imboxi(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi, ang);\n imqtpiei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi);\n imboxi(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo, ang);\n for(a=0; a<ahi; a++){\n for(r=1; r<=rhi; r++){\n imboxi(g, rno+n, sno+(2*n), flag, type, x, y,\n xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang);\n imqtpiei(g, rno+n, sno+(2*n+1), flag, type, x, y,\n xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc));\n n++;\n }\n }\n}\n\nvoid imepandai(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double anglo, double anghi, double angn,\n double xlo, double ylo, double xhi, double yhi, double radn,\n double ang)\n{\n int a, r;\n int ahi, rhi;\n int xsno;\n int n=0;\n double ainc, xinc, yinc;\n\n \n\n \n anglo += ang;\n anghi += ang;\n while( anglo > anghi ) anglo -= 360.0;\n ainc = (anghi - anglo)/angn;\n ahi = (int)angn;\n xinc = (xhi - xlo)/radn;\n yinc = (yhi - ylo)/radn;\n rhi = (int)radn;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n \n imellipsei(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi, ang);\n imqtpiei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi);\n imellipsei(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo, ang);\n for(a=0; a<ahi; a++){\n for(r=1; r<=rhi; r++){\n imellipsei(g, rno+n, sno+(2*n), flag, type, x, y,\n xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang);\n imqtpiei(g, rno+n, sno+(2*n+1), flag, type, x, y,\n xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc));\n n++;\n }\n }\n}\n\n\n\nint imnannulus(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen,\n double lo, double hi, int n)\n{\n int i;\n int xsno;\n double dinc;\n\n \n dinc = (hi - lo)/(double)n;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !imannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi) ){\n return(0);\n }\n \n for(i=0; i<n; i++){\n if( imannulus(g, rno+i, sno+i, flag, type, x, y,\n xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc)) ){\n return(1);\n }\n }\n return(0);\n }\n else{\n \n if( !imannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, lo, hi) ){\n return(1);\n }\n return(0);\n }\n}\n\nint imnbox(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen,\n double lox, double loy, double hix, double hiy, int n,\n double ang)\n{\n int i;\n int xsno;\n double dincx;\n double dincy;\n\n \n dincx = (hix - lox)/n;\n dincy = (hiy - loy)/n;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !imbox(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang) ){\n return(0);\n }\n \n if( imbox(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang) ){\n return(0);\n }\n \n for(i=0; i<n; i++){\n if( imbox(g, rno+i, sno+i, flag, type, x, y,\n xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang) ){\n return(1);\n }\n }\n return(0);\n }\n \n else{\n \n if( !imbox(g, 0, xsno, 1, type, x, y, xcen, ycen, hix, hiy, ang) ){\n return(1);\n }\n \n if( imbox(g, 0, xsno+1, 1, type, x, y, xcen, ycen, lox, loy, ang) ){\n return(1);\n }\n return(0);\n }\n}\n\nint imnellipse(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen,\n double lox, double loy, double hix, double hiy, int n,\n double ang)\n{\n int i;\n int xsno;\n double dincx;\n double dincy;\n\n \n dincx = (hix - lox)/n;\n dincy = (hiy - loy)/n;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !imellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang) ){\n return(0);\n }\n \n if( imellipse(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang) ){\n return(0);\n }\n \n for(i=0; i<n; i++){\n if( imellipse(g, rno+i, sno+i, flag, type, x, y,\n xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang) ){\n return(1);\n }\n }\n return(0);\n }\n \n else{\n \n if( !imellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, hix, hiy, ang) ){\n return(1);\n }\n \n if( imellipse(g, 0, xsno+1, 1, type, x, y, xcen, ycen, lox, loy, ang) ){\n return(1);\n }\n return(0);\n }\n}\n\nint imnpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen,\n double lo, double hi, int n)\n{\n int i;\n int xsno;\n double dinc;\n\n \n while( lo > hi ) lo -= 360.0;\n dinc = (hi - lo)/n;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !impie(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi) ){\n return(0);\n }\n \n for(i=0; i<n; i++){\n if( impie(g, rno+i, sno+i, flag, type, x, y,\n xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc)) ){\n return(1);\n }\n }\n return(0);\n }\n else{\n \n if( !impie(g, 0, xsno, 1, type, x, y, xcen, ycen, lo, hi) ){\n return(1);\n }\n return(0);\n }\n}\n\nint impanda(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double anglo, double anghi, double angn,\n double radlo, double radhi, double radn)\n{\n \n int a, r;\n int ahi, rhi;\n int xsno;\n int n=0;\n double ainc, rinc;\n\n \n while( anglo > anghi ) anglo -= 360.0;\n ainc = (anghi - anglo)/angn;\n ahi = (int)angn;\n rinc = (radhi - radlo)/radn;\n rhi = (int)radn;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !imannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, radlo, radhi) ||\n !impie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi) ){\n return(0);\n }\n \n for(a=1; a<=ahi; a++){\n for(r=1; r<=rhi; r++){\n if( imannulus(g, rno+n, sno+(2*n), flag, type, x, y,\n xcen, ycen, radlo+((r-1)*rinc), radlo+(r*rinc)) &&\n impie(g, rno+n, sno+(2*n+1), flag, type, x, y,\n xcen, ycen, anglo+((a-1)*ainc), anglo+(a*ainc)) ){\n return(1);\n }\n n++;\n }\n }\n return(0);\n }\n else{\n \n if( !imannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, radlo, radhi) )\n return(1);\n else if( !impie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){\n return(1);\n }\n else{\n return(0);\n }\n }\n}\n\nint imbpanda(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double anglo, double anghi, double angn,\n double xlo, double ylo, double xhi, double yhi, double radn,\n double ang)\n{\n \n int a, r;\n int ahi, rhi;\n int xsno;\n int n=0;\n double ainc, xinc, yinc;\n\n \n anglo += ang;\n anghi += ang;\n while( anglo > anghi ) anglo -= 360.0;\n ainc = (anghi - anglo)/angn;\n ahi = (int)angn;\n xinc = (xhi - xlo)/radn;\n yinc = (yhi - ylo)/radn;\n rhi = (int)radn;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !imbox(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi,\n ang) ){\n return(0);\n }\n \n else if( imbox(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo,\n ang) ){\n return(0);\n }\n \n else if( !impie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi)){\n return(0);\n }\n \n for(a=0; a<ahi; a++){\n for(r=1; r<=rhi; r++){\n if( imbox(g, rno+n, sno+(2*n), flag, type, x, y,\n xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang) &&\n imqtpie(g, rno+n, sno+(2*n+1), flag, type, x, y,\n xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc)) ){\n return(1);\n }\n n++;\n }\n }\n return(0);\n }\n else{\n \n if( !imbox(g, 0, xsno, 1, type, x, y, xcen, ycen, xhi, yhi, ang) )\n return(1);\n \n else if( !imbox(g, 0, xsno+2, 1, type, x, y, xcen, ycen, xlo, ylo,\n ang) )\n return(1);\n \n else if( !impie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){\n return(1);\n }\n else{\n return(0);\n }\n }\n}\n\nint imepanda(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double anglo, double anghi, double angn,\n double xlo, double ylo, double xhi, double yhi, double radn,\n double ang)\n{\n \n int a, r;\n int ahi, rhi;\n int xsno;\n int n=0;\n double ainc, xinc, yinc;\n\n \n anglo += ang;\n anghi += ang;\n while( anglo > anghi ) anglo -= 360.0;\n ainc = (anghi - anglo)/angn;\n ahi = (int)angn;\n xinc = (xhi - xlo)/radn;\n yinc = (yhi - ylo)/radn;\n rhi = (int)radn;\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( flag ){\n \n if( !imellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi,\n ang) ){\n return(0);\n }\n \n else if( imellipse(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo,\n ang) ){\n return(0);\n }\n \n else if( !impie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi)){\n return(0);\n }\n \n for(a=0; a<ahi; a++){\n for(r=1; r<=rhi; r++){\n if( imellipse(g, rno+n, sno+(2*n), flag, type, x, y,\n xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang) &&\n imqtpie(g, rno+n, sno+(2*n+1), flag, type, x, y,\n xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc)) ){\n return(1);\n }\n n++;\n }\n }\n return(0);\n }\n else{\n \n if( !imellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, xhi, yhi, ang) )\n return(1);\n \n else if( !imellipse(g, 0, xsno+2, 1, type, x, y, xcen, ycen, xlo, ylo,\n ang) )\n return(1);\n \n else if( !impie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){\n return(1);\n }\n else{\n return(0);\n }\n }\n}\n\n#ifdef __STDC__\nvoid\nimvannulusi(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...)\n{\n int i, n;\n int maxpts;\n int xsno;\n double *xv;\n va_list args;\n va_start(args, ycen);\n#else\nint imvannulusi(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double xcen, ycen;\n double ang;\n double *xv;\n int i, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n xcen = va_arg(args, double);\n ycen = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n \n if( n == 2 ){\n imannulusi(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1]);\n return;\n }\n imannulusi(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]);\n for(i=0; i<(n-1); i++){\n imannulusi(g, rno+i, sno+i, flag, type, x, y, xcen, ycen, xv[i], xv[i+1]);\n }\n}\n\n#ifdef __STDC__\nvoid\nimvboxi(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...)\n{\n int i, j, n;\n int maxpts;\n int xsno;\n double ang;\n double *xv;\n va_list args;\n va_start(args, ycen);\n#else\nint imvboxi(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double xcen, ycen;\n double ang;\n double *xv;\n int i, j, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n xcen = va_arg(args, double);\n ycen = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n ang = xv[--n];\n \n if( n == 2 ){\n imboxi(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang);\n return;\n }\n imboxi(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1], ang);\n imboxi(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang);\n for(i=2, j=0; i<n; i+=2, j++){\n imboxi(g, rno+j, sno+j, flag, type, x, y, xcen, ycen, xv[i], xv[i+1], ang);\n }\n}\n\n#ifdef __STDC__\nvoid\nimvellipsei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...)\n{\n int i, j, n;\n int maxpts;\n int xsno;\n double ang;\n double *xv;\n va_list args;\n va_start(args, ycen);\n#else\nint imvellipsei(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double xcen, ycen;\n double ang;\n double *xv;\n int i, j, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n xcen = va_arg(args, double);\n ycen = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n ang = xv[--n];\n \n if( n == 2 ){\n imellipsei(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang);\n return;\n }\n imellipsei(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1], ang);\n imellipsei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang);\n for(i=2, j=0; i<n; i+=2, j++){\n imellipsei(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,\n xv[i], xv[i+1], ang);\n }\n}\n\n#ifdef __STDC__\nvoid\nimvpiei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...)\n{\n int i, n;\n int maxpts;\n int xsno;\n double *xv;\n va_list args;\n va_start(args, ycen);\n#else\nint imvpiei(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double xcen, ycen;\n double ang;\n double *xv;\n int i, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n xcen = va_arg(args, double);\n ycen = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n \n if( n == 2 ){\n impiei(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1]);\n return;\n }\n impiei(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]);\n for(i=0; i<(n-1); i++){\n impiei(g, rno+i, sno+i, flag, type, x, y, xcen, ycen, xv[i], xv[i+1]);\n }\n}\n\n#ifdef __STDC__\nvoid\nimvpointi(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, ...)\n{\n int i, j, n;\n int maxpts;\n int xsno;\n double *xv;\n va_list args;\n va_start(args, y);\n#else\nint imvpointi(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double *xv;\n int i, j, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n for(i=0, j=0; i<n; i+=2, j++){\n impointi(g, rno+j, sno+j, flag, type, x, y, xv[i], xv[i+1]);\n }\n}\n\n\n\n#ifdef __STDC__\nint\nimvannulus(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...)\n{\n int i, n;\n int maxpts;\n int xsno;\n double *xv;\n va_list args;\n va_start(args, ycen);\n#else\nint imvannulus(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double xcen, ycen;\n double *xv;\n int i, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n xcen = va_arg(args, double);\n ycen = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n \n if( n == 2 ){\n return(imannulus(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1]));\n }\n if( flag ){\n \n if( !imannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){\n return(0);\n }\n \n for(i=0; i<n; i++){\n if( imannulus(g, rno+i, sno+i, flag, type, x, y, xcen, ycen,\n xv[i], xv[i+1]) ){\n return(1);\n }\n }\n return(0);\n }\n \n else{\n \n if( !imannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){\n return(1);\n }\n return(0);\n }\n}\n\n#ifdef __STDC__\nint\nimvbox(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...)\n{\n int i, j, n;\n int maxpts;\n int xsno;\n double ang;\n double *xv;\n va_list args;\n va_start(args, ycen);\n#else\nint imvbox(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double xcen, ycen;\n double ang;\n double *xv;\n int i, j, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n xcen = va_arg(args, double);\n ycen = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n ang = xv[--n];\n \n if( n == 2 ){\n return(imbox(g, rno, sno, flag, type, x, y,\n xcen, ycen, xv[0], xv[1], ang));\n }\n if( flag ){\n \n if( !imbox(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1],\n ang) ){\n return(0);\n }\n \n if( imbox(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){\n return(0);\n }\n \n for(i=2, j=0; i<n; i+=2, j++){\n if( imbox(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,\n xv[i], xv[i+1], ang) ){\n return(1);\n }\n }\n return(0);\n }\n \n else{\n \n if( !imbox(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[n-2], xv[n-1], ang) ){\n return(1);\n }\n \n else if( imbox(g, 0, xsno+1, 1, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){\n return(1);\n }\n return(0);\n }\n}\n\n#ifdef __STDC__\nint\nimvellipse(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...)\n{\n int i, j, n;\n int maxpts;\n int xsno;\n double ang;\n double *xv;\n va_list args;\n va_start(args, ycen);\n#else\nint imvellipse(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double xcen, ycen;\n double ang;\n double *xv;\n int i, j, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n xcen = va_arg(args, double);\n ycen = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n ang = xv[--n];\n \n if( n == 2 ){\n return(imellipse(g, rno, sno, flag, type, x, y,\n xcen, ycen, xv[0], xv[1], ang));\n }\n if( flag ){\n \n if( !imellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1],\n ang) ){\n return(0);\n }\n \n if( imellipse(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1],\n ang) ){\n return(0);\n }\n \n for(i=2, j=0; i<n; i+=2, j++){\n if( imellipse(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,\n xv[i], xv[i+1], ang) ){\n return(1);\n }\n }\n return(0);\n }\n \n else{\n \n if( !imellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[n-2], xv[n-1],\n ang) ){\n return(1);\n }\n \n if( imellipse(g, 0, xsno+1, 1, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){\n return(1);\n }\n return(0);\n }\n}\n\n#ifdef __STDC__\nint\nimvpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...)\n{\n int i, n;\n int maxpts;\n int xsno;\n double *xv;\n va_list args;\n va_start(args, ycen);\n#else\nint imvpie(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double xcen, ycen;\n double *xv;\n int i, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n xcen = va_arg(args, double);\n ycen = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n \n if( n == 2 ){\n return(impie(g, rno, sno, flag, type, x, y,\n xcen, ycen, xv[0], xv[1]));\n }\n if( flag ){\n \n if( !impie(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){\n return(0);\n }\n \n for(i=0; i<n; i++){\n if( impie(g, rno+i, sno+i, flag, type, x, y, xcen, ycen, xv[i], xv[i+1]) ){\n return(1);\n }\n }\n return(0);\n }\n \n else{\n \n if( !impie(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){\n return(1);\n }\n return(1);\n }\n}\n\n#ifdef __STDC__\nint\nimvpoint(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, ...)\n{\n int i, j, n;\n int maxpts;\n int xsno;\n double *xv;\n va_list args;\n va_start(args, y);\n#else\nint imvpoint(va_alist) va_dcl\n{\n GFilt g;\n int rno, sno, flag, type;\n double x, y;\n double *xv;\n int i, j, n;\n int maxpts;\n int xsno;\n va_list args;\n va_start(args);\n g = va_arg(args, GFilt);\n rno = va_arg(args, int);\n sno = va_arg(args, int);\n flag = va_arg(args, int);\n type = va_arg(args, int);\n x = va_arg(args, double);\n y = va_arg(args, double);\n#endif\n xsno = (g->nshapes+1)+((sno-1)*XSNO);\n if( !g->shapes[xsno].xv ){\n maxpts = MASKINC;\n g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));\n g->shapes[xsno].nv = 0;\n while( 1 ){\n if( g->shapes[xsno].nv >= maxpts ){\n maxpts += MASKINC;\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n maxpts*sizeof(double));\n }\n g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);\n if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&\n feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){\n g->shapes[xsno].nv--;\n break;\n }\n g->shapes[xsno].nv++;\n }\n va_end(args);\n g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,\n g->shapes[xsno].nv*sizeof(double));\n }\n n = g->shapes[xsno].nv;\n xv = g->shapes[xsno].xv;\n \n for(i=0, j=0; i<n; i+=2, j++){\n if( impoint(g, rno+j, sno+j, flag, type, x, y, xv[i], xv[i+1]) ){\n return(1);\n }\n }\n return(0);\n}\n\nvoid imimagemaski(GFilt g, int UNUSED(rno), int UNUSED(sno),\n int UNUSED(flag), int UNUSED(type),\n double UNUSED(x), double UNUSED(y))\n{\n int i, j;\n int got;\n int fsize;\n int mblock;\n FilterMask xmasks;\n\n \n \n mblock = (int)(((double)((g->xmax - g->xmin + 1)/g->block)/(double)g->maskdim) + 0.5);\n if( mblock < 1 ){\n g->masks = NULL;\n g->nmask = 0;\n }\n \n fsize = g->nmask * sizeof(FilterMaskRec) * mblock;\n xmasks = (FilterMask)calloc(1, fsize);\n for(got=0, i=0; i<g->nmask; i++){\n xmasks[got].region = g->masks[i].region;\n xmasks[got].y = (g->masks[i].y - 1.0) * mblock + 1.0;\n xmasks[got].xstart = (g->masks[i].xstart - 1.0) * mblock + 1.0;\n xmasks[got].xstop = (g->masks[i].xstop - 1.0) * mblock + 1.0;\n \n for(j=1; j<mblock; j++){\n xmasks[got+j].region = xmasks[got].region;\n xmasks[got+j].y = xmasks[got].y+j;\n xmasks[got+j].xstart = xmasks[got].xstart;\n xmasks[got+j].xstop = xmasks[got].xstop;\n }\n got += mblock;\n }\n \n qsort(xmasks, got, sizeof(FilterMaskRec), imagemaskcmp);\n /* we don't free previous masks, just overwrite, because they were not\n allocated in the first place */\n \n \n g->masks = xmasks;\n g->nmask = got;\n\n \n for(i=0; i<got; i++){\n if( !g->ybuf[g->masks[i].y] )\n g->ybuf[g->masks[i].y] = i+1;\n }\n}\n\nint imimagemask(GFilt g, int UNUSED(rno), int UNUSED(sno),\n int UNUSED(flag), int UNUSED(type),\n double x, double y)\n{\n int i;\n int ix, iy;\n\n if( g->nmask == 0 )\n return(0);\n if( g->evsect ){\n if( g->usebinsiz ){\n x = (int)((x - g->tlminx)/g->binsizx + 1.0);\n y = (int)((y - g->tlminy)/g->binsizy + 1.0);\n }\n else{\n x = (int)((x - g->tlminx) + 1.0);\n y = (int)((y - g->tlminy) + 1.0);\n }\n x = (int)((x - g->xmin)/g->block + 1.0);\n y = (int)((y - g->ymin)/g->block + 1.0);\n if(y < g->y0) return 0;\n if(y > g->y1) return 0;\n if(x < g->x0) return 0;\n if(x > g->x1) return 0;\n }\n ix = (int)x;\n iy = (int)y;\n \n i = g->ybuf[iy];\n \n if( i != 0 ){\n i--;\n for(; i<g->nmask; i++){\n if( g->masks[i].y > iy ){\n return(0);\n }\n if( (ix >= g->masks[i].xstart) && (ix <= g->masks[i].xstop) ){\n g->rid = g->masks[i].region;\n return(1);\n }\n }\n }\n return(0);\n}\n\n";
diff --git a/funtools/filter/imregions_c.tmpl b/funtools/filter/imregions_c.tmpl
deleted file mode 100644
index 639fefc..0000000
--- a/funtools/filter/imregions_c.tmpl
+++ /dev/null
@@ -1,2585 +0,0 @@
-/*
- NB: MAKE SURE YOU EDIT THE TEMPLATE FILE!!!!
-*/
-
-#ifndef FILTER_PTYPE
-#include <regions.h>
-#endif
-
-#ifndef UNUSED
-#ifdef __GNUC__
-# define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
-#else
-# define UNUSED(x) UNUSED_ ## x
-#endif
-#endif
-
-/* panda and pie incorrectly used astronomical angles. fixed 4/2004 */
-#define USE_ASTRO_ANGLE 0
-
-/* we might want to avoid (x86) extended precision problems */
-#define USE_FPU_DOUBLE _FPUDBL_
-#if USE_FPU_DOUBLE
-#include <fpu_control.h>
-static fpu_control_t _cw;
-#define FPU_DOUBLE {fpu_control_t _cw2; _FPU_GETCW(_cw); _cw2 = _cw & ~_FPU_EXTENDED; _cw2 |= _FPU_DOUBLE; _FPU_SETCW(_cw2);}
-#define FPU_RESTORE {_FPU_SETCW(_cw);}
-#else
-#define FPU_DOUBLE
-#define FPU_RESTORE
-#endif
-
-/* add to FilterOpen to cause this module to be loaded for dynamic linking */
-static int imregno=0;
-void initimregions(void)
-{
- imregno++;
- return;
-}
-
-static void markx(GFilt g, int UNUSED(sno), int flag, int type, int x, int y)
-{
- /* don't mark exclude regions */
- if( type == TOK_EREG )
- return;
- /* for include, we might extend the x limits */
- if( flag ){
- if( x <= g->x0s[y] )
- g->x0s[y] = max(x,g->x0);
- if( x >= g->x1s[y] )
- g->x1s[y] = min(x,g->x1);
- }
- /* for exclude, we have to look at the full line */
- else{
- g->x0s[y] = g->x0;
- g->x1s[y] = g->x1;
- }
-}
-
-static void marky(GFilt g, int sno, int flag, int type)
-{
- int i;
- /* don't mark exclude regions */
- if( type == TOK_EREG )
- return;
- /* mark include shape */
- if( flag ){
- for(i=max(g->y0,g->shapes[sno].ystart);
- i<=min(g->y1,g->shapes[sno].ystop);
- i++)
- g->ybuf[i] = 1;
- }
- /* mark exclude shape */
- else{
- for(i=g->y0; i<=g->shapes[sno].ystart-1; i++)
- g->ybuf[i] = 1;
- for(i=g->shapes[sno].ystop+1; i<=g->y1; i++)
- g->ybuf[i] = 1;
- }
-}
-
-static int
-imagemaskcmp(const void *s1, const void *s2)
-{
- FilterMask f1 = (FilterMask)s1;
- FilterMask f2 = (FilterMask)s2;
-
- if( f1->y < f2->y ){
- return -1;
- }
- else if( f1->y > f2->y ){
- return 1;
- }
- else{
- if( f1->xstart < f2->xstart ){
- return -1;
- }
- else{
- return 1;
- }
- }
-}
-
-/* ***************************** shape support ***************************** */
-
-static void quadeq(double a, double b, double c,
- double *x1, double *x2, int *nr, int *nc)
-{
- double dis, q;
- if( feq(a,0.0) ){
- *nc = 0;
- if( feq(b,0.0) ){
- *nr = 0; *x1 = 0.0;
- }
- else{
- *nr = 1; *x1 = -c / b;
- }
- *x2 = *x1;
- }
- else{
- dis = b*b - 4.0 * a * c;
- if( dis > 0.0 ){
- *nr = 2; *nc = 0;
- dis = sqrt(dis);
- if( b < 0.0 ) dis = -dis;
- q = -0.5 * (b + dis);
- *x1 = q/a; *x2 = c/q;
- if(*x1 > *x2){
- q = *x1; *x1 = *x2; *x2 = q;
- }
- }
- else if( feq(dis,0.0) ){
- *nr = 1; *nc = 0; *x1 = - 0.5 * b / a; *x2 = *x1;
- }
- else{
- *nr = 0; *nc = 2; *x1 = - 0.5 * b / a; *x2 = 0.5 * sqrt(-dis) / a;
- }
- }
-}
-
-static void rgs_mark(GFilt g, Scan *scanlist,
- int sno, int flag, int type, int xval, int yval )
-{
- Scan scanmark, mark;
- /* since yval is used as an index, make sure its within limits */
- if(yval < g->y0) yval = g->y0;
- if(yval > g->y1) yval = g->y1;
- mark = (Scan)calloc(1, sizeof(ScanRec));
- mark->x = xval;
- /* sanity check */
- if( !scanlist ) return;
- /* starts are installed at back of list for given x */
- if( !scanlist[yval] || ((scanlist[yval])->x > xval) ){
- mark->next = scanlist[yval];
- scanlist[yval] = mark;
- } else {
- scanmark = scanlist[yval];
- while( scanmark->next && ((scanmark->next)->x < xval) )
- scanmark = scanmark->next;
- mark->next = scanmark->next;
- scanmark->next = mark;
- }
- markx(g, sno, flag, type, xval, yval);
-}
-
-static void rgs_segment(GFilt g, Scan *scanlist, int width, int height,
- int sno, int flag, int type,
- double x1, double y1, double x2, double y2)
-{
- int ystart, ystop, yval, xval;
- double invslope, xoffset;
-
- ystart = PIXINCL(y1);
- if( ystart < 1 ) ystart = 1;
- /* note: PIXINCL(stop) is 1st pixel not counted */
- ystop = PIXINCL(y2) - 1;
- if( ystop > height ) ystop = height;
- /* ignore segment if there is no positive slope in integer coords */
- if( (ystart > ystop) || (ystop < 1) )
- return;
- /* use inverse slope (run/rise) to get x given y with a multiply */
- invslope = (x1 - x2) / (y1 - y2);
- xoffset = x1 + ((ystart - y1) * invslope);
- for(yval=ystart; yval<=ystop; yval++){
- xval = PIXINCL(xoffset);
- /* clip line to edges of image area (actually bend line) */
- if(xval < 1) xval = 1;
- if(xval > width) xval = width + 1;
- rgs_mark(g, scanlist, sno, flag, type, xval, yval);
- xoffset = xoffset + invslope;
- }
-}
-
-static void _polygoni(GFilt g, int qt, int UNUSED(rno), int sno, int flag,
- int type, double *vx, double *vy, int count)
-{
- int i, j;
- double xlo, xhi;
- double ylo, yhi;
-
-#ifdef ALREADY_DONE
- /* divide by block factor to get real endpoints */
- for(i=0; i<count; i++){
- vx[i] = (vx[i] - g->xmin)/g->block + 1.0;
- vy[i] = (vy[i] - g->ymin)/g->block + 1.0;
- }
-#endif
- /* find the limits */
- xlo = vx[0];
- xhi = xlo;
- ylo = vy[0];
- yhi = ylo;
- for(i=0; i<count; i++){
- if(vx[i] > xhi) xhi = vx[i];
- if(vx[i] < xlo) xlo = vx[i];
- if(vy[i] > yhi) yhi = vy[i];
- if(vy[i] < ylo) ylo = vy[i];
- }
- if( qt && (sno > 1) ){
- g->shapes[sno].ystart = g->shapes[sno-1].ystart;
- g->shapes[sno].ystop = g->shapes[sno-1].ystop;
- }
- else{
- g->shapes[sno].ystart = max(g->y0,PIXINCL(ylo));
- g->shapes[sno].ystop = min(g->y1,PIXINCL(yhi) - 1);
- }
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- marky(g, sno, flag, type);
-
- /* mark all horizontal segment crossings */
- /* start with segment between last and first point */
- j = count-1;
- for(i=0; i<count; i++){
- /* make segments always run from lower y to higher y */
- if(vy[i] > vy[j]){
- rgs_segment(g, g->shapes[sno].scanlist, g->x1, g->y1,
- sno, flag, type, vx[j], vy[j], vx[i], vy[i]);
- }
- else{
- rgs_segment(g, g->shapes[sno].scanlist, g->x1, g->y1,
- sno, flag, type, vx[i], vy[i], vx[j], vy[j]);
- }
- j = i;
- }
-}
-
-static int corner_vertex(int index, int width, int height,
- double *x, double *y)
-{
- switch (index) {
- case 1:
- *x = 0.0;
- *y = height + 1;
- break;
- case 2:
- *x = 0.0;
- *y = 0.0;
- break;
- case 3:
- *x = width + 1;
- *y = 0.0;
- break;
- case 4:
- *x = width + 1;
- *y = height + 1;
- default:
- break;
- }
- index = index + 1;
- if(index > 4) index = 1;
- return(index);
-}
-
-static int pie_intercept(int width, int height, double xcen, double ycen,
- double angle, double *xcept, double *ycept)
-{
- double angl, slope; /* l: angle and slope of ray */
- angl = angle;
- /* put angles in normal range */
- while (angl < 0.0)
- angl = angl + 360.0;
- while (angl >= 360.0)
- angl = angl - 360.0;
- /* check for a horizontal angle */
-#if USE_ASTRO_ANGLE
- if(fabs(angl - 90.0) < SMALL_NUMBER) {
-#else
- if(fabs(angl - 180.0) < SMALL_NUMBER) {
-#endif
- *xcept = 0.0;
- *ycept = ycen;
- return(2);
- }
-#if USE_ASTRO_ANGLE
- if(fabs(angl - 270.0) < SMALL_NUMBER) {
-#else
- if(fabs(angl - 0.0) < SMALL_NUMBER) {
-#endif
- *xcept = width + 1;
- *ycept = ycen;
- return(4);
- }
-#if USE_ASTRO_ANGLE
- /* convert to a Cartesian angle */
- angl = angl + 90.0;
-#endif
- if(angl >= 360.0)
- angl = angl - 360.0;
- if(angl < 180.0) {
- *ycept = height + 1;
- /* rule out vertical line */
- if(fabs(angl - 90.0) < SMALL_NUMBER) {
- *xcept = xcen;
- return(1);
- }
- } else {
- *ycept = 0.0;
- /* rule out vertical line */
- if(fabs(angl - 270.0) < SMALL_NUMBER) {
- *xcept = xcen;
- return(3);
- }
- }
- /* convert to radians */
- angl = (angl / 180.0) * M_PI;
- /* calculate slope */
- slope = tan(angl);
- /* calculate intercept with designated y edge */
- *xcept = xcen + ((*ycept - ycen) / slope);
- if(*xcept < 0) {
- *ycept = (ycen - (xcen * slope));
- *xcept = 0.0;
- return(2);
- } else if(*xcept > (width + 1)) {
- *ycept = (ycen + ((width + 1 - xcen) * slope));
- *xcept = width + 1;
- return(4);
- } else {
- if(*ycept < height)
- return(3);
- else
- return(1);
- }
-}
-
-void _impiei(GFilt g, int qt, int rno, int sno, int flag, int type,
- double UNUSED(x), double UNUSED(y),
- double xcen, double ycen, double angle1, double angle2)
-{
- int width, height; /* l: image mask width and height */
- double sweep; /* l: sweep between cut angles */
- double vx[7], vy[7]; /* l: arrays of vertices for polygon */
- int count; /* l: number of polygon vertices */
- int intrcpt1, intrcpt2; /* l: side intercepted by each cut */
- double x2, y2; /* l: coordinates of second intercept */
-
- /* NB: do not use x and y variables, they have bogus values */
- /* divide by block factor to get "real" parameters */
- xcen = (xcen - g->xmin)/g->block + 1.0;
- ycen = (ycen - g->ymin)/g->block + 1.0;
- /* temps */
- width = g->x1;
- height = g->y1;
- /* start listing vertices of polygon */
- vx[0] = xcen;
- vy[0] = ycen;
- sweep = angle2 - angle1;
- /* if sweep is too small to be noticed, don't bother */
- if(fabs(sweep) < SMALL_NUMBER)
- return;
- if (sweep < 0.0) sweep = sweep + 360.0;
- intrcpt1 = pie_intercept(width, height, xcen, ycen, angle1,
- &(vx[1]), &(vy[1]));
- intrcpt2 = pie_intercept(width, height, xcen, ycen, angle2,
- &x2, &y2);
- count = 2;
- /* if angles intercept same side and slice is between them, no corners */
- /* else, mark corners until reaching side with second angle intercept */
- if((intrcpt1 != intrcpt2) || (sweep > 180.0)){
- do{
- intrcpt1 = corner_vertex(intrcpt1, width, height,
- &(vx[count]), &(vy[count]));
- count = count + 1;
- }while(intrcpt1 != intrcpt2);
- }
- vx[count] = x2;
- vy[count] = y2;
- count++;
- _polygoni(g, qt, rno, sno, flag, type, vx, vy, count);
-}
-
-/* ***************************** shapes ********************************** */
-
-void imannulusi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double iradius, double oradius)
-{
- int yy;
- double dval;
- double xoff, yoff;
- Scan *scanlist;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- if( iradius == 0 ){
- imcirclei(g, rno, sno, flag, type, x, y, xcen, ycen, oradius);
- return;
- }
- /* divide by block factor to get "real" parameters */
- xcen = (xcen - g->xmin)/g->block + 1.0;
- ycen = (ycen - g->ymin)/g->block + 1.0;
- iradius /= (double)g->block;
- oradius /= (double)g->block;
- /* set y limits */
- if( PIXSTART(ycen - oradius) < PIXSTOP(ycen + oradius) ){
- g->shapes[sno].ystart = max(g->y0,PIXSTART(ycen - oradius));
- g->shapes[sno].ystop = min(g->y1,PIXSTOP(ycen + oradius));
- }
- else{
- g->shapes[sno].ystart = min(g->y1,PIXSTOP(ycen + oradius));
- g->shapes[sno].ystop = max(g->y0,PIXSTART(ycen - oradius));
- }
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- scanlist = g->shapes[sno].scanlist;
- marky(g, sno, flag, type);
- /* calculate start/stop values for each y line */
- for(yy=g->shapes[sno].ystart; yy<=g->shapes[sno].ystop; yy++){
- yoff = PIXCEN(yy) - ycen;
- if( (dval=(oradius * oradius) - (yoff * yoff)) > 0.0 ){
- xoff = sqrt(dval);
- if( PIXSTART(xcen - xoff) <= PIXSTOP(xcen + xoff) ){
- rgs_mark(g, scanlist, sno, flag, type, PIXSTART(xcen - xoff), yy);
- rgs_mark(g, scanlist, sno, flag, type, PIXSTOP(xcen + xoff), yy);
- }
- if( (dval=(iradius * iradius) - (yoff * yoff)) > 0.0 ){
- xoff = sqrt(dval);
- if( PIXSTART(xcen - xoff) <= PIXSTOP(xcen + xoff) ){
- rgs_mark(g, scanlist, sno, flag, type, PIXSTART(xcen - xoff), yy);
- rgs_mark(g, scanlist, sno, flag, type, PIXSTOP(xcen + xoff), yy);
- }
- }
- }
- }
-}
-
-int imannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double iradius, double oradius)
-{
- Scan scan;
-
- if( iradius == 0 ){
- return(imcircle(g, rno, sno, flag, type, x, y, xcen, ycen, oradius));
- }
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- if( flag ){
- if(y < g->shapes[sno].ystart ) return 0;
- if(y > g->shapes[sno].ystop ) return 0;
- }
- scan = g->shapes[sno].scanlist[(int)y];
- if( (scan &&
- ((y >= g->shapes[sno].ystart) && (y <= g->shapes[sno].ystop)) &&
- (scan->next->next ?
- (((x >= scan->x) && (x <= scan->next->next->next->x)) &&
- !((x >= scan->next->x) && (x <= scan->next->next->x))) :
- ((x >= scan->x) && (x <= scan->next->x))))
- ==flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-void imboxi(GFilt g, int rno, int sno, int flag, int type,
- double UNUSED(x), double UNUSED(y),
- double xcen, double ycen, double xwidth, double yheight,
- double angle)
-{
- double angl; /* l: Cartesian angle in radians */
- double half_width, half_height;/* l: radii (1/2 width and height) */
- double cosangl, sinangl; /* l: sine, cosine of the Cartesian angle */
- double hw_cos, hw_sin; /* l: products of half_width with sin, cos */
- double hh_cos, hh_sin; /* l: products of half_height with sin, cos */
- double cornerx[4], cornery[4]; /* l: arrays of x and y coords of 4 corners */
-
- /* NB: do not use x and y variables, they have bogus values */
- if( (xwidth == 0) && (yheight==0) ){
- return;
- }
- /* divide by block factor to get "real" parameters */
- xcen = (xcen - g->xmin)/g->block + 1.0;
- ycen = (ycen - g->ymin)/g->block + 1.0;
- xwidth /= (double)g->block;
- yheight /= (double)g->block;
-#if USE_ASTRO_ANGLE
- /* convert to a Cartesian angle; save angle for use in multi or slices */
- angl = angle + 90.0;
-#else
- angl = angle;
-#endif
- while (angl >= 360.0) angl = angl - 360.0;
- /* convert to radians */
- angl = (angl / 180.0) * M_PI;
- sinangl = sin (angl);
- cosangl = cos (angl);
-#if USE_ASTRO_ANGLE
- /* since we rotate by 90.0 degrees to get from astro angle to cartesian, */
- /* we also need to switch the width and height. we do this secretly so */
- /* that the display will turn out right, by doing it in the half terms */
- half_width = yheight / 2.0;
- half_height = xwidth / 2.0;
-#else
- half_width = xwidth / 2.0;
- half_height = yheight / 2.0;
-#endif
- hw_cos = half_width * cosangl;
- hw_sin = half_width * sinangl;
- hh_cos = half_height * cosangl;
- hh_sin = half_height * sinangl;
-#if USE_ASTRO_ANGLE
- cornerx[0] = xcen - hw_cos - hh_sin;
- cornery[0] = ycen - hw_sin + hh_cos;
- cornerx[1] = xcen + hw_cos - hh_sin;
- cornery[1] = ycen + hw_sin + hh_cos;
- cornerx[2] = xcen + hw_cos + hh_sin;
- cornery[2] = ycen + hw_sin - hh_cos;
- cornerx[3] = xcen - hw_cos + hh_sin;
- cornery[3] = ycen - hw_sin - hh_cos;
-#else
- cornerx[0] = xcen - hw_cos + hh_sin;
- cornery[0] = ycen - hh_cos - hw_sin;
- cornerx[1] = xcen - hw_cos - hh_sin;
- cornery[1] = ycen + hh_cos - hw_sin;
- cornerx[2] = xcen + hw_cos - hh_sin;
- cornery[2] = ycen + hh_cos + hw_sin;
- cornerx[3] = xcen + hw_cos + hh_sin;
- cornery[3] = ycen - hh_cos + hw_sin;
-#endif
- _polygoni(g, 0, rno, sno, flag, type, cornerx, cornery, 4);
-}
-
-int imbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double UNUSED(xcen), double UNUSED(ycen),
- double xwidth, double yheight,
- double UNUSED(angle))
-{
- if( (xwidth == 0) && (yheight==0) ){
- return(!flag);
- }
- return impolygon(g, rno, sno, flag, type, x, y);
-}
-
-void imcirclei(GFilt g, int UNUSED(rno), int sno, int flag, int type,
- double UNUSED(x), double UNUSED(y),
- double xcen, double ycen, double radius)
-{
- int yy;
- double dval;
- double xoff, yoff;
- Scan *scanlist;
-
- /* NB: do not use x and y variables, they have bogus values */
- if( radius == 0 ){
- return;
- }
- /* divide by block factor to get "real" parameters */
- xcen = (xcen - g->xmin)/g->block + 1.0;
- ycen = (ycen - g->ymin)/g->block + 1.0;
- radius /= (double)g->block;
- /* set y limits */
- if( PIXSTART(ycen - radius) < PIXSTOP(ycen + radius) ){
- g->shapes[sno].ystart = max(g->y0,PIXSTART(ycen - radius));
- g->shapes[sno].ystop = min(g->y1,PIXSTOP(ycen + radius));
- }
- else{
- g->shapes[sno].ystart = min(g->y1,PIXSTOP(ycen + radius));
- g->shapes[sno].ystop = max(g->y0,PIXSTART(ycen - radius));
- }
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- scanlist = g->shapes[sno].scanlist;
- marky(g, sno, flag, type);
- /* calculate start/stop values for each y line */
- for(yy=g->shapes[sno].ystart; yy<=g->shapes[sno].ystop; yy++){
- yoff = PIXCEN(yy) - ycen;
- if( (dval=(radius * radius) - (yoff * yoff))>=0.0 ){
- xoff = sqrt(dval);
- if( PIXSTART(xcen - xoff) <= PIXSTOP(xcen + xoff) ){
- rgs_mark(g, scanlist, sno, flag, type, PIXSTART(xcen - xoff), yy);
- rgs_mark(g, scanlist, sno, flag, type, PIXSTOP(xcen + xoff), yy);
- }
- }
- }
-}
-
-int imcircle(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y,
- double UNUSED(xcen), double UNUSED(ycen), double radius)
-{
- Scan scan;
-
- if( radius == 0 ){
- return(!flag);
- }
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- if( flag ){
- if(y < g->shapes[sno].ystart ) return 0;
- if(y > g->shapes[sno].ystop ) return 0;
- }
- scan = g->shapes[sno].scanlist[(int)y];
- if( (scan &&
- ((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- ((x >= scan->x) && (x <= (scan->next)->x))) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else{
- return 0;
- }
-}
-
-void imellipsei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double xrad, double yrad,
- double angle)
-{
- int yy;
- int nr, nc;
- double yhi;
- double yoff;
- double xboff, xfoff;
- double angl;
- double sinangl, cosangl;
- double cossq, sinsq, xradsq, yradsq;
- double a, b_partial, c_partial;
- double b, c;
- Scan *scanlist;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- if( xrad == yrad ){
- imcirclei(g, rno, sno, flag, type, x, y, xcen, ycen, xrad);
- return;
- }
- /* divide by block factor to get "real" parameters */
- xcen = (xcen - g->xmin)/g->block + 1.0;
- ycen = (ycen - g->ymin)/g->block + 1.0;
- xrad /= (double)g->block;
- yrad /= (double)g->block;
- /* set worst case limits (xrad axis parallel to vertical axis) */
-#if USE_ASTRO_ANGLE
- /* convert to a Cartesian angle; save "angle" for use by other routines */
- angl = angle + 90.0;
-#else
- angl = angle;
-#endif
- while( angl >= 360.0 )
- angl = angl - 360.0;
- /* convert to radians */
- angl = (angl / 180.0) * M_PI;
- sinangl = sin(angl);
- cosangl = cos(angl);
- /* calculate approximate y limits */
- /* choose lesser of containing rotbox and circle */
- FPU_DOUBLE
-#if USE_ASTRO_ANGLE
- yhi = fabs(sinangl * yrad) + fabs(cosangl * xrad);
-#else
- yhi = fabs(sinangl * xrad) + fabs(cosangl * yrad);
-#endif
- yhi = min(yhi, max(yrad, xrad));
- /* set y limits */
- if( PIXSTART(ycen - yhi) < PIXSTOP(ycen + yhi) ){
- g->shapes[sno].ystart = max(g->y0,PIXSTART(ycen - yhi));
- g->shapes[sno].ystop = min(g->y1,PIXSTOP(ycen + yhi));
- }
- else{
- g->shapes[sno].ystart = min(g->y1,PIXSTOP(ycen + yhi));
- g->shapes[sno].ystop = max(g->y0,PIXSTART(ycen - yhi));
- }
- FPU_RESTORE
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- scanlist = g->shapes[sno].scanlist;
- marky(g, sno, flag, type);
- /* prepare partials for quadratic equation solutions to coordinates */
- cossq = cosangl * cosangl;
- sinsq = sinangl * sinangl;
-#if USE_ASTRO_ANGLE
- /* because we rotate by 90.0 degrees to get from astro angle to */
- /* cartesian, we also need to switch the x and y axes. we do this */
- /* secretly so that the display will turn out right, by doing it in */
- /* the sq terms */
- xradsq = yrad * yrad;
- yradsq = xrad * xrad;
-#else
- xradsq = xrad * xrad;
- yradsq = yrad * yrad;
-#endif
- /* fill in as much of a,b,c as we can */
- a = (cossq / xradsq) + (sinsq / yradsq);
- b_partial = (2.0 * sinangl) * ((cosangl / xradsq) - (cosangl / yradsq));
- c_partial = (sinsq / xradsq) + (cossq / yradsq);
- /* calculate start/stop values for each y line */
- for(yy=g->shapes[sno].ystart; yy<=g->shapes[sno].ystop; yy++){
- yoff = yy - ycen;
- b = b_partial * yoff;
- c = (c_partial * yoff * yoff) - 1.0;
- /* solve quadratic */
- quadeq (a, b, c, &xboff, &xfoff, &nr, &nc);
- /* if real roots */
- if( nr != 0 ) {
- /* translate x coordinates */
- rgs_mark(g, scanlist, sno, flag, type, PIXSTART(xcen + xboff), yy);
- rgs_mark(g, scanlist, sno, flag, type, PIXSTOP(xcen + xfoff), yy);
- }
- }
-}
-
-int imellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double xrad, double yrad,
- double UNUSED(angle))
-{
- Scan scan;
-
- if( xrad == yrad ){
- return(imcircle(g, rno, sno, flag, type, x, y, xcen, ycen, xrad));
- }
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- if( flag ){
- if(y < g->shapes[sno].ystart ) return 0;
- if(y > g->shapes[sno].ystop ) return 0;
- }
- scan = g->shapes[sno].scanlist[(int)y];
- FPU_DOUBLE
- if( (scan &&
- ((y>=g->shapes[sno].ystart) && (y<=g->shapes[sno].ystop)) &&
- ((x >= scan->x) && (x <= (scan->next)->x))) == flag ){
- if( rno && flag ) g->rid = rno;
- FPU_RESTORE
- return 1;
- }
- else{
- FPU_RESTORE
- return 0;
- }
-}
-
-void imfieldi(GFilt g, int UNUSED(rno), int sno, int flag, int type,
- double UNUSED(x), double UNUSED(y))
-{
- int yy;
- Scan *scanlist;
-
- /* NB: do not use x and y variables, they have bogus values */
- g->shapes[sno].ystart = g->y0;
- g->shapes[sno].ystop = g->y1;
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- scanlist = g->shapes[sno].scanlist;
- marky(g, sno, flag, type);
- /* calculate start/stop values for each y line */
- for(yy=g->shapes[sno].ystart; yy<=g->shapes[sno].ystop; yy++){
- rgs_mark(g, scanlist, sno, flag, type, g->x0, yy);
- rgs_mark(g, scanlist, sno, flag, type, g->x1, yy);
- }
-}
-
-int imfield(GFilt g, int rno, int UNUSED(sno), int flag, int UNUSED(type),
- double UNUSED(x), double UNUSED(y))
-{
- if( flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else{
- return 0;
- }
-}
-
-void imlinei(GFilt g, int UNUSED(rno), int sno, int flag, int type,
- double UNUSED(x), double UNUSED(y),
- double x1, double y1, double x2, double y2)
-{
- double vx[2];
- double vy[2];
- int xval, yval;
- double invslope, xoffset;
-
- /* NB: do not use x and y variables, they have bogus values */
- /* divide by block factor to get "real" parameters */
- x1 = (x1 - g->xmin)/g->block + 1.0;
- y1 = (y1 - g->ymin)/g->block + 1.0;
- x2 = (x2 - g->xmin)/g->block + 1.0;
- y2 = (y2 - g->ymin)/g->block + 1.0;
- /* order by increasing y */
- if( y1 < y2 ){
- vx[0] = x1;
- vy[0] = y1;
- vx[1] = x2;
- vy[1] = y2;
- }
- else{
- vx[0] = x2;
- vy[0] = y2;
- vx[1] = x1;
- vy[1] = y1;
- }
- /* set y limits */
- g->shapes[sno].ystart = PIXNUM(vy[0]);
- g->shapes[sno].ystop = PIXNUM(vy[1]);
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- marky(g, sno, flag, type);
- if( feq(vy[0],vy[1]) ){
- rgs_mark(g, g->shapes[sno].scanlist, sno, flag, type,
- (int)min(vx[0],vx[1]), (int)vy[0]);
- rgs_mark(g, g->shapes[sno].scanlist, sno, flag, type,
- (int)max(vx[0],vx[1]), (int)vy[0]);
- }
- else{
- /* mark all horizontal segment crossings */
- invslope = (vx[0] - vx[1]) / (vy[0] - vy[1]);
- xoffset = vx[0];
- for(yval=vy[0]; yval<=vy[1]; yval++){
- xval = xoffset;
- rgs_mark(g, g->shapes[sno].scanlist, sno, flag, type, xval, yval);
- xoffset = xoffset + invslope;
- }
- }
-}
-
-int imline(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y,
- double UNUSED(x1), double UNUSED(y1),
- double UNUSED(x2), double UNUSED(y2))
-{
- Scan scan;
-
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- if( flag ){
- if(y < g->shapes[sno].ystart ) return 0;
- if(y > g->shapes[sno].ystop ) return 0;
- }
- scan = g->shapes[sno].scanlist[(int)y];
- if( (scan &&
- ((x==(int)scan->x) ||
- (scan->next&&((x>=(int)scan->x)&&(x<=(int)scan->next->x)))))==flag ) {
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-void impiei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2)
-{
- _impiei(g, 0, rno, sno, flag, type, x, y, xcen, ycen, angle1, angle2);
-}
-
-int impie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double UNUSED(xcen), double UNUSED(ycen),
- double UNUSED(angle1), double UNUSED(angle2))
-{
- return impolygon(g, rno, sno, flag, type, x, y);
-}
-
-void imqtpiei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2)
-{
- _impiei(g, 1, rno, sno, flag, type, x, y, xcen, ycen, angle1, angle2);
-}
-
-int imqtpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double UNUSED(xcen), double UNUSED(ycen),
- double UNUSED(angle1), double UNUSED(angle2))
-{
- return impolygon(g, rno, sno, flag, type, x, y);
-}
-
-void impointi(GFilt g, int UNUSED(rno), int sno, int flag, int type,
- double UNUSED(x), double UNUSED(y),
- double xcen, double ycen)
-{
- /* NB: do not use x and y variables, they have bogus values */
- /* divide by block factor to get "real" parameters */
- xcen = (xcen - g->xmin)/g->block + 1.0;
- ycen = (ycen - g->ymin)/g->block + 1.0;
- /* set y limits */
- g->shapes[sno].ystart = PIXNUM(ycen);
- g->shapes[sno].ystop = PIXNUM(ycen);
- g->shapes[sno].scanlist = (Scan *)calloc(g->y1+1, sizeof(Scan));
- marky(g, sno, flag, type);
- rgs_mark(g, g->shapes[sno].scanlist, sno, flag, type,
- PIXNUM(xcen), PIXNUM(ycen));
-}
-
-int impoint(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y,
- double UNUSED(xcen), double UNUSED(ycen))
-{
- Scan scan;
-
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- if( flag ){
- if(y < g->shapes[sno].ystart ) return 0;
- if(y > g->shapes[sno].ystop ) return 0;
- }
- scan = g->shapes[sno].scanlist[(int)y];
- if( (scan &&
- (y == (int)g->shapes[sno].ystart) &&
- (x == (int)scan->x))==flag ) {
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else
- return 0;
-}
-
-#ifdef __STDC__
-void
-impolygoni(GFilt g, int rno, int sno, int flag, int type,
- double UNUSED(x), double y, ...)
-{
- double *vx=NULL, *vy=NULL;
- int count, maxcount;
- va_list args;
- va_start(args, y);
-#else
-void impolygoni(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double *vx=NULL, *vy=NULL;
- int count, maxcount;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
-#endif
- /* NB: do not use x and y variables, they have bogus values */
- /* allocate space for x,y arguments */
- maxcount = MASKINC;
- vx = (double *)calloc(maxcount, sizeof(double));
- vy = (double *)calloc(maxcount, sizeof(double));
- /* look for x,y arguments */
- count = 0;
- while( 1 ){
- if( (count + 1) >= maxcount ){
- maxcount += MASKINC;
- vx = (double *)realloc(vx, maxcount*sizeof(double));
- vy = (double *)realloc(vy, maxcount*sizeof(double));
- }
- vx[count] = va_arg(args, double);
- vy[count] = va_arg(args, double);
- if( feq(vx[count],PSTOP) && feq(vy[count],PSTOP) )
- break;
- vx[count] = (vx[count] - g->xmin)/g->block + 1.0;
- vy[count] = (vy[count] - g->ymin)/g->block + 1.0;
- count ++;
- }
- va_end(args);
- /* realloc to actual size */
- vx = (double *)realloc(vx, count*sizeof(double));
- vy = (double *)realloc(vy, count*sizeof(double));
- /* call the common routine */
- _polygoni(g, 0, rno, sno, flag, type, vx, vy, count);
- if( vx ) free(vx);
- if( vy ) free(vy);
-}
-
-#ifdef __STDC__
-int
-impolygon(GFilt g, int rno, int sno, int flag, int UNUSED(type),
- double x, double y, ...)
-{
- int crossings;
- Scan scan;
- va_list args;
- va_start(args, y);
-#else
-int impolygon(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- int crossings;
- Scan scan;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
-#endif
- va_end(args);
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- if( flag ){
- if(y < g->shapes[sno].ystart ) return 0;
- if(y > g->shapes[sno].ystop ) return 0;
- }
- /* no initialization of x for this row, just jump right in */
- if( (y>=g->shapes[sno].ystart)&&(y<=g->shapes[sno].ystop) ){
- crossings = 0;
- for(scan=g->shapes[sno].scanlist[(int)y]; scan; scan=scan->next){
- if( x >= scan->x )
- crossings++;
- else
- break;
- }
- if( (crossings%2) == flag ){
- if( rno && flag ) g->rid = rno;
- return 1;
- }
- else{
- return 0;
- }
- }
- else{
- return !flag;
- }
-}
-
-void imnannulusi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lo, double hi, int n)
-{
- int i;
- int xsno;
- double dinc;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- dinc = (hi - lo)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init all shapes */
- imannulusi(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi);
- for(i=0; i<n; i++){
- imannulusi(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc));
- }
-}
-
-void imnboxi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double ang)
-{
- int i;
- int xsno;
- double dincx;
- double dincy;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- dincx = (hix - lox)/n;
- dincy = (hiy - loy)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init all shapes */
- imboxi(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang);
- imboxi(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang);
- for(i=0; i<n; i++){
- imboxi(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang);
- }
-}
-
-void imnellipsei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double ang)
-{
- int i;
- int xsno;
- double dincx;
- double dincy;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- dincx = (hix - lox)/n;
- dincy = (hiy - loy)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init all shapes */
- imellipsei(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang);
- imellipsei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang);
- for(i=0; i<n; i++){
- imellipsei(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang);
- }
-}
-
-void imnpiei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lo, double hi, int n)
-{
- int i;
- int xsno;
- double dinc;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- while( lo > hi ) lo -= 360.0;
- dinc = (hi - lo)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init all shapes */
- impiei(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi);
- for(i=0; i<n; i++){
- impiei(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc));
- }
-}
-
-void impandai(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double radlo, double radhi, double radn)
-{
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, rinc;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- while( anglo > anghi ) anglo -= 360.0;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- rinc = (radhi - radlo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init pies and annuli */
- imannulusi(g, 0, xsno, flag, type, x, y, xcen, ycen, radlo, radhi);
- imqtpiei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi);
- for(a=0; a<ahi; a++){
- for(r=0; r<rhi; r++){
- imannulusi(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, radlo+(r*rinc), radlo+((r+1)*rinc));
- imqtpiei(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc));
- n++;
- }
- }
-}
-
-void imbpandai(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double xlo, double ylo, double xhi, double yhi, double radn,
- double ang)
-{
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, xinc, yinc;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- anglo += ang;
- anghi += ang;
- while( anglo > anghi ) anglo -= 360.0;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- xinc = (xhi - xlo)/radn;
- yinc = (yhi - ylo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init pies and ellipses */
- imboxi(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi, ang);
- imqtpiei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi);
- imboxi(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo, ang);
- for(a=0; a<ahi; a++){
- for(r=1; r<=rhi; r++){
- imboxi(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang);
- imqtpiei(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc));
- n++;
- }
- }
-}
-
-void imepandai(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double xlo, double ylo, double xhi, double yhi, double radn,
- double ang)
-{
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, xinc, yinc;
-
- /* NB: do not use x and y variables, they have bogus values */
-
- /* get limits */
- anglo += ang;
- anghi += ang;
- while( anglo > anghi ) anglo -= 360.0;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- xinc = (xhi - xlo)/radn;
- yinc = (yhi - ylo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- /* init pies and ellipses */
- imellipsei(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi, ang);
- imqtpiei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi);
- imellipsei(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo, ang);
- for(a=0; a<ahi; a++){
- for(r=1; r<=rhi; r++){
- imellipsei(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang);
- imqtpiei(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc));
- n++;
- }
- }
-}
-
-/* accelerator regions -- lower and upper limits are given for n regions */
-
-int imnannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lo, double hi, int n)
-{
- int i;
- int xsno;
- double dinc;
-
- /* get limits */
- dinc = (hi - lo)/(double)n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( imannulus(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc)) ){
- return(1);
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, lo, hi) ){
- return(1);
- }
- return(0);
- }
-}
-
-int imnbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double ang)
-{
- int i;
- int xsno;
- double dincx;
- double dincy;
-
- /* get limits */
- dincx = (hix - lox)/n;
- dincy = (hiy - loy)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imbox(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( imbox(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( imbox(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imbox(g, 0, xsno, 1, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- if( imbox(g, 0, xsno+1, 1, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-int imnellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double ang)
-{
- int i;
- int xsno;
- double dincx;
- double dincy;
-
- /* get limits */
- dincx = (hix - lox)/n;
- dincy = (hiy - loy)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( imellipse(g, 0, xsno+1, flag, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( imellipse(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lox+((i+1)*dincx), loy+((i+1)*dincy), ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, hix, hiy, ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- if( imellipse(g, 0, xsno+1, 1, type, x, y, xcen, ycen, lox, loy, ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-int imnpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen,
- double lo, double hi, int n)
-{
- int i;
- int xsno;
- double dinc;
-
- /* get limits */
- while( lo > hi ) lo -= 360.0;
- dinc = (hi - lo)/n;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* check limits */
- if( !impie(g, 0, xsno, flag, type, x, y, xcen, ycen, lo, hi) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( impie(g, rno+i, sno+i, flag, type, x, y,
- xcen, ycen, lo+(i*dinc), lo+((i+1)*dinc)) ){
- return(1);
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !impie(g, 0, xsno, 1, type, x, y, xcen, ycen, lo, hi) ){
- return(1);
- }
- return(0);
- }
-}
-
-int impanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double radlo, double radhi, double radn)
-{
-
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, rinc;
-
- /* get limits */
- while( anglo > anghi ) anglo -= 360.0;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- rinc = (radhi - radlo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, radlo, radhi) ||
- !impie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(a=1; a<=ahi; a++){
- for(r=1; r<=rhi; r++){
- if( imannulus(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, radlo+((r-1)*rinc), radlo+(r*rinc)) &&
- impie(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+((a-1)*ainc), anglo+(a*ainc)) ){
- return(1);
- }
- n++;
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, radlo, radhi) )
- return(1);
- else if( !impie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){
- return(1);
- }
- else{
- return(0);
- }
- }
-}
-
-int imbpanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double xlo, double ylo, double xhi, double yhi, double radn,
- double ang)
-{
-
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, xinc, yinc;
-
- /* get limits */
- anglo += ang;
- anghi += ang;
- while( anglo > anghi ) anglo -= 360.0;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- xinc = (xhi - xlo)/radn;
- yinc = (yhi - ylo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imbox(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi,
- ang) ){
- return(0);
- }
- /* but if its in the inner region we lose */
- else if( imbox(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo,
- ang) ){
- return(0);
- }
- /* its in the box .. must also be in the pie */
- else if( !impie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi)){
- return(0);
- }
- /* look through all of them to find the right one */
- for(a=0; a<ahi; a++){
- for(r=1; r<=rhi; r++){
- if( imbox(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang) &&
- imqtpie(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc)) ){
- return(1);
- }
- n++;
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imbox(g, 0, xsno, 1, type, x, y, xcen, ycen, xhi, yhi, ang) )
- return(1);
- /* if its in the inner region we win */
- else if( !imbox(g, 0, xsno+2, 1, type, x, y, xcen, ycen, xlo, ylo,
- ang) )
- return(1);
- /* if its not in the pie, we win */
- else if( !impie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){
- return(1);
- }
- else{
- return(0);
- }
- }
-}
-
-int imepanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double xlo, double ylo, double xhi, double yhi, double radn,
- double ang)
-{
-
- int a, r;
- int ahi, rhi;
- int xsno;
- int n=0;
- double ainc, xinc, yinc;
-
- /* get limits */
- anglo += ang;
- anghi += ang;
- while( anglo > anghi ) anglo -= 360.0;
- ainc = (anghi - anglo)/angn;
- ahi = (int)angn;
- xinc = (xhi - xlo)/radn;
- yinc = (yhi - ylo)/radn;
- rhi = (int)radn;
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, xhi, yhi,
- ang) ){
- return(0);
- }
- /* but if its in the inner region we lose */
- else if( imellipse(g, 0, xsno+2, flag, type, x, y, xcen, ycen, xlo, ylo,
- ang) ){
- return(0);
- }
- /* its in the ellipse .. must also be in the pie */
- else if( !impie(g, 0, xsno+1, flag, type, x, y, xcen, ycen, anglo, anghi)){
- return(0);
- }
- /* look through all of them to find the right one */
- for(a=0; a<ahi; a++){
- for(r=1; r<=rhi; r++){
- if( imellipse(g, rno+n, sno+(2*n), flag, type, x, y,
- xcen, ycen, xlo+(r*xinc), ylo+(r*yinc), ang) &&
- imqtpie(g, rno+n, sno+(2*n+1), flag, type, x, y,
- xcen, ycen, anglo+(a*ainc), anglo+((a+1)*ainc)) ){
- return(1);
- }
- n++;
- }
- }
- return(0);
- }
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, xhi, yhi, ang) )
- return(1);
- /* if its in the inner region we win */
- else if( !imellipse(g, 0, xsno+2, 1, type, x, y, xcen, ycen, xlo, ylo,
- ang) )
- return(1);
- /* if its not in the pie, we win */
- else if( !impie(g, 0, xsno+1, 1, type, x, y, xcen, ycen, anglo, anghi) ){
- return(1);
- }
- else{
- return(0);
- }
- }
-}
-
-#ifdef __STDC__
-void
-imvannulusi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvannulusi(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* this should be impossible ... */
- if( n == 2 ){
- imannulusi(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1]);
- return;
- }
- imannulusi(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]);
- for(i=0; i<(n-1); i++){
- imannulusi(g, rno+i, sno+i, flag, type, x, y, xcen, ycen, xv[i], xv[i+1]);
- }
-}
-
-#ifdef __STDC__
-void
-imvboxi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double ang;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvboxi(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- ang = xv[--n];
- /* this should be impossible ... */
- if( n == 2 ){
- imboxi(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang);
- return;
- }
- imboxi(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1], ang);
- imboxi(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang);
- for(i=2, j=0; i<n; i+=2, j++){
- imboxi(g, rno+j, sno+j, flag, type, x, y, xcen, ycen, xv[i], xv[i+1], ang);
- }
-}
-
-#ifdef __STDC__
-void
-imvellipsei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double ang;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvellipsei(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- ang = xv[--n];
- /* this should be impossible ... */
- if( n == 2 ){
- imellipsei(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang);
- return;
- }
- imellipsei(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1], ang);
- imellipsei(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang);
- for(i=2, j=0; i<n; i+=2, j++){
- imellipsei(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1], ang);
- }
-}
-
-#ifdef __STDC__
-void
-imvpiei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvpiei(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* this should be impossible ... */
- if( n == 2 ){
- impiei(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1]);
- return;
- }
- impiei(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]);
- for(i=0; i<(n-1); i++){
- impiei(g, rno+i, sno+i, flag, type, x, y, xcen, ycen, xv[i], xv[i+1]);
- }
-}
-
-#ifdef __STDC__
-void
-imvpointi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, y);
-#else
-int imvpointi(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- for(i=0, j=0; i<n; i+=2, j++){
- impointi(g, rno+j, sno+j, flag, type, x, y, xv[i], xv[i+1]);
- }
-}
-
-/* varargs regions -- a series of lower and upper limits is specified */
-
-#ifdef __STDC__
-int
-imvannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvannulus(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double *xv;
- int i, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* this should be impossible ... */
- if( n == 2 ){
- return(imannulus(g, rno, sno, flag, type, x, y, xcen, ycen, xv[0], xv[1]));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imannulus(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( imannulus(g, rno+i, sno+i, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1]) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imannulus(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(1);
- }
- return(0);
- }
-}
-
-#ifdef __STDC__
-int
-imvbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double ang;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvbox(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- ang = xv[--n];
- /* this should be impossible ... */
- if( n == 2 ){
- return(imbox(g, rno, sno, flag, type, x, y,
- xcen, ycen, xv[0], xv[1], ang));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imbox(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1],
- ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( imbox(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=2, j=0; i<n; i+=2, j++){
- if( imbox(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1], ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we win ... */
- if( !imbox(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[n-2], xv[n-1], ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- else if( imbox(g, 0, xsno+1, 1, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-#ifdef __STDC__
-int
-imvellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double ang;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvellipse(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double ang;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- ang = xv[--n];
- /* this should be impossible ... */
- if( n == 2 ){
- return(imellipse(g, rno, sno, flag, type, x, y,
- xcen, ycen, xv[0], xv[1], ang));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !imellipse(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[n-2], xv[n-1],
- ang) ){
- return(0);
- }
- /* if its in the inner region we lose */
- if( imellipse(g, 0, xsno+1, flag, type, x, y, xcen, ycen, xv[0], xv[1],
- ang) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=2, j=0; i<n; i+=2, j++){
- if( imellipse(g, rno+j, sno+j, flag, type, x, y, xcen, ycen,
- xv[i], xv[i+1], ang) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we lose ... */
- if( !imellipse(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[n-2], xv[n-1],
- ang) ){
- return(1);
- }
- /* if its in the inner region we win */
- if( imellipse(g, 0, xsno+1, 1, type, x, y, xcen, ycen, xv[0], xv[1], ang) ){
- return(1);
- }
- return(0);
- }
-}
-
-#ifdef __STDC__
-int
-imvpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...)
-{
- int i, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, ycen);
-#else
-int imvpie(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double xcen, ycen;
- double *xv;
- int i, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
- xcen = va_arg(args, double);
- ycen = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* this should be impossible ... */
- if( n == 2 ){
- return(impie(g, rno, sno, flag, type, x, y,
- xcen, ycen, xv[0], xv[1]));
- }
- if( flag ){
- /* if its not somewhere inside the entire region we lose ... */
- if( !impie(g, 0, xsno, flag, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(0);
- }
- /* look through all of them to find the right one */
- for(i=0; i<n; i++){
- if( impie(g, rno+i, sno+i, flag, type, x, y, xcen, ycen, xv[i], xv[i+1]) ){
- return(1);
- }
- }
- return(0);
- }
- /* for excludes, we have to check that we are not in any of them */
- else{
- /* if its not somewhere inside the entire region we lose ... */
- if( !impie(g, 0, xsno, 1, type, x, y, xcen, ycen, xv[0], xv[n-1]) ){
- return(1);
- }
- return(1);
- }
-}
-
-#ifdef __STDC__
-int
-imvpoint(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, ...)
-{
- int i, j, n;
- int maxpts;
- int xsno;
- double *xv;
- va_list args;
- va_start(args, y);
-#else
-int imvpoint(va_alist) va_dcl
-{
- GFilt g;
- int rno, sno, flag, type;
- double x, y;
- double *xv;
- int i, j, n;
- int maxpts;
- int xsno;
- va_list args;
- va_start(args);
- g = va_arg(args, GFilt);
- rno = va_arg(args, int);
- sno = va_arg(args, int);
- flag = va_arg(args, int);
- type = va_arg(args, int);
- x = va_arg(args, double);
- y = va_arg(args, double);
-#endif
- xsno = (g->nshapes+1)+((sno-1)*XSNO);
- if( !g->shapes[xsno].xv ){
- maxpts = MASKINC;
- g->shapes[xsno].xv = (double *)calloc(maxpts, sizeof(double));
- g->shapes[xsno].nv = 0;
- while( 1 ){
- if( g->shapes[xsno].nv >= maxpts ){
- maxpts += MASKINC;
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- maxpts*sizeof(double));
- }
- g->shapes[xsno].xv[g->shapes[xsno].nv] = va_arg(args, double);
- if( feq(g->shapes[xsno].xv[g->shapes[xsno].nv],PSTOP) &&
- feq(g->shapes[xsno].xv[g->shapes[xsno].nv-1],PSTOP) ){
- g->shapes[xsno].nv--;
- break;
- }
- g->shapes[xsno].nv++;
- }
- va_end(args);
- g->shapes[xsno].xv = (double *)realloc(g->shapes[xsno].xv,
- g->shapes[xsno].nv*sizeof(double));
- }
- n = g->shapes[xsno].nv;
- xv = g->shapes[xsno].xv;
- /* look through all of them to find the right one */
- for(i=0, j=0; i<n; i+=2, j++){
- if( impoint(g, rno+j, sno+j, flag, type, x, y, xv[i], xv[i+1]) ){
- return(1);
- }
- }
- return(0);
-}
-
-void imimagemaski(GFilt g, int UNUSED(rno), int UNUSED(sno),
- int UNUSED(flag), int UNUSED(type),
- double UNUSED(x), double UNUSED(y))
-{
- int i, j;
- int got;
- int fsize;
- int mblock;
- FilterMask xmasks;
-
- /* NB: do not use x and y variables, they have bogus values */
- /* scale mask x, y values to match the incoming image section */
- mblock = (int)(((double)((g->xmax - g->xmin + 1)/g->block)/(double)g->maskdim) + 0.5);
- if( mblock < 1 ){
- g->masks = NULL;
- g->nmask = 0;
- }
- /* copy all masks and translate x,y positions as needed */
- fsize = g->nmask * sizeof(FilterMaskRec) * mblock;
- xmasks = (FilterMask)calloc(1, fsize);
- for(got=0, i=0; i<g->nmask; i++){
- xmasks[got].region = g->masks[i].region;
- xmasks[got].y = (g->masks[i].y - 1.0) * mblock + 1.0;
- xmasks[got].xstart = (g->masks[i].xstart - 1.0) * mblock + 1.0;
- xmasks[got].xstop = (g->masks[i].xstop - 1.0) * mblock + 1.0;
- /* replicate the segment up to the block factor */
- for(j=1; j<mblock; j++){
- xmasks[got+j].region = xmasks[got].region;
- xmasks[got+j].y = xmasks[got].y+j;
- xmasks[got+j].xstart = xmasks[got].xstart;
- xmasks[got+j].xstop = xmasks[got].xstop;
- }
- got += mblock;
- }
- /* sort by y and x */
- qsort(xmasks, got, sizeof(FilterMaskRec), imagemaskcmp);
- /* we don't free previous masks, just overwrite, because they were not
- allocated in the first place */
- /* if( g->masks ) free(g->masks); */
- /* set up new mask records */
- g->masks = xmasks;
- g->nmask = got;
-
- /* now mark each y line that has a y mask value */
- for(i=0; i<got; i++){
- if( !g->ybuf[g->masks[i].y] )
- g->ybuf[g->masks[i].y] = i+1;
- }
-}
-
-int imimagemask(GFilt g, int UNUSED(rno), int UNUSED(sno),
- int UNUSED(flag), int UNUSED(type),
- double x, double y)
-{
- int i;
- int ix, iy;
-
- if( g->nmask == 0 )
- return(0);
- if( g->evsect ){
- if( g->usebinsiz ){
- x = (int)((x - g->tlminx)/g->binsizx + 1.0);
- y = (int)((y - g->tlminy)/g->binsizy + 1.0);
- }
- else{
- x = (int)((x - g->tlminx) + 1.0);
- y = (int)((y - g->tlminy) + 1.0);
- }
- x = (int)((x - g->xmin)/g->block + 1.0);
- y = (int)((y - g->ymin)/g->block + 1.0);
- if(y < g->y0) return 0;
- if(y > g->y1) return 0;
- if(x < g->x0) return 0;
- if(x > g->x1) return 0;
- }
- ix = (int)x;
- iy = (int)y;
- /* look for mask segment containing ix, iy */
- i = g->ybuf[iy];
- /* ybuf contains offset+1 of first mask record containing iy */
- if( i != 0 ){
- i--;
- for(; i<g->nmask; i++){
- if( g->masks[i].y > iy ){
- return(0);
- }
- if( (ix >= g->masks[i].xstart) && (ix <= g->masks[i].xstop) ){
- g->rid = g->masks[i].region;
- return(1);
- }
- }
- }
- return(0);
-}
-
diff --git a/funtools/filter/inc.sed b/funtools/filter/inc.sed
deleted file mode 100755
index 5318ca2..0000000
--- a/funtools/filter/inc.sed
+++ /dev/null
@@ -1,13 +0,0 @@
-:
-NAME="$1"
-sed '
-1i\
-static char *XXXX="\\n
-
-s#/\*.*\*/##g
-s/"/\\"/g
-s/\\n/\\\\n/g
-s/$/\\n/
-$a\
-\"
-' | sed "s/XXXX/$NAME/" | awk '{printf("%s", $0)};END{printf(";\n")}'
diff --git a/funtools/filter/install-sh b/funtools/filter/install-sh
deleted file mode 100755
index 36f96f3..0000000
--- a/funtools/filter/install-sh
+++ /dev/null
@@ -1,276 +0,0 @@
-#!/bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
-#
-# Copyright 1991 by the Massachusetts Institute of Technology
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission. M.I.T. makes no representations about the
-# suitability of this software for any purpose. It is provided "as is"
-# without express or implied warranty.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch. It can only install one file at a time, a restriction
-# shared with many OS's install programs.
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd=$cpprog
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd=$stripprog
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "$0: no input file specified" >&2
- exit 1
-else
- :
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d "$dst" ]; then
- instcmd=:
- chmodcmd=""
- else
- instcmd=$mkdirprog
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f "$src" ] || [ -d "$src" ]
- then
- :
- else
- echo "$0: $src does not exist" >&2
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "$0: no destination specified" >&2
- exit 1
- else
- :
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d "$dst" ]
- then
- dst=$dst/`basename "$src"`
- else
- :
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
- '
-IFS="${IFS-$defaultIFS}"
-
-oIFS=$IFS
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS=$oIFS
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp=$pathcomp$1
- shift
-
- if [ ! -d "$pathcomp" ] ;
- then
- $mkdirprog "$pathcomp"
- else
- :
- fi
-
- pathcomp=$pathcomp/
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd "$dst" &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename "$dst"`
- else
- dstfile=`basename "$dst" $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename "$dst"`
- else
- :
- fi
-
-# Make a couple of temp file names in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
- rmtmp=$dstdir/#rm.$$#
-
-# Trap to clean up temp files at exit.
-
- trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
- trap '(exit $?); exit' 1 2 13 15
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd "$src" "$dsttmp" &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
-
-# Now remove or move aside any old file at destination location. We try this
-# two ways since rm can't unlink itself on some systems and the destination
-# file might be busy for other reasons. In this case, the final cleanup
-# might fail but the new file should still install successfully.
-
-{
- if [ -f "$dstdir/$dstfile" ]
- then
- $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
- $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
- {
- echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
- (exit 1); exit
- }
- else
- :
- fi
-} &&
-
-# Now rename the file to the real destination.
-
- $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-
-fi &&
-
-# The final little trick to "correctly" pass the exit status to the exit trap.
-
-{
- (exit 0); exit
-}
diff --git a/funtools/filter/lex.filt.c b/funtools/filter/lex.filt.c
deleted file mode 100644
index 95c561a..0000000
--- a/funtools/filter/lex.filt.c
+++ /dev/null
@@ -1,8941 +0,0 @@
-#define yy_create_buffer filt_create_buffer
-#define yy_delete_buffer filt_delete_buffer
-#define yy_scan_buffer filt_scan_buffer
-#define yy_scan_string filt_scan_string
-#define yy_scan_bytes filt_scan_bytes
-#define yy_flex_debug filt_flex_debug
-#define yy_init_buffer filt_init_buffer
-#define yy_flush_buffer filt_flush_buffer
-#define yy_load_buffer_state filt_load_buffer_state
-#define yy_switch_to_buffer filt_switch_to_buffer
-#define yyin filtin
-#define yyleng filtleng
-#define yylex filtlex
-#define yyout filtout
-#define yyrestart filtrestart
-#define yytext filttext
-#define yywrap filtwrap
-
-/* A lexical scanner generated by flex*/
-
-/* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
- */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-
-#include <stdio.h>
-#include <unistd.h>
-
-
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
-#endif
-
-
-#ifdef __cplusplus
-
-#include <stdlib.h>
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-#if __STDC__
-
-#define YY_USE_PROTOS
-#define YY_USE_CONST
-
-#endif /* __STDC__ */
-#endif /* ! __cplusplus */
-
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition. This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yy_start = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state. The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yy_start - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#define YY_BUF_SIZE 16384
-
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
-extern int yyleng;
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator). This
- * avoids problems with code like:
- *
- * if ( condition_holds )
- * yyless( 5 );
- * else
- * do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- *yy_cp = yy_hold_char; \
- YY_RESTORE_YY_MORE_OFFSET \
- yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
- } \
- while ( 0 )
-
-#define unput(c) yyunput( c, filttext_ptr )
-
-/* Some routines like yy_flex_realloc() are emitted as static but are
- not called by all lexers. This generates warnings in some compilers,
- notably GCC. Arrange to suppress these. */
-#ifdef __GNUC__
-#define YY_MAY_BE_UNUSED __attribute__((unused))
-#else
-#define YY_MAY_BE_UNUSED
-#endif
-
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-typedef unsigned int yy_size_t;
-
-
-struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
-
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
-
- int yy_buffer_status;
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
- /* When an EOF's been seen but there's still some text to process
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
- * shouldn't try reading from the input source any more. We might
- * still have a bunch of tokens to match, though, because of
- * possible backing-up.
- *
- * When we actually see the EOF, we change the status to "new"
- * (via yyrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
- */
-#define YY_BUFFER_EOF_PENDING 2
- };
-
-static YY_BUFFER_STATE yy_current_buffer = 0;
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- */
-#define YY_CURRENT_BUFFER yy_current_buffer
-
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
-
-
-int yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1; /* whether we need to initialize */
-static int yy_start = 0; /* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin. A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart YY_PROTO(( FILE *input_file ));
-
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED;
-static void yy_flex_free YY_PROTO(( void * ));
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
- { \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_is_interactive = is_interactive; \
- }
-
-#define yy_set_bol(at_bol) \
- { \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_at_bol = at_bol; \
- }
-
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
-
-
-#define YY_USES_REJECT
-typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-typedef int yy_state_type;
-extern char yytext[];
-
-
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
- filttext_ptr = yy_bp; \
- yyleng = (int) (yy_cp - yy_bp); \
- yy_hold_char = *yy_cp; \
- *yy_cp = '\0'; \
- if ( yyleng >= YYLMAX ) \
- YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \
- yy_flex_strncpy( yytext, filttext_ptr, yyleng + 1 ); \
- yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 68
-#define YY_END_OF_BUFFER 69
-static yyconst short int yy_acclist[1847] =
- { 0,
- 60, 60, 60, 60, 60, 60, 60, 60, 69, 67,
- 68, 60, 67, 68, 66, 68, 67, 68, 67, 68,
- 6, 67, 68, 63, 67, 68, 63, 67, 68, 67,
- 68, 64, 67, 68, 65, 67, 68, 63, 67, 68,
- 66, 67, 68, 67, 68, 62, 67, 68, 62, 67,
- 68, 63, 67, 68, 63, 67, 68, 63, 67, 68,
- 58, 67, 68, 67, 68, 59, 67, 68,16425,16426,
- 59, 67, 68,16425,16426, 59, 67, 68,16425,16426,
- 59, 67, 68,16425,16426, 59, 67, 68,16425,16426,
- 59, 67, 68,16425,16426, 59, 67, 68,16425,16426,
-
- 59, 67, 68,16425,16426, 59, 67, 68,16425,16426,
- 59, 67, 68,16425,16426, 59, 67, 68,16425,16426,
- 59, 67, 68,16425,16426, 59, 67, 68,16425,16426,
- 59, 67, 68,16425,16426, 59, 67, 68,16425,16426,
- 59, 67, 68,16425,16426, 63, 67, 68, 53, 66,
- 68,16433,16434, 67, 68, 52, 63, 67, 68, 52,
- 63, 67, 68, 51, 65, 67, 68, 52, 63, 67,
- 68, 48, 66, 67, 68,16433,16434, 67, 68, 46,
- 62, 67, 68, 46, 62, 67, 68, 67, 68, 53,
- 66, 67, 68,16433,16434, 52, 63, 67, 68, 47,
-
- 52, 63, 67, 68, 52, 63, 67, 68, 67, 68,
- 52, 63, 67, 68, 56, 64, 67, 68, 57, 65,
- 67, 68, 55, 66, 67, 68, 60, 67, 68, 40,
- 66, 68, 67, 68, 39, 63, 67, 68, 39, 63,
- 67, 68, 36, 64, 67, 68, 38, 65, 67, 68,
- 39, 63, 67, 68, 34, 66, 67, 68, 67, 68,
- 23, 62, 67, 68,16416, 23, 62, 67, 68,16416,
- 40, 66, 67, 68, 39, 63, 67, 68, 39, 63,
- 67, 68, 39, 63, 67, 68, 33, 58, 67, 68,
- 67, 68, 59, 67, 68,16425,16426, 59, 67, 68,
-
- 16425,16426, 59, 67, 68,16425,16426, 59, 67, 68,
- 16425,16426, 59, 67, 68,16425,16426, 59, 67, 68,
- 16425,16426, 59, 67, 68,16425,16426, 59, 67, 68,
- 16425,16426, 59, 67, 68,16425,16426, 59, 67, 68,
- 16425,16426, 59, 67, 68,16425,16426, 59, 67, 68,
- 16425,16426, 59, 67, 68,16425,16426, 59, 67, 68,
- 16425,16426, 59, 67, 68,16425,16426, 59, 67, 68,
- 16425,16426, 59, 67, 68,16425,16426, 67, 68, 39,
- 63, 67, 68, 68, 17, 68, 18, 68, 16, 68,
- 19, 68, 15, 68, 9, 68, 7, 68, 9, 68,
-
- 60, 63, 61, 62, 62, 62, 62, 62, 58, 66,
- 16425,16426, 54, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
-
- 59,16425,16426, 59,16425,16426,16433,16434, 8242, 8242,
- 8242, 8242, 8242, 8242, 8242, 8242, 8242, 8242, 52, 63,
- 46, 62, 46, 62, 46, 62, 46, 62, 45, 46,
- 62, 44, 44, 53, 66,16433,16434, 60, 39, 63,
- 23, 62,16416, 23, 62,16416, 23, 62,16416, 30,
- 8224, 8224, 29, 23, 62,16416, 8224, 8224, 8224, 27,
- 24, 23, 62,16416, 25, 28, 8224, 33, 58, 40,
- 66, 33, 33, 59,16425,16426, 33, 33, 33, 33,
- 33, 59,16425,16426,16425,16426, 33, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
-
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 15, 8, 62,
- 62, 62, 58, 8234, 8234, 8233, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
-
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 2, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 8242, 8241, 8242, 8242, 8242, 8242, 8241, 8242, 8242, 8242,
- 8242, 8242, 8242, 8242, 8242, 8242, 8242, 8242, 8242, 8242,
-
- 8242, 8242, 8242, 43, 43, 46, 62, 46, 62, 46,
- 62, 44, 44, 44, 44, 27, 23, 62,16416, 23,
- 62,16416, 23, 62,16416, 33, 58, 59,16425,16426,
- 31, 8234, 31, 8234, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 2, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
-
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 35, 15, 62, 62, 8234,
- 8234, 8234, 8234, 8234, 8234, 8233, 8233,16425,16426, 54,
- 59,16425,16426,16405,16406,16425,16426, 54,16405,16406,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 2, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
-
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 4, 59,16425,16426, 59,16425,16426,
- 8242, 8242, 8241, 8242, 8241, 8241, 8242, 8242, 8242, 8242,
- 8242, 8242, 8242, 8242, 8242, 8242, 8242, 8242, 8242, 8242,
- 8242, 46, 62, 43, 43, 43, 43, 46, 62, 44,
- 44, 44, 37, 23, 62,16416, 23, 27, 62,16416,
- 23, 62,16416,16425,16426, 33, 33, 54, 33, 33,
- 33, 33, 31, 8234, 31, 8234, 31, 31, 8234, 31,
- 8234, 59,16425,16426, 59,16425,16426, 59,16425,16426,
-
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 4, 59,16425,16426,
- 59,16425,16426,16405,16406,16405,16406, 1, 8234, 8234,
- 8234, 8234, 8234, 8234, 8234, 8233, 8233, 8234, 8234, 8233,
- 59,16425,16426, 8213, 8213, 8214,16405,16406, 59,16425,
-
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 20, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 16425,16426, 54, 59,16425,16426, 8242, 8242, 8242, 8242,
- 8242, 8242, 8242, 8242, 8242, 8242, 8242, 8242, 8242, 8241,
- 8242, 8242, 8242, 8242, 8242, 8242, 8242, 8242, 8242, 8242,
- 8242, 43, 43, 43, 44, 44, 26, 26, 26, 26,
- 26, 26, 8224, 23, 62,16416, 23, 62,16416, 8234,
-
- 8234, 8233, 31, 8234, 31, 8234, 31, 8234, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 20, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 20, 8234, 8234, 8234,
- 8234, 8234, 8233, 8234, 8234, 8234, 8234, 8234, 8234, 8233,
- 8233, 59,16425,16426, 8213, 8213, 8213, 8213, 8214, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
-
- 16426, 59,16425,16426, 20,16405,16406,16425,16426, 20,
- 54,16405,16406, 59,16425,16426, 3, 59,16425,16426,
- 59,16425,16426, 59,16425,16426, 59,16425,16426,16425,
- 16426, 54,16425,16426, 10, 54, 59,16425,16426, 8242,
- 8242, 8242, 8242, 8242, 8242, 8242, 43, 43, 26, 26,
- 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 23, 62,16416, 8234, 8234,
- 8234, 8234, 8234, 8234, 8233, 8233, 31, 8234, 31, 8234,
- 59,16425,16426, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
-
- 16426, 3, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 20,16405,16406,
- 20,16405,16406, 8234, 8234, 8234, 8234, 8234, 8234, 8234,
- 8234, 8234, 8233, 59,16425,16426, 8213, 8213, 8213, 8214,
- 5, 59,16425,16426, 59,16425,16426, 59,16425,16426,
- 20,16405,16406, 59,16425,16426, 59,16425,16426, 59,
- 16425,16426,16425,16426, 12, 54, 8234, 8234, 8233, 10,
- 16425,16426, 54, 8242, 8242, 8242, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 26, 26, 8234, 8234, 8234,
- 8234, 8234, 8234, 8234, 8233, 59,16425,16426, 5, 59,
-
- 16425,16426, 59,16425,16426, 59,16425,16426, 59,16425,
- 16426, 59,16425,16426, 59,16425,16426, 8234, 8234, 8234,
- 8234, 8234, 59,16425,16426, 8213, 8213, 59,16425,16426,
- 8234, 8234, 8233, 12, 8234, 8234, 8234, 8234, 8234, 8234,
- 8233, 8233,16425,16426, 11, 54, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 8234, 8234, 8234, 8234, 8234,
- 59,16425,16426, 59,16425,16426, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 8234,
- 8234, 59,16425,16426, 8234, 8234, 8234, 8234, 8234, 8234,
- 8233, 8233, 8234, 8234, 8234, 8234, 8234, 8234, 8234, 8233,
-
- 10, 8233, 8234, 8234, 8233, 11, 26, 8234, 8234, 59,
- 16425,16426, 59,16425,16426, 8234, 8234, 8234, 8234, 8234,
- 8234, 8234, 8233, 12, 8233, 8234, 8234, 8234, 8234, 8234,
- 10, 8233, 10, 8234, 8234, 8234, 8234, 8234, 8234, 8233,
- 8233, 26, 59,16425,16426, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14,16425,16426, 54, 8234, 8234, 8234, 8234, 8234, 12,
- 8233, 12, 8234, 8234, 10, 8234, 8234, 8234, 8234, 8234,
- 8234, 8234, 8233, 11, 8233,16425,16426, 13, 54, 8234,
-
- 8234, 12, 8234, 8234, 8234, 8234, 8234, 11, 8233, 11,
- 8234, 8234, 8233, 13, 8234, 8234, 11, 8234, 8234, 8234,
- 8234, 8234, 8234, 8233, 8233, 8234, 8234, 8234, 8234, 8234,
- 8234, 8234, 8233, 13, 8233, 8234, 8234, 8234, 8234, 8234,
- 13, 8233, 13, 8234, 8234, 13
- } ;
-
-static yyconst short int yy_accept[1689] =
- { 0,
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 9,
- 9, 9, 9, 9, 9, 10, 12, 15, 17, 19,
- 21, 24, 27, 30, 32, 35, 38, 41, 44, 46,
- 49, 52, 55, 58, 61, 64, 66, 71, 76, 81,
- 86, 91, 96, 101, 106, 111, 116, 121, 126, 131,
- 136, 141, 146, 149, 154, 156, 160, 164, 168, 172,
- 178, 180, 184, 188, 190, 196, 200, 205, 209, 211,
- 215, 219, 223, 227, 230, 233, 235, 239, 243, 247,
- 251, 255, 259, 261, 266, 271, 275, 279, 283, 287,
- 291, 293, 298, 303, 308, 313, 318, 323, 328, 333,
-
- 338, 343, 348, 353, 358, 363, 368, 373, 378, 380,
- 384, 385, 387, 389, 391, 393, 395, 397, 399, 401,
- 402, 403, 403, 403, 403, 403, 403, 403, 403, 403,
- 403, 404, 404, 404, 404, 404, 404, 404, 404, 404,
- 404, 404, 405, 406, 406, 406, 406, 406, 406, 407,
- 408, 408, 408, 409, 409, 410, 410, 411, 413, 414,
- 417, 417, 417, 420, 423, 426, 429, 432, 435, 438,
- 441, 444, 447, 450, 453, 456, 459, 462, 465, 468,
- 471, 474, 477, 480, 483, 486, 489, 492, 495, 498,
- 501, 504, 507, 509, 509, 509, 509, 509, 509, 509,
-
- 510, 511, 512, 513, 514, 515, 516, 517, 518, 519,
- 521, 521, 523, 525, 527, 527, 529, 530, 530, 530,
- 532, 532, 532, 532, 532, 533, 534, 538, 539, 539,
- 541, 541, 541, 541, 544, 547, 550, 550, 550, 551,
- 552, 553, 554, 557, 557, 558, 559, 560, 560, 561,
- 561, 561, 562, 565, 566, 567, 567, 568, 570, 570,
- 572, 572, 573, 574, 577, 578, 579, 580, 580, 581,
- 585, 587, 588, 591, 594, 597, 600, 603, 606, 609,
- 612, 615, 618, 621, 624, 627, 630, 633, 636, 639,
- 642, 645, 648, 651, 654, 657, 660, 663, 666, 669,
-
- 672, 675, 678, 678, 678, 678, 679, 679, 680, 680,
- 680, 680, 680, 680, 680, 680, 680, 680, 680, 680,
- 680, 680, 680, 680, 680, 680, 680, 680, 680, 680,
- 680, 680, 680, 680, 680, 680, 680, 680, 681, 681,
- 682, 683, 683, 684, 684, 684, 684, 684, 685, 686,
- 686, 687, 687, 690, 693, 696, 699, 702, 705, 708,
- 711, 714, 717, 720, 723, 726, 729, 733, 736, 739,
- 742, 745, 748, 751, 754, 757, 760, 763, 766, 769,
- 772, 775, 778, 781, 781, 781, 781, 781, 781, 781,
- 781, 781, 781, 781, 781, 781, 781, 781, 781, 781,
-
- 782, 784, 784, 784, 785, 786, 787, 787, 787, 787,
- 787, 789, 790, 790, 791, 791, 792, 793, 794, 795,
- 796, 797, 798, 799, 800, 801, 802, 803, 804, 804,
- 804, 804, 804, 805, 806, 808, 808, 810, 812, 813,
- 814, 815, 815, 815, 816, 816, 816, 816, 816, 817,
- 817, 817, 817, 817, 817, 817, 820, 820, 820, 820,
- 820, 820, 823, 823, 823, 823, 823, 826, 826, 828,
- 828, 831, 831, 831, 831, 831, 833, 835, 838, 841,
- 844, 847, 850, 853, 856, 859, 862, 865, 868, 871,
- 874, 878, 881, 884, 887, 890, 893, 896, 899, 902,
-
- 905, 908, 911, 914, 917, 920, 923, 926, 926, 926,
- 927, 927, 928, 928, 928, 928, 928, 928, 928, 928,
- 928, 928, 928, 928, 928, 928, 928, 928, 928, 928,
- 928, 928, 928, 928, 928, 928, 928, 928, 928, 928,
- 928, 928, 929, 930, 931, 932, 933, 933, 933, 934,
- 934, 934, 934, 935, 936, 937, 938, 938, 940, 941,
- 941, 944, 948, 951, 954, 957, 960, 963, 966, 969,
- 972, 975, 978, 981, 984, 985, 988, 991, 994, 997,
- 1000, 1003, 1006, 1009, 1012, 1015, 1018, 1021, 1024, 1028,
- 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031,
-
- 1031, 1031, 1031, 1031, 1031, 1031, 1032, 1032, 1032, 1032,
- 1032, 1032, 1033, 1033, 1035, 1036, 1037, 1037, 1037, 1037,
- 1037, 1037, 1038, 1038, 1039, 1040, 1041, 1042, 1043, 1044,
- 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1052, 1054,
- 1055, 1056, 1057, 1057, 1057, 1058, 1058, 1060, 1060, 1061,
- 1061, 1062, 1063, 1063, 1063, 1064, 1064, 1067, 1067, 1067,
- 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067,
- 1071, 1074, 1076, 1076, 1077, 1078, 1079, 1080, 1081, 1082,
- 1083, 1085, 1087, 1088, 1090, 1090, 1090, 1092, 1092, 1095,
- 1098, 1101, 1104, 1107, 1110, 1113, 1116, 1119, 1122, 1125,
-
- 1128, 1131, 1134, 1137, 1140, 1143, 1146, 1149, 1152, 1155,
- 1158, 1161, 1164, 1167, 1171, 1174, 1174, 1176, 1178, 1178,
- 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178,
- 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1179, 1179, 1179,
- 1179, 1179, 1179, 1179, 1179, 1179, 1179, 1180, 1180, 1181,
- 1182, 1183, 1184, 1185, 1185, 1185, 1186, 1186, 1187, 1187,
- 1187, 1188, 1188, 1188, 1188, 1188, 1189, 1190, 1190, 1191,
- 1194, 1194, 1194, 1195, 1196, 1197, 1199, 1202, 1205, 1208,
- 1211, 1214, 1217, 1220, 1223, 1226, 1230, 1233, 1236, 1239,
- 1242, 1245, 1248, 1251, 1253, 1254, 1257, 1258, 1259, 1260,
-
- 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270,
- 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1271, 1271, 1272,
- 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282,
- 1282, 1283, 1283, 1284, 1285, 1285, 1286, 1287, 1287, 1287,
- 1287, 1287, 1288, 1289, 1289, 1289, 1289, 1289, 1290, 1291,
- 1291, 1291, 1291, 1291, 1292, 1293, 1293, 1293, 1294, 1297,
- 1300, 1300, 1300, 1300, 1300, 1300, 1301, 1302, 1302, 1303,
- 1303, 1305, 1305, 1307, 1309, 1312, 1315, 1318, 1321, 1324,
- 1327, 1330, 1333, 1336, 1339, 1343, 1346, 1349, 1352, 1355,
- 1358, 1361, 1364, 1367, 1367, 1367, 1367, 1367, 1367, 1367,
-
- 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367,
- 1367, 1367, 1368, 1368, 1368, 1368, 1368, 1368, 1368, 1369,
- 1370, 1370, 1371, 1371, 1372, 1373, 1373, 1374, 1375, 1376,
- 1377, 1377, 1377, 1378, 1378, 1378, 1378, 1379, 1380, 1381,
- 1382, 1385, 1386, 1387, 1388, 1388, 1388, 1389, 1389, 1390,
- 1390, 1393, 1396, 1399, 1402, 1405, 1410, 1414, 1417, 1421,
- 1424, 1427, 1430, 1432, 1433, 1433, 1435, 1436, 1437, 1437,
- 1437, 1437, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440,
- 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1441, 1442, 1443,
- 1444, 1445, 1446, 1447, 1447, 1448, 1449, 1449, 1450, 1451,
-
- 1452, 1453, 1453, 1453, 1454, 1455, 1455, 1455, 1456, 1457,
- 1458, 1459, 1459, 1459, 1460, 1460, 1460, 1461, 1462, 1463,
- 1464, 1464, 1464, 1465, 1466, 1466, 1466, 1466, 1466, 1469,
- 1470, 1471, 1472, 1472, 1472, 1473, 1473, 1473, 1473, 1474,
- 1475, 1476, 1477, 1477, 1479, 1481, 1484, 1487, 1490, 1493,
- 1496, 1499, 1502, 1506, 1509, 1512, 1515, 1518, 1518, 1518,
- 1518, 1518, 1518, 1518, 1518, 1518, 1518, 1518, 1518, 1518,
- 1518, 1518, 1518, 1518, 1518, 1518, 1518, 1518, 1521, 1524,
- 1524, 1524, 1524, 1524, 1524, 1524, 1524, 1525, 1526, 1526,
- 1527, 1527, 1528, 1529, 1530, 1531, 1532, 1532, 1532, 1533,
-
- 1533, 1534, 1537, 1537, 1538, 1538, 1539, 1540, 1540, 1541,
- 1545, 1548, 1551, 1554, 1557, 1560, 1563, 1563, 1565, 1566,
- 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1568, 1569,
- 1569, 1570, 1571, 1573, 1574, 1574, 1574, 1574, 1574, 1574,
- 1574, 1574, 1575, 1576, 1577, 1577, 1578, 1578, 1579, 1580,
- 1580, 1581, 1581, 1582, 1583, 1583, 1584, 1584, 1585, 1586,
- 1586, 1586, 1587, 1588, 1588, 1589, 1589, 1590, 1591, 1592,
- 1593, 1594, 1594, 1594, 1595, 1595, 1596, 1599, 1603, 1606,
- 1609, 1612, 1615, 1618, 1618, 1618, 1618, 1618, 1618, 1618,
- 1618, 1618, 1618, 1618, 1618, 1618, 1618, 1618, 1618, 1618,
-
- 1618, 1618, 1618, 1618, 1618, 1618, 1618, 1618, 1618, 1618,
- 1619, 1620, 1620, 1621, 1621, 1622, 1623, 1626, 1626, 1627,
- 1628, 1631, 1631, 1631, 1631, 1631, 1632, 1633, 1633, 1634,
- 1635, 1636, 1637, 1638, 1638, 1638, 1639, 1639, 1639, 1639,
- 1640, 1641, 1642, 1643, 1643, 1643, 1645, 1646, 1647, 1647,
- 1647, 1647, 1647, 1647, 1647, 1647, 1648, 1649, 1649, 1650,
- 1651, 1651, 1652, 1653, 1654, 1655, 1656, 1656, 1656, 1657,
- 1658, 1658, 1659, 1659, 1660, 1661, 1664, 1667, 1668, 1669,
- 1670, 1671, 1672, 1673, 1674, 1675, 1676, 1677, 1678, 1679,
- 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680,
-
- 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680,
- 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1681, 1682,
- 1685, 1686, 1687, 1688, 1688, 1688, 1689, 1689, 1689, 1689,
- 1690, 1691, 1692, 1693, 1693, 1693, 1694, 1694, 1695, 1696,
- 1697, 1698, 1699, 1699, 1699, 1700, 1700, 1701, 1701, 1701,
- 1702, 1702, 1703, 1703, 1703, 1703, 1703, 1704, 1705, 1705,
- 1706, 1707, 1708, 1708, 1709, 1710, 1713, 1713, 1713, 1713,
- 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713,
- 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713,
- 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713,
-
- 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713,
- 1713, 1716, 1716, 1717, 1717, 1718, 1719, 1720, 1721, 1722,
- 1722, 1722, 1723, 1723, 1724, 1724, 1724, 1725, 1725, 1726,
- 1726, 1727, 1728, 1728, 1729, 1729, 1730, 1731, 1731, 1732,
- 1732, 1733, 1734, 1735, 1736, 1737, 1737, 1737, 1738, 1738,
- 1738, 1738, 1739, 1740, 1741, 1742, 1742, 1743, 1746, 1746,
- 1746, 1746, 1746, 1746, 1746, 1746, 1747, 1748, 1749, 1750,
- 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760,
- 1761, 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770,
- 1771, 1772, 1772, 1772, 1772, 1772, 1772, 1774, 1775, 1775,
-
- 1776, 1777, 1777, 1778, 1778, 1779, 1780, 1780, 1781, 1781,
- 1782, 1783, 1783, 1784, 1785, 1786, 1786, 1787, 1787, 1788,
- 1789, 1790, 1791, 1792, 1792, 1792, 1793, 1793, 1794, 1794,
- 1794, 1795, 1795, 1796, 1796, 1796, 1796, 1796, 1796, 1796,
- 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1796,
- 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1796,
- 1796, 1796, 1796, 1796, 1796, 1796, 1798, 1799, 1800, 1800,
- 1800, 1800, 1800, 1801, 1802, 1803, 1803, 1804, 1805, 1805,
- 1806, 1806, 1807, 1808, 1808, 1809, 1809, 1810, 1811, 1811,
- 1811, 1811, 1811, 1811, 1811, 1811, 1811, 1811, 1811, 1811,
-
- 1811, 1811, 1811, 1811, 1811, 1811, 1811, 1811, 1811, 1811,
- 1811, 1811, 1811, 1812, 1813, 1813, 1814, 1815, 1815, 1816,
- 1817, 1818, 1818, 1818, 1818, 1818, 1818, 1818, 1818, 1818,
- 1818, 1819, 1820, 1821, 1821, 1821, 1822, 1822, 1822, 1822,
- 1823, 1824, 1825, 1826, 1826, 1826, 1826, 1826, 1827, 1827,
- 1828, 1829, 1830, 1831, 1832, 1832, 1832, 1833, 1833, 1834,
- 1834, 1834, 1835, 1835, 1836, 1836, 1836, 1836, 1837, 1838,
- 1838, 1839, 1839, 1840, 1841, 1841, 1842, 1842, 1843, 1844,
- 1844, 1844, 1844, 1845, 1846, 1847, 1847, 1847
- } ;
-
-static yyconst int yy_ec[256] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 4, 5, 6, 1, 7, 8, 9, 10,
- 11, 7, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 20, 20, 20, 23, 24, 25, 26,
- 27, 28, 1, 29, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 56,
- 30, 31, 32, 7, 33, 1, 34, 35, 36, 37,
-
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
- 58, 56, 59, 60, 61, 62, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1
- } ;
-
-static yyconst int yy_meta[63] =
- { 0,
- 1, 2, 3, 4, 1, 1, 4, 4, 1, 5,
- 6, 7, 8, 9, 10, 11, 12, 12, 12, 12,
- 12, 12, 12, 13, 1, 4, 14, 4, 1, 15,
- 1, 1, 16, 17, 17, 17, 17, 18, 17, 16,
- 16, 16, 16, 16, 19, 20, 16, 16, 16, 16,
- 16, 21, 16, 16, 16, 16, 22, 16, 1, 4,
- 23, 24
- } ;
-
-static yyconst short int yy_base[1846] =
- { 0,
- 0, 0, 60, 0, 79, 83, 122, 0, 184, 0,
- 237, 0, 66, 67, 7752,14226, 7745,14226, 68, 7741,
- 14226,14226, 7737, 7735, 215,14226, 281,14226, 288, 322,
- 64, 39, 7716, 73, 7712, 7693, 319, 323, 345, 354,
- 378, 385, 356, 380, 399, 409, 421, 430, 431, 440,
- 463, 472, 7552, 509, 541,14226, 7603,14226, 577, 0,
- 584, 606, 278, 662, 0, 82, 7579, 83, 7558, 7544,
- 595,14226,14226, 253,14226, 621,14226, 7593, 0, 259,
- 594,14226, 669, 691, 316,14226, 88, 7567, 231, 7559,
- 7540, 752, 813, 406, 449, 276, 430, 441, 331, 216,
-
- 391, 461, 371, 742, 315, 345, 536, 468, 780, 7526,
- 14226,14226,14226,14226,14226, 7543,14226,14226, 7523, 7564,
- 14226, 7518, 217, 63, 204, 7520, 7514, 470, 7501, 7547,
- 14226, 7532, 341, 479, 487, 605, 456, 606, 632, 691,
- 752, 7504, 0, 7496, 627, 7474, 7489, 7488, 788, 813,
- 310, 835,14226, 0, 7495, 7491,14226, 583,14226, 714,
- 874, 7473, 836, 720, 860, 872, 898, 903, 904, 908,
- 909, 910, 914, 941, 725, 943, 947, 956, 970, 979,
- 985, 980, 989, 1001, 1012, 1016, 1022, 1027, 1038, 1045,
- 1054, 1061, 0, 1051, 1101, 1110, 1087, 1159, 317, 7465,
-
- 7464, 359, 492, 355, 539, 226, 414, 873, 390,14226,
- 1117, 7450, 411, 699, 618, 826, 1220, 516, 1188, 641,
- 0, 0, 1208, 1227, 1236, 611, 0, 457, 1265,14226,
- 579, 1277, 1243, 7439, 637, 1297, 1036, 7446,14226,14226,
- 7455,14226, 7423, 1139, 510, 7433, 543, 555, 1140, 1333,
- 1181,14226, 1358,14226,14226, 0, 7399, 7428, 7425,14226,
- 7419,14226, 7435, 1419, 626, 1480, 718, 7409, 7377, 1506,
- 899, 1567, 7387, 7381, 7395, 7355, 7374, 7354, 7345, 7355,
- 7331, 7334, 7331, 7341, 7331, 736, 7323, 7314, 7310, 7320,
- 7318, 7286, 7284, 7260, 7275, 74, 7263, 7261, 7243, 7226,
-
- 7229, 7229, 1309, 704, 1358, 7234, 7230,14226, 7145, 7131,
- 7153, 7135, 7151, 7107, 7117, 7112, 7094, 7093, 7096, 689,
- 7084, 0, 609, 7098, 831, 783, 774, 948, 1004, 975,
- 933, 7075, 7060, 7062, 7042, 7038, 1394, 768, 1370, 1419,
- 7018, 7026, 7023, 7025, 1162, 1433, 1440, 1576, 810, 1622,
- 7014, 7009, 1186, 1466, 1513, 1515, 1331, 1517, 1519, 1395,
- 1529, 1590, 1605, 1621, 1599, 1628, 1548, 1647, 1652, 1550,
- 1658, 1659, 1665, 1670, 1681, 1691, 1692, 1702, 1704, 1713,
- 1714, 1725, 1726, 6990, 770, 829, 694, 6978, 6975, 1032,
- 6954, 1765, 1452, 1814, 912, 1875, 1936, 1997, 6971,14226,
-
- 6987, 985, 6954, 842, 6962, 852, 905, 1466, 1022, 0,
- 6928, 6957, 6954, 6819, 6814, 937, 267, 747, 308, 761,
- 417, 847, 786, 978, 1032, 918, 1120, 930, 1752, 2058,
- 1774, 1843, 2067, 941, 1319, 1887, 1949, 1145, 1265, 1904,
- 1959, 1075, 1971,14226, 0, 1997, 1467, 2010,14226, 2022,
- 1610, 1745, 2029, 2123, 6788, 2177, 1836, 2044, 2238, 6782,
- 2074, 2096, 1855, 2109, 2294, 6781, 2350, 6802, 6800, 6799,
- 2411, 2472, 2495, 2133, 2116, 2518, 1060, 2574, 2635, 1552,
- 6762, 1137, 666, 1758, 1145, 2000, 1707, 999, 1170, 613,
- 2162, 2156, 1845, 2147, 2157, 2161, 1040, 1089, 2190, 1221,
-
- 1215, 2210, 1161, 2196, 2215, 2211, 2220, 6754, 0,14226,
- 6782, 6781, 2221, 1210, 1561, 1392, 1603, 1422, 1796, 1608,
- 1807, 1528, 1809, 1668, 1654, 1203, 6779, 1336, 1707, 1277,
- 1899, 1814, 1838, 1898, 1700, 1871, 6764, 6768, 6749, 6747,
- 2259, 2268,14226, 2209, 2281, 2303, 1094, 2315,14226, 0,
- 2327, 2385, 2683, 1235, 6769, 6767, 6750, 2414, 6742, 2740,
- 2418, 2801, 2827, 2420, 2432, 2442, 2453, 2451, 2520, 2498,
- 2519, 2521, 2542, 2581, 1962, 2585, 2583, 2595, 2597, 2596,
- 2630, 2642, 2646, 2648, 2644, 2681, 2683, 2705, 2804, 2825,
- 6725, 6713, 6726, 6704, 6720, 6708, 6716, 6516, 6505, 6489,
-
- 6480, 1356, 6465, 2872, 2933, 6504, 6470, 1448, 2839, 2994,
- 0, 6446, 2901,14226, 6495, 6438, 2556, 2846, 2884, 3055,
- 6463, 6443, 6438, 6437, 818, 6438, 1479, 1242, 1523, 1341,
- 1718, 990, 1366, 1511, 1828, 667, 1574, 2945, 2955, 2679,
- 2965, 2994, 1488, 3016,14226, 0, 1340, 3028, 1648, 3084,
- 3091, 6391, 6367, 0,14226, 3101, 3121, 1800, 3182, 1915,
- 0, 2172, 3204, 2205, 0, 2246, 3226, 2307, 0, 3248,
- 3309, 2906, 1678, 6395, 1244, 6393, 1904, 3371, 1749, 1639,
- 3432, 3157, 6414, 3169, 1867, 3284, 6411, 0, 3488, 3549,
- 1901, 1768, 6366, 1538, 1958, 1398, 1295, 1324, 1963, 2061,
-
- 1976, 1900, 1614, 1990, 2430, 1992, 1778, 2054, 1874, 2063,
- 2065, 1574, 2261, 6349, 2008, 1053, 3610, 2160, 6346, 6352,
- 6266, 6273, 6260, 6270, 6263, 6265, 6245, 6257, 6258, 925,
- 1930, 6256, 3637, 2222, 2352, 2513,14226, 2387, 3155, 2796,
- 6248, 6246, 6232, 2236, 6234, 3345, 2051, 3133, 3192, 6235,
- 3216, 3309, 3418, 2103, 3445,14226, 0, 6232, 6224, 6223,
- 6220, 3699, 2295, 3461, 3321, 3747, 1500, 3804, 3866, 3058,
- 3488, 3502, 3914, 1949, 6213, 2373, 3537, 2997, 3542, 3544,
- 3556, 3568, 3583, 3928, 3761, 3587, 3937, 3938, 3943, 3952,
- 3959, 3974, 3770, 3771, 2665, 3975, 6186,14226, 6184, 6194,
-
- 6174, 6177, 6170, 6166, 6166, 6165, 6152, 6139, 6154, 3514,
- 4025, 3582, 3994, 4086, 4001, 4141,14226, 2669, 1709, 2074,
- 1809, 2146, 2130, 2172, 2206, 2143, 1014, 1128, 2428, 4042,
- 2105, 4027, 4049, 6141, 4056, 4115,14226, 2013, 4200, 4150,
- 4122, 4222, 4278, 2924, 4329, 4159, 4166, 4351, 4407, 3041,
- 4458, 4175, 4186, 4480, 4536, 3234, 4587, 4208, 4627, 6128,
- 4689, 0, 2466, 4231, 4285, 4737, 2210, 4794, 4856, 4264,
- 2486, 4292, 4316, 2388, 4917, 4978, 1376, 2256, 535, 2154,
- 2254, 2307, 2276, 2360, 2823, 2326, 2055, 2342, 1754, 1636,
- 1834, 2828, 2400, 6122, 6116, 6126, 6120, 6122, 6102, 6117,
-
- 6102, 2354, 5039, 5989, 2261, 5089, 2590, 2547, 2679, 2901,
- 2979, 2552, 5984, 2710, 3941, 3972, 5968, 4337, 4358,14226,
- 4393, 2418, 4414, 4421, 5964, 5975, 5973, 5137, 4488, 4544,
- 2705, 5183, 5970, 5199, 4598, 4744, 5224, 2374, 5281, 5343,
- 3998, 3277, 4445, 4522, 2439, 4573,14226, 0, 5966, 5939,
- 4028, 4444, 4520, 4570, 4089, 5404, 5430, 4924, 4245, 4459,
- 4928, 4930, 4263, 4126, 2628, 4392,14226, 4231, 5457, 2994,
- 4233, 4391, 5910, 5917, 5907, 5914, 5901, 5911, 5902, 5899,
- 5879, 5882, 5882, 4766, 5518, 5579, 1437, 2472, 2695, 2525,
- 2447, 2531, 2497, 4950, 4978,14226, 5854, 5640, 487, 2540,
-
- 2873, 2713, 4995, 2627,14226, 0, 2934, 5696, 3093, 2664,
- 3094, 2721, 5007, 2876, 0, 3196, 5752, 3257, 2894, 3318,
- 2787, 5038, 2937,14226, 0, 3467, 4490, 5808, 5830, 5878,
- 5047, 5145, 2853, 5924, 5882, 5940, 5532, 5167, 5965, 2775,
- 6022, 6084, 5190, 5253, 5911, 6145, 6206, 5842, 2760, 2459,
- 2189, 2939, 5839, 2537, 2953, 3000, 3571, 5830, 5842, 5831,
- 6267, 4914, 5830, 3031, 3085, 2945, 5831, 5828, 3507, 5813,
- 3292, 3485, 6317, 3221, 4522, 4071, 4352, 6378, 6400, 5802,
- 4657, 4488, 5405, 4546, 3155, 5206, 5231,14226, 6412, 3426,
- 5539, 5579, 6428, 6459, 5595, 5602, 3428, 6505, 5813, 6521,
-
- 6560, 5230, 5631, 3081, 5647, 5654, 5798, 5809, 5808, 5151,
- 5677, 5407, 0, 5693, 5679, 5700, 3537, 5563,14226, 4654,
- 6622, 5167, 5008, 6684, 3159, 6744, 6773, 6802, 3125, 6859,
- 6921, 3557, 5730, 5408, 5779, 5790, 5783, 5784, 5756, 5771,
- 5751, 3187, 3199, 2608, 5764, 3939, 5794, 5866, 4275, 5907,
- 4985, 5830, 5947, 4340, 5994, 5029, 5842, 6146, 4404, 6982,
- 6159, 7004, 3243, 7050, 3454, 5885, 5972, 7066, 7097, 6171,
- 6206, 3456, 7143, 5766, 7159, 7198, 7259, 7320, 5744, 5756,
- 5727, 5715, 5683, 5665, 5644, 5665, 5645, 5659, 5646, 5656,
- 5645, 5635, 5609, 5609, 2425, 5597, 4004, 7381, 4485, 7430,
-
- 3605, 5736, 5766, 5594, 5410, 5601, 5733, 5606, 6228, 6255,
- 5603, 7469, 3758, 6272, 6420, 5584, 5729, 6364, 6386,14226,
- 5678, 0, 3582, 7499, 7528, 7557, 3440, 7614, 7676, 4086,
- 5575, 7736, 7772, 5017, 7808, 4207, 7837, 7874, 7903, 7920,
- 7963, 8020, 0, 5545, 4649, 6482,14226, 5719, 8082, 5906,
- 5909, 5540, 5551, 5538, 6436, 6766, 3782, 6512, 6991, 3940,
- 6528, 7013, 3944, 5549, 6160, 6213, 0, 7058, 7074, 5510,
- 8133, 3769, 7104, 7126, 5486, 5477, 5408, 5401,14226, 5407,
- 5393, 5381, 5238, 5231, 5221, 5192, 5159, 5133, 5025, 5020,
- 0, 4257, 1868, 3745, 4355, 4593, 3249, 3313, 5596, 2877,
-
- 0, 4766, 2379, 4313, 4537, 4626, 3757, 3918, 5652, 2991,
- 2870, 4963, 6799, 4988, 6746, 6239, 7151, 7259, 4949, 5971,
- 4943, 8163, 8199, 6236, 8235, 5051, 8264, 8301, 8330, 8347,
- 8390, 8447, 0, 6283, 8507, 6469, 8536, 8565, 4894, 8582,
- 8637, 8673, 6825, 8709, 6232, 8724, 0, 6458, 6748, 4792,
- 7269, 6823, 0, 3624, 8761, 8790, 8819, 3952, 8876, 8938,
- 6468, 7014, 7285, 7320, 4749, 4672, 4625, 4596, 4581, 4566,
- 4535, 4533, 4448, 4357, 4311, 4284, 4254, 2562, 2972, 2910,
- 3410, 3130, 872, 3201, 2603, 3023, 3495, 3026, 4287, 3946,
- 4049, 3231, 3320, 3555, 3467, 2682, 3511, 3135, 4063, 4083,
-
- 3961, 4595, 3949, 3483, 5527, 7126, 5789, 7342, 7282, 4079,
- 5735, 8998, 7342, 9027, 9056, 4052, 9073, 9128, 9164, 7346,
- 9200, 6778, 9215, 0, 7015, 7326, 4051, 7367, 7371, 9252,
- 9281, 6805, 9310, 7404, 9339, 9368, 3989, 7408, 3931, 7420,
- 7424, 7468, 3768, 9397, 9433, 7479, 9469, 7026, 9498, 9535,
- 9564, 9581, 9624, 9681, 0, 7481, 7107, 4145, 3675, 3633,
- 3570, 3414, 3349, 3315, 3264, 4003, 3245, 4293, 3583, 4351,
- 4124, 4352, 3316, 4054, 3746, 4551, 2785, 4415, 4121, 3198,
- 4745, 4118, 4888, 4416, 4890, 4168, 4290, 4179, 4914, 4721,
- 4452, 3152, 3037, 3013, 2977, 4189, 7530, 7363, 9741, 9770,
-
- 7107, 9799, 7566, 9828, 9857, 2882, 7504, 2865, 7738, 7512,
- 7568, 9886, 9915, 7265, 7578, 9944, 7747, 9973,10002, 2838,
- 10019,10074,10110, 7781,10146, 7267,10161, 0, 7777, 7811,
- 2808, 7820, 7877, 2718, 2643, 2623, 4484, 4289, 4489, 4418,
- 4741, 4491, 4541, 4236, 4335, 4582, 4645, 4891, 4649, 4896,
- 4952, 4742, 5012, 5139, 4257, 4570, 5031, 5048, 2498, 2290,
- 2185, 2113, 7942, 7422, 7375, 7944,14226, 7565,10200, 7757,
- 7746,10260,10289, 7445, 7885,10318,10347, 7582,10376, 7945,
- 10405,10434, 2038, 7963, 1990, 8143, 7984, 7987, 4492, 4419,
- 5141, 5140, 3084, 5159, 2548, 4739, 5229, 5226, 5233, 4368,
-
- 5245, 4456, 1935, 1767, 1685, 1552, 8167, 7813, 0, 5436,
- 10463,10492,10521, 4988,10578,10640, 7748,10700,10729, 7793,
- 8175, 4910, 5489, 5040, 5491, 5536, 5535, 1466, 1225, 1285,
- 1273,10758,10794, 8208,10830, 7887,10859,10896,10925,10942,
- 10985,11042, 0, 8210, 1154, 4980,11102, 8245,11131,11160,
- 1024,11177,11232,11268, 8247,11304, 7926,11319, 0, 8243,
- 8304, 962, 8312, 8368, 789, 586,11356,11385, 7928,11414,
- 8355,11443,11472, 404, 8371, 390, 8391, 8411, 8414, 3527,
- 295,11501,11530, 7971, 8510, 5522,14226,11561,11585,11609,
- 11618,11632,11655,11671,11694,11707,11724, 5734,11748,11771,
-
- 11793,11809,11822,11845, 5776,11862,11873,11884, 5789,11888,
- 11912,11935,11959,11972,11984,12008,12017,12032,12056,12069,
- 12088,12106,12117,12141,12164, 5857,12180,12204,12217,12241,
- 12264,12274, 6183,12285,12307,12318,12329,12341,12365,12388,
- 12409, 6484,12433,12452,12476,12493,12508, 6493,12519,12532,
- 12556,12580,12603,12626, 6503,12648,12672,12685,12700, 6740,
- 12711, 6840, 6973, 7036, 7172,12730, 7297,12753,12766,12784,
- 12808,12827,12840,12850, 7308,12861,12885,12909,12933,12956,
- 12969,12993,13006,13019,13027,13049,13068,13087,13107,13130,
- 13148,13172,13189,13213,13226,13245,13269,13292,13307, 7369,
-
- 13318,13342,13365,13387,13400,13423, 7392,13443, 7460,13463,
- 7491,13484,13507,13531,13555,13574,13597,13619,13643,13667,
- 13690,13703,13722,13746,13759,13782,13802,13822,13843,13866,
- 13890,13914,13937,13961, 7546,13985,14009,14033,14057,14081,
- 14105,14129,14153,14177,14201
- } ;
-
-static yyconst short int yy_def[1846] =
- { 0,
- 1687, 1, 1, 3, 1, 1, 1687, 7, 1687, 9,
- 9, 11, 1688, 1688, 1687, 1687, 1687, 1687, 1687, 1689,
- 1687, 1687, 1687, 1690, 1691, 1687, 1687, 1687, 1687, 1687,
- 30, 1687, 1687, 1687, 1692, 1687, 1693, 1693, 1693, 1693,
- 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693,
- 1693, 1693, 1687, 1687, 1687, 1687, 1687, 1687, 27, 54,
- 1687, 1687, 62, 1687, 54, 1687, 1687, 1687, 1687, 1687,
- 1691, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 71, 1687,
- 27, 1687, 1687, 1687, 84, 1687, 1687, 1687, 1687, 1694,
- 1687, 1695, 1695, 93, 93, 93, 93, 93, 93, 93,
-
- 93, 93, 93, 93, 93, 93, 93, 93, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1696, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1689,
- 1687, 1690, 1697, 1697, 1697, 1697, 1697, 1697, 1697, 1697,
- 1687, 30, 31, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1698, 1692, 1699, 1687, 1687, 1687, 1693,
- 1700, 1701, 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693,
- 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693,
- 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693, 1693,
- 1693, 1693, 54, 1687, 54, 1687, 1687, 1687, 198, 1702,
-
- 1703, 1703, 1703, 1703, 1703, 1703, 1703, 1703, 1703, 1687,
- 1687, 62, 62, 1704, 1687, 1704, 1687, 1687, 1687, 1687,
- 1705, 64, 1687, 1687, 1687, 225, 54, 1687, 1687, 1687,
- 1687, 1687, 1687, 84, 84, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 236, 1706, 1687, 1687, 1687, 1687, 1707, 1687,
- 1708, 1687, 1687, 1687, 1687, 1709, 1687, 1710, 1711, 1687,
- 1687, 1687, 1687, 1712, 1687, 1700, 1687, 1713, 1687, 1712,
- 1687, 266, 270, 270, 270, 270, 270, 270, 270, 270,
- 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
- 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
-
- 270, 270, 1687, 1714, 1687, 1715, 1716, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1717, 1718, 1719, 1718, 1718, 1718, 1718, 1718, 1718,
- 1718, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1720, 1721, 1721, 266, 266, 1687, 1687, 1687, 348, 1722,
- 1723, 1724, 1724, 1725, 1725, 1725, 1725, 1725, 1725, 1725,
- 1725, 1725, 1725, 1725, 1725, 1725, 1725, 1725, 1725, 1725,
- 1725, 1725, 1725, 1725, 1725, 1725, 1725, 1725, 1725, 1725,
- 1725, 1725, 1725, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 394, 1687, 1687, 1687, 1687, 1687,
-
- 1687, 1687, 397, 1687, 1687, 1687, 1687, 1687, 398, 1726,
- 1687, 1727, 1728, 1729, 1730, 1729, 1729, 1729, 1729, 1729,
- 1729, 1729, 1729, 1729, 1729, 1729, 1729, 1729, 1687, 1687,
- 1687, 1687, 1687, 433, 1687, 1687, 1687, 1731, 1732, 1687,
- 1687, 1687, 1687, 1687, 1733, 1687, 1734, 1687, 1687, 1687,
- 1735, 1736, 1687, 1687, 454, 1687, 1735, 1687, 1687, 459,
- 1687, 456, 1737, 1687, 1687, 465, 1687, 1738, 1738, 1739,
- 1739, 1740, 1740, 1687, 1687, 1687, 476, 1741, 1741, 479,
- 479, 479, 479, 479, 479, 479, 479, 479, 479, 479,
- 479, 479, 479, 479, 479, 479, 479, 479, 479, 479,
-
- 479, 479, 479, 479, 479, 479, 479, 1687, 1742, 1687,
- 1743, 1743, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1744, 1745, 1745, 1746, 1746,
- 1746, 1746, 1746, 1746, 1746, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1747, 1687, 1687, 1687, 1687, 1687, 1748,
- 1687, 1687, 1687, 553, 1749, 1750, 1751, 1752, 1752, 1687,
- 1753, 1754, 1754, 1753, 1753, 1753, 1753, 1753, 1753, 1753,
- 1753, 1753, 1753, 1753, 1687, 1753, 1753, 1753, 1753, 1753,
- 1753, 1753, 1753, 1753, 1753, 1753, 1753, 1753, 1753, 1753,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
-
- 1687, 1687, 1687, 1687, 1687, 1687, 605, 1687, 1687, 1687,
- 1755, 1687, 1687, 1687, 1687, 1687, 610, 1687, 617, 1687,
- 1756, 1756, 1757, 1757, 1758, 1758, 1758, 1758, 1758, 1758,
- 1758, 1758, 1758, 1758, 1758, 1758, 1758, 1687, 1687, 1759,
- 1687, 1687, 1687, 1687, 1687, 1760, 1687, 1687, 1687, 1687,
- 1687, 1761, 1687, 1762, 1687, 1687, 1687, 1687, 1687, 1687,
- 1763, 1687, 1687, 1687, 1764, 1687, 1687, 1687, 1765, 1687,
- 1687, 1766, 1766, 1766, 1766, 1766, 1766, 1687, 1766, 1766,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1767, 1768, 1768,
- 690, 690, 690, 690, 690, 690, 690, 690, 690, 690,
-
- 690, 690, 690, 690, 690, 690, 690, 690, 690, 690,
- 690, 690, 690, 690, 690, 1769, 1754, 717, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1770, 1771, 1687, 1772, 1772, 1772, 1687, 1772, 1772, 1772,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1773,
- 1774, 1687, 1687, 1687, 1687, 1687, 1775, 1776, 1777, 1778,
- 1778, 1687, 762, 1779, 1779, 1779, 766, 1687, 1687, 1780,
- 1687, 1687, 1687, 773, 1781, 717, 1780, 1780, 1780, 1780,
- 1780, 1780, 1780, 1780, 1780, 1780, 1780, 1780, 1780, 1780,
- 1780, 1780, 1780, 1782, 1782, 1780, 1687, 1687, 1687, 1687,
-
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 811, 1687, 1687, 811, 1687, 811, 1783, 1783,
- 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1687,
- 1687, 1687, 1687, 1784, 1687, 1687, 1687, 1785, 1687, 1687,
- 1687, 1687, 1687, 1786, 1687, 1687, 1687, 1687, 1687, 1787,
- 1687, 1687, 1687, 1687, 1687, 1788, 1687, 1687, 1687, 859,
- 1687, 861, 861, 1789, 1789, 1789, 866, 1687, 1687, 1687,
- 1687, 1687, 1687, 1790, 1791, 1791, 876, 876, 876, 876,
- 876, 876, 876, 876, 876, 876, 876, 876, 876, 876,
- 876, 876, 876, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
-
- 1687, 1687, 1687, 1792, 1792, 1687, 1793, 1793, 1793, 1793,
- 1793, 1687, 1687, 1687, 1794, 1794, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1795, 1796, 1796, 1797, 1797, 1797,
- 1797, 1797, 1797, 1797, 1797, 1797, 1797, 937, 1687, 1687,
- 1798, 1799, 1687, 1687, 1687, 1687, 1687, 1800, 1801, 1802,
- 1798, 1798, 1798, 1798, 1798, 1803, 1803, 1798, 1798, 1798,
- 1798, 1798, 1804, 1804, 1794, 1794, 1687, 1794, 1687, 1794,
- 1794, 1798, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1805, 1805, 1805, 1805,
- 1805, 1805, 1805, 1687, 1687, 1687, 1687, 1687, 1806, 1687,
-
- 1806, 1687, 1687, 1687, 1687, 1807, 1687, 1687, 1808, 1687,
- 1808, 1687, 1687, 1687, 1809, 1687, 1687, 1810, 1687, 1810,
- 1687, 1687, 1687, 1687, 1811, 1687, 1687, 1687, 1687, 1812,
- 1812, 1812, 1812, 1812, 1812, 1812, 1812, 1812, 1812, 1039,
- 1687, 1687, 1687, 1687, 1687, 1813, 1813, 1047, 1047, 1047,
- 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1814, 1815, 1687, 1816, 1816, 1816, 1816, 1817, 1817, 1687,
- 1818, 1818, 1819, 1819, 1687, 1687, 1687, 1687, 1820, 1820,
- 1820, 1820, 1820, 1820, 1820, 1820, 1820, 1820, 1820, 1820,
-
- 1687, 1821, 1687, 1687, 1687, 1687, 1822, 1823, 1823, 1821,
- 1821, 1821, 1079, 1821, 1821, 1821, 1818, 1818, 1687, 1818,
- 1687, 1818, 1818, 1687, 1124, 1819, 1819, 1819, 1128, 1687,
- 1687, 1819, 1824, 1824, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1825, 1825, 1825, 1687, 1687, 1687, 1687, 1826, 1687,
- 1687, 1687, 1687, 1827, 1687, 1687, 1687, 1687, 1828, 1687,
- 1687, 1687, 1162, 1829, 1829, 1829, 1829, 1829, 1829, 1829,
- 1829, 1829, 1829, 1829, 1829, 1687, 1830, 1830, 1178, 1178,
- 1178, 1178, 1178, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1831, 1831, 1832, 1832,
-
- 1833, 1833, 1833, 1687, 1818, 1818, 1824, 1824, 1820, 1820,
- 1820, 1820, 1820, 1820, 1820, 1100, 1821, 1687, 1687, 1687,
- 1821, 1121, 1121, 1818, 1818, 1818, 1226, 1687, 1687, 1818,
- 1128, 1819, 1819, 1819, 1819, 1819, 1819, 1819, 1819, 1128,
- 1128, 1687, 1131, 1834, 1824, 1824, 1687, 1824, 1687, 1824,
- 1824, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1162, 1687, 1687, 1835, 1829, 1829, 1829,
- 1829, 1829, 1829, 1829, 1175, 1178, 1178, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1198, 1198, 1831, 1831, 1831, 1831, 1831, 1831, 1831, 1831,
-
- 1200, 1200, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832,
- 1687, 1833, 1833, 1687, 1824, 1824, 1820, 1820, 1820, 1821,
- 1226, 1818, 1818, 1818, 1818, 1818, 1818, 1818, 1818, 1226,
- 1226, 1687, 1229, 1836, 1819, 1819, 1819, 1819, 1237, 1128,
- 1819, 1819, 1819, 1819, 1819, 1237, 1242, 1837, 1834, 1838,
- 1834, 1834, 1249, 1249, 1824, 1824, 1824, 1357, 1687, 1687,
- 1824, 1835, 1829, 1829, 1829, 1178, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1831, 1831, 1831,
- 1831, 1831, 1831, 1831, 1831, 1831, 1831, 1831, 1831, 1831,
- 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832,
-
- 1832, 1832, 1832, 1687, 1687, 1833, 1833, 1833, 1833, 1687,
- 1821, 1818, 1818, 1818, 1818, 1327, 1226, 1818, 1818, 1818,
- 1818, 1818, 1327, 1332, 1839, 1836, 1838, 1836, 1836, 1819,
- 1819, 1819, 1819, 1819, 1819, 1819, 1346, 1837, 1840, 1837,
- 1837, 1834, 1357, 1824, 1824, 1824, 1824, 1824, 1824, 1824,
- 1824, 1357, 1357, 1687, 1360, 1841, 1687, 1178, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1831, 1831, 1831, 1831, 1831,
- 1831, 1831, 1831, 1831, 1831, 1831, 1831, 1831, 1832, 1832,
- 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832,
- 1832, 1687, 1687, 1687, 1687, 1687, 1842, 1842, 1818, 1818,
-
- 1818, 1818, 1818, 1818, 1818, 1423, 1839, 1840, 1839, 1839,
- 1836, 1819, 1819, 1819, 1837, 1824, 1824, 1824, 1824, 1449,
- 1357, 1824, 1824, 1824, 1824, 1824, 1449, 1454, 1843, 1841,
- 1838, 1841, 1841, 1687, 1687, 1687, 1831, 1831, 1831, 1831,
- 1831, 1831, 1831, 1831, 1831, 1831, 1831, 1832, 1832, 1832,
- 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1687, 1687,
- 1687, 1687, 1842, 1842, 1842, 1842, 1687, 1842, 1687, 1842,
- 1842, 1818, 1818, 1818, 1839, 1824, 1824, 1824, 1824, 1824,
- 1824, 1824, 1527, 1843, 1840, 1843, 1843, 1841, 1831, 1831,
- 1831, 1831, 1831, 1831, 1831, 1832, 1832, 1832, 1832, 1832,
-
- 1832, 1832, 1687, 1687, 1687, 1687, 1842, 1842, 1569, 1569,
- 1842, 1842, 1842, 1613, 1687, 1687, 1842, 1824, 1824, 1824,
- 1843, 1831, 1831, 1831, 1832, 1832, 1832, 1687, 1687, 1687,
- 1613, 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1613,
- 1613, 1687, 1616, 1844, 1687, 1687, 1842, 1842, 1842, 1842,
- 1637, 1613, 1842, 1842, 1842, 1842, 1842, 1637, 1642, 1845,
- 1844, 1838, 1844, 1844, 1687, 1687, 1842, 1842, 1842, 1842,
- 1842, 1842, 1842, 1658, 1845, 1840, 1845, 1845, 1844, 1687,
- 1687, 1842, 1842, 1842, 1845, 1687, 0, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
-
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
-
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687
- } ;
-
-static yyconst short int yy_nxt[14289] =
- { 0,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 27, 29, 22, 30, 31, 31, 31,
- 31, 31, 31, 16, 28, 32, 33, 34, 35, 16,
- 36, 16, 37, 38, 39, 40, 41, 42, 43, 44,
- 37, 45, 46, 37, 47, 37, 37, 37, 48, 49,
- 50, 37, 51, 37, 52, 37, 37, 37, 16, 53,
- 16, 22, 54, 55, 121, 121, 56, 57, 118, 118,
- 58, 59, 60, 59, 61, 56, 62, 63, 63, 63,
- 63, 63, 63, 64, 65, 66, 67, 68, 71, 72,
- 69, 73, 71, 72, 121, 73, 119, 119, 1687, 121,
-
- 121, 122, 123, 124, 312, 125, 126, 210, 210, 210,
- 210, 313, 127, 230, 230, 500, 128, 129, 501, 70,
- 1687, 56, 16, 74, 75, 76, 20, 21, 77, 78,
- 24, 79, 80, 81, 82, 81, 83, 77, 84, 85,
- 85, 85, 85, 85, 85, 16, 86, 87, 88, 89,
- 90, 16, 91, 16, 92, 93, 94, 95, 96, 97,
- 98, 99, 100, 101, 102, 100, 103, 100, 100, 100,
- 104, 105, 106, 100, 107, 100, 108, 100, 100, 100,
- 109, 110, 16, 77, 111, 111, 111, 111, 111, 111,
- 111, 111, 111, 112, 113, 111, 114, 111, 111, 111,
-
- 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
- 115, 111, 111, 111, 111, 111, 116, 116, 116, 116,
- 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
- 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
- 116, 116, 111, 111, 111, 111, 111, 111, 314, 111,
- 134, 135, 315, 136, 228, 415, 137, 230, 230, 138,
- 231, 264, 264, 111, 310, 311, 139, 423, 140, 111,
- 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
- 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
- 111, 111, 111, 111, 111, 141, 415, 142, 143, 143,
-
- 143, 143, 143, 143, 149, 149, 149, 149, 149, 149,
- 149, 229, 1687, 281, 122, 123, 124, 232, 125, 144,
- 158, 264, 264, 626, 158, 127, 338, 338, 159, 145,
- 129, 146, 159, 147, 1687, 148, 150, 415, 143, 143,
- 143, 143, 143, 143, 143, 161, 158, 1686, 162, 161,
- 1687, 1687, 162, 322, 159, 158, 151, 158, 628, 152,
- 264, 264, 165, 159, 287, 159, 153, 298, 163, 164,
- 324, 161, 1687, 1687, 162, 288, 264, 264, 154, 158,
- 161, 158, 161, 162, 415, 162, 158, 159, 415, 159,
- 264, 264, 166, 167, 159, 168, 419, 175, 299, 176,
-
- 158, 169, 170, 420, 161, 416, 161, 162, 159, 162,
- 158, 161, 292, 177, 162, 171, 264, 264, 159, 415,
- 172, 927, 158, 275, 178, 161, 289, 181, 162, 173,
- 159, 158, 158, 174, 179, 161, 290, 264, 162, 159,
- 159, 158, 428, 415, 180, 1687, 415, 161, 1684, 159,
- 162, 264, 264, 276, 277, 424, 161, 161, 228, 162,
- 162, 630, 182, 183, 158, 282, 161, 1687, 322, 162,
- 184, 185, 159, 158, 283, 264, 264, 186, 284, 291,
- 187, 159, 285, 188, 286, 324, 264, 264, 1000, 161,
- 278, 322, 162, 189, 264, 264, 279, 280, 161, 322,
-
- 190, 162, 328, 318, 191, 302, 264, 264, 324, 192,
- 193, 319, 194, 264, 264, 229, 324, 320, 195, 325,
- 196, 415, 196, 197, 1145, 198, 199, 199, 199, 199,
- 199, 199, 435, 435, 326, 240, 240, 200, 1005, 417,
- 418, 201, 202, 203, 204, 201, 205, 206, 201, 201,
- 201, 201, 201, 207, 201, 201, 201, 208, 209, 201,
- 201, 201, 201, 201, 201, 201, 201, 210, 415, 240,
- 240, 456, 456, 300, 122, 123, 124, 301, 125, 126,
- 231, 264, 264, 421, 158, 127, 1048, 422, 264, 128,
- 129, 211, 159, 212, 213, 213, 213, 213, 213, 213,
-
- 214, 214, 214, 214, 214, 214, 214, 215, 233, 161,
- 234, 235, 235, 235, 235, 235, 235, 322, 322, 215,
- 216, 322, 213, 213, 213, 213, 213, 213, 213, 217,
- 134, 135, 1681, 136, 324, 324, 137, 232, 324, 138,
- 218, 217, 215, 219, 322, 1687, 139, 230, 140, 327,
- 220, 262, 262, 329, 122, 123, 124, 700, 125, 126,
- 318, 324, 221, 222, 217, 127, 264, 1687, 319, 128,
- 129, 1687, 330, 223, 320, 223, 224, 333, 225, 226,
- 226, 226, 226, 226, 226, 236, 236, 236, 236, 236,
- 236, 236, 237, 1687, 238, 239, 415, 240, 241, 242,
-
- 215, 693, 240, 322, 240, 243, 240, 235, 235, 235,
- 235, 235, 235, 235, 244, 158, 245, 246, 247, 264,
- 324, 158, 217, 159, 828, 248, 158, 249, 250, 159,
- 523, 251, 252, 524, 159, 253, 429, 331, 596, 254,
- 161, 255, 597, 162, 262, 262, 161, 256, 508, 162,
- 257, 161, 240, 158, 162, 261, 491, 491, 262, 263,
- 509, 159, 366, 262, 510, 262, 355, 262, 149, 149,
- 149, 149, 149, 149, 149, 293, 415, 265, 266, 267,
- 627, 268, 294, 295, 338, 338, 322, 264, 264, 296,
- 415, 303, 297, 303, 629, 322, 304, 305, 305, 305,
-
- 305, 305, 305, 324, 149, 149, 149, 149, 149, 149,
- 149, 269, 324, 270, 271, 415, 261, 592, 593, 262,
- 263, 531, 159, 632, 262, 337, 262, 215, 262, 149,
- 149, 149, 149, 149, 149, 149, 530, 158, 265, 272,
- 267, 1680, 268, 322, 1687, 159, 339, 415, 339, 217,
- 152, 340, 340, 340, 340, 340, 340, 340, 273, 274,
- 324, 158, 161, 219, 529, 162, 1687, 400, 400, 159,
- 594, 819, 269, 158, 270, 344, 415, 595, 400, 400,
- 631, 159, 356, 345, 354, 346, 161, 346, 347, 162,
- 348, 349, 349, 349, 349, 349, 349, 350, 161, 158,
-
- 271, 162, 415, 905, 158, 158, 425, 159, 159, 158,
- 158, 158, 159, 159, 426, 158, 1471, 159, 159, 159,
- 427, 617, 617, 159, 161, 472, 902, 162, 357, 161,
- 161, 358, 162, 162, 161, 161, 161, 162, 162, 162,
- 161, 361, 158, 162, 158, 322, 1687, 415, 158, 360,
- 159, 903, 159, 359, 363, 626, 159, 158, 364, 415,
- 322, 362, 324, 367, 367, 159, 415, 161, 1687, 161,
- 162, 158, 162, 161, 365, 1687, 162, 324, 637, 159,
- 158, 158, 161, 625, 535, 162, 158, 322, 159, 159,
- 158, 368, 615, 761, 159, 402, 161, 1687, 159, 162,
-
- 532, 372, 158, 369, 324, 161, 161, 415, 162, 162,
- 159, 161, 371, 158, 162, 161, 322, 158, 162, 415,
- 370, 159, 534, 158, 633, 159, 373, 161, 158, 401,
- 162, 159, 402, 324, 825, 374, 159, 237, 161, 158,
- 698, 162, 161, 415, 616, 162, 158, 159, 161, 357,
- 533, 162, 264, 161, 159, 158, 162, 376, 375, 244,
- 377, 415, 158, 159, 161, 600, 626, 162, 1669, 378,
- 159, 161, 451, 601, 162, 379, 251, 705, 634, 602,
- 161, 411, 380, 162, 384, 385, 386, 161, 387, 388,
- 162, 649, 649, 264, 1687, 389, 383, 894, 382, 390,
-
- 391, 381, 1687, 397, 397, 397, 397, 397, 397, 397,
- 747, 747, 392, 510, 392, 393, 1687, 394, 395, 395,
- 395, 395, 395, 395, 197, 706, 396, 199, 199, 199,
- 199, 199, 199, 214, 214, 214, 214, 214, 214, 214,
- 452, 457, 264, 384, 385, 386, 215, 387, 388, 415,
- 453, 458, 453, 458, 389, 454, 459, 415, 390, 391,
- 398, 635, 399, 1687, 636, 400, 401, 993, 217, 402,
- 400, 1687, 400, 403, 400, 199, 199, 199, 199, 199,
- 199, 199, 463, 692, 404, 405, 406, 558, 1687, 647,
- 264, 695, 464, 407, 464, 559, 408, 465, 264, 436,
-
- 1665, 436, 711, 409, 437, 437, 437, 437, 437, 437,
- 437, 717, 560, 730, 264, 410, 699, 353, 411, 718,
- 400, 430, 224, 264, 439, 226, 226, 226, 226, 226,
- 226, 431, 732, 431, 432, 737, 433, 434, 434, 434,
- 434, 434, 434, 440, 440, 440, 440, 440, 440, 440,
- 441, 674, 226, 226, 226, 226, 226, 226, 226, 236,
- 236, 236, 236, 236, 236, 236, 1645, 708, 264, 1687,
- 442, 415, 709, 443, 264, 471, 303, 821, 303, 441,
- 444, 304, 305, 305, 305, 305, 305, 305, 446, 322,
- 446, 1687, 445, 447, 448, 448, 448, 448, 448, 448,
-
- 238, 239, 443, 240, 241, 242, 324, 1565, 240, 444,
- 240, 735, 240, 236, 236, 236, 236, 236, 236, 236,
- 215, 445, 245, 246, 247, 304, 305, 305, 305, 305,
- 305, 305, 562, 449, 450, 435, 435, 1646, 252, 264,
- 563, 215, 217, 882, 461, 254, 461, 255, 733, 462,
- 462, 462, 462, 462, 462, 462, 257, 161, 240, 237,
- 162, 238, 239, 217, 240, 241, 242, 528, 264, 240,
- 415, 240, 883, 240, 305, 305, 305, 305, 305, 305,
- 305, 244, 823, 245, 246, 247, 340, 340, 340, 340,
- 340, 340, 340, 717, 249, 415, 158, 807, 251, 252,
-
- 808, 718, 508, 626, 159, 541, 254, 541, 255, 481,
- 542, 542, 542, 542, 542, 542, 542, 257, 510, 240,
- 158, 161, 261, 717, 162, 262, 263, 721, 159, 264,
- 262, 718, 262, 881, 262, 340, 340, 340, 340, 340,
- 340, 340, 264, 568, 265, 266, 267, 347, 268, 544,
- 349, 349, 349, 349, 349, 349, 545, 545, 545, 545,
- 545, 545, 545, 723, 811, 811, 415, 158, 605, 605,
- 605, 605, 605, 605, 605, 159, 737, 618, 269, 618,
- 270, 344, 619, 619, 619, 619, 619, 619, 619, 345,
- 1142, 346, 161, 346, 347, 162, 348, 349, 349, 349,
-
- 349, 349, 349, 350, 831, 831, 262, 158, 415, 261,
- 561, 653, 262, 263, 562, 159, 158, 262, 562, 262,
- 562, 262, 563, 654, 159, 820, 563, 655, 563, 717,
- 562, 265, 266, 267, 352, 268, 565, 718, 563, 161,
- 415, 161, 162, 161, 162, 161, 162, 826, 162, 158,
- 575, 158, 415, 158, 567, 161, 352, 159, 162, 159,
- 575, 159, 717, 566, 726, 269, 564, 270, 473, 822,
- 718, 879, 575, 691, 161, 569, 161, 162, 474, 162,
- 474, 475, 264, 476, 477, 477, 477, 477, 477, 477,
- 546, 158, 349, 349, 349, 349, 349, 349, 349, 159,
-
- 562, 367, 1630, 415, 717, 264, 158, 720, 563, 717,
- 547, 457, 718, 548, 159, 829, 161, 718, 264, 162,
- 549, 458, 562, 458, 892, 161, 459, 570, 162, 562,
- 563, 161, 550, 551, 162, 551, 552, 563, 553, 554,
- 554, 554, 554, 554, 554, 573, 571, 161, 158, 722,
- 162, 491, 725, 158, 161, 717, 159, 162, 264, 158,
- 158, 159, 572, 718, 649, 649, 562, 159, 159, 717,
- 471, 562, 574, 161, 563, 579, 162, 718, 161, 563,
- 576, 162, 158, 1055, 161, 161, 577, 162, 162, 264,
- 159, 161, 562, 562, 162, 729, 161, 578, 674, 162,
-
- 563, 563, 580, 158, 674, 562, 581, 161, 158, 471,
- 162, 159, 322, 563, 158, 158, 159, 161, 161, 322,
- 162, 162, 159, 159, 1629, 728, 158, 158, 161, 324,
- 161, 162, 582, 162, 159, 159, 324, 583, 415, 161,
- 161, 740, 162, 162, 585, 586, 452, 415, 697, 584,
- 587, 161, 161, 987, 162, 162, 453, 734, 453, 158,
- 264, 454, 589, 638, 824, 638, 588, 159, 639, 639,
- 639, 639, 639, 639, 639, 674, 674, 737, 590, 393,
- 471, 604, 395, 395, 395, 395, 395, 395, 432, 1054,
- 640, 434, 434, 434, 434, 434, 434, 717, 384, 385,
-
- 386, 658, 387, 388, 877, 718, 694, 264, 717, 389,
- 717, 264, 264, 390, 391, 398, 718, 399, 718, 889,
- 400, 606, 264, 659, 737, 400, 322, 400, 607, 400,
- 395, 395, 395, 395, 395, 395, 395, 457, 415, 404,
- 405, 406, 724, 324, 514, 659, 158, 458, 608, 458,
- 322, 609, 459, 989, 159, 727, 463, 415, 610, 641,
- 641, 641, 641, 641, 641, 641, 464, 324, 464, 1056,
- 611, 465, 717, 612, 827, 400, 398, 738, 399, 702,
- 718, 400, 401, 871, 871, 402, 400, 264, 400, 403,
- 400, 199, 199, 199, 199, 199, 199, 199, 264, 905,
-
- 404, 405, 406, 437, 437, 437, 437, 437, 437, 437,
- 322, 322, 408, 890, 1378, 741, 658, 491, 264, 409,
- 440, 440, 440, 440, 440, 440, 440, 324, 324, 674,
- 674, 410, 736, 887, 411, 471, 400, 398, 659, 399,
- 730, 648, 400, 401, 264, 264, 402, 400, 739, 400,
- 215, 400, 397, 397, 397, 397, 397, 397, 397, 732,
- 659, 404, 405, 406, 575, 437, 437, 437, 437, 437,
- 437, 437, 217, 613, 575, 440, 440, 440, 440, 440,
- 440, 440, 650, 1687, 650, 1628, 575, 651, 651, 651,
- 651, 651, 651, 651, 880, 411, 443, 400, 398, 884,
-
- 399, 158, 264, 400, 606, 1687, 491, 264, 400, 159,
- 400, 886, 400, 447, 448, 448, 448, 448, 448, 448,
- 264, 927, 404, 405, 406, 481, 448, 448, 448, 448,
- 448, 448, 448, 656, 264, 656, 264, 696, 657, 657,
- 657, 657, 657, 657, 657, 454, 455, 455, 455, 455,
- 455, 455, 264, 264, 653, 893, 612, 997, 400, 430,
- 459, 460, 460, 460, 460, 460, 460, 747, 747, 431,
- 655, 431, 432, 655, 433, 434, 434, 434, 434, 434,
- 434, 642, 1620, 434, 434, 434, 434, 434, 434, 434,
- 462, 462, 462, 462, 462, 462, 462, 885, 264, 1053,
-
- 891, 643, 481, 415, 644, 264, 481, 264, 264, 264,
- 988, 645, 462, 462, 462, 462, 462, 462, 462, 922,
- 922, 831, 831, 646, 658, 465, 466, 466, 466, 466,
- 466, 466, 682, 682, 682, 682, 682, 682, 682, 455,
- 455, 455, 455, 455, 455, 455, 659, 475, 158, 681,
- 477, 477, 477, 477, 477, 477, 159, 158, 158, 415,
- 1606, 776, 158, 158, 575, 159, 159, 660, 659, 1687,
- 159, 159, 415, 662, 575, 415, 626, 704, 991, 661,
- 238, 239, 990, 240, 241, 242, 575, 481, 240, 701,
- 240, 158, 240, 456, 456, 663, 703, 158, 491, 159,
-
- 264, 415, 245, 246, 247, 159, 662, 264, 992, 264,
- 264, 158, 158, 449, 264, 264, 158, 663, 252, 159,
- 159, 158, 717, 546, 159, 254, 481, 255, 663, 159,
- 718, 1605, 737, 712, 322, 415, 257, 915, 240, 662,
- 264, 707, 626, 264, 470, 916, 548, 666, 714, 264,
- 663, 324, 710, 549, 460, 460, 460, 460, 460, 460,
- 460, 663, 794, 264, 264, 550, 470, 713, 264, 667,
- 795, 1071, 715, 264, 719, 542, 542, 542, 542, 542,
- 542, 542, 664, 663, 542, 542, 542, 542, 542, 542,
- 542, 667, 905, 481, 665, 666, 352, 545, 545, 545,
-
- 545, 545, 545, 545, 352, 264, 1049, 264, 666, 264,
- 466, 466, 466, 466, 466, 466, 466, 667, 746, 545,
- 545, 545, 545, 545, 545, 545, 748, 1051, 748, 264,
- 667, 749, 749, 749, 749, 749, 749, 749, 668, 667,
- 548, 552, 1604, 751, 554, 554, 554, 554, 554, 554,
- 669, 237, 667, 238, 239, 902, 240, 241, 242, 1050,
- 264, 240, 1687, 240, 322, 240, 467, 467, 467, 467,
- 467, 467, 467, 244, 776, 245, 246, 247, 1052, 264,
- 903, 324, 1687, 467, 467, 467, 670, 467, 467, 683,
- 251, 252, 491, 481, 671, 264, 907, 737, 254, 322,
-
- 255, 752, 752, 752, 752, 752, 752, 752, 352, 257,
- 528, 240, 672, 264, 673, 558, 324, 674, 675, 158,
- 676, 158, 674, 559, 674, 1391, 674, 159, 909, 159,
- 352, 562, 1045, 158, 922, 922, 677, 678, 679, 563,
- 560, 159, 471, 158, 161, 353, 161, 162, 367, 162,
- 1057, 159, 158, 264, 158, 1104, 1104, 415, 161, 770,
- 159, 162, 159, 888, 777, 626, 1288, 470, 161, 1289,
- 680, 162, 674, 473, 264, 470, 415, 161, 778, 161,
- 162, 345, 162, 474, 780, 474, 475, 683, 476, 477,
- 477, 477, 477, 477, 477, 350, 473, 779, 1143, 158,
-
- 1180, 415, 871, 871, 345, 626, 474, 159, 474, 475,
- 264, 476, 477, 477, 477, 477, 477, 477, 350, 683,
- 158, 158, 158, 1687, 161, 322, 415, 162, 159, 159,
- 159, 1603, 684, 782, 477, 477, 477, 477, 477, 477,
- 477, 1000, 324, 158, 1144, 161, 161, 161, 162, 162,
- 162, 159, 685, 1078, 415, 686, 781, 737, 626, 322,
- 415, 1079, 687, 401, 626, 908, 402, 783, 161, 784,
- 1182, 162, 617, 617, 688, 158, 324, 261, 785, 905,
- 262, 263, 158, 159, 158, 262, 158, 262, 264, 262,
- 159, 1005, 159, 905, 159, 1624, 158, 562, 158, 265,
-
- 266, 267, 322, 268, 159, 563, 159, 161, 1466, 161,
- 162, 161, 162, 367, 162, 411, 788, 786, 689, 324,
- 787, 161, 161, 161, 162, 162, 162, 1074, 1000, 789,
- 967, 158, 367, 269, 905, 270, 562, 415, 261, 159,
- 1473, 262, 263, 158, 563, 158, 262, 158, 262, 158,
- 262, 159, 967, 159, 626, 159, 161, 159, 970, 162,
- 265, 266, 267, 357, 268, 1010, 971, 967, 161, 1279,
- 161, 162, 161, 162, 161, 162, 401, 162, 1005, 402,
- 1279, 792, 158, 790, 158, 1687, 1687, 791, 690, 967,
- 159, 322, 159, 642, 269, 970, 270, 753, 357, 554,
-
- 554, 554, 554, 554, 554, 554, 794, 161, 324, 161,
- 162, 1081, 162, 528, 795, 1005, 644, 754, 357, 1082,
- 755, 1090, 1090, 645, 415, 1075, 1484, 756, 411, 1146,
- 1146, 161, 626, 793, 162, 646, 353, 1151, 1151, 757,
- 352, 762, 352, 352, 352, 352, 352, 352, 352, 763,
- 352, 764, 352, 764, 765, 352, 766, 767, 767, 767,
- 767, 767, 767, 768, 352, 352, 352, 352, 352, 1279,
- 352, 353, 769, 769, 769, 769, 769, 769, 769, 769,
- 769, 769, 769, 769, 769, 769, 769, 769, 769, 769,
- 769, 769, 769, 769, 769, 769, 769, 769, 352, 352,
-
- 352, 352, 562, 1156, 1156, 158, 1687, 1179, 322, 470,
- 563, 264, 771, 159, 771, 772, 905, 773, 774, 774,
- 774, 774, 774, 774, 956, 324, 158, 161, 776, 963,
- 161, 470, 957, 162, 159, 911, 1687, 964, 771, 761,
- 771, 772, 1546, 773, 774, 774, 774, 774, 774, 774,
- 812, 161, 812, 1687, 162, 813, 813, 813, 813, 813,
- 813, 813, 619, 619, 619, 619, 619, 619, 619, 1165,
- 1165, 1311, 796, 398, 1000, 399, 264, 1010, 400, 606,
- 737, 264, 1578, 400, 471, 400, 607, 400, 395, 395,
- 395, 395, 395, 395, 395, 1019, 927, 404, 405, 406,
-
- 619, 619, 619, 619, 619, 619, 619, 672, 905, 609,
- 1003, 737, 815, 322, 815, 676, 610, 816, 816, 816,
- 816, 816, 816, 816, 1005, 658, 1574, 1005, 611, 1390,
- 324, 612, 861, 400, 398, 658, 399, 471, 1019, 400,
- 606, 905, 1076, 1468, 400, 1024, 400, 659, 400, 605,
- 605, 605, 605, 605, 605, 605, 215, 659, 404, 405,
- 406, 639, 639, 639, 639, 639, 639, 639, 1007, 659,
- 810, 639, 639, 639, 639, 639, 639, 639, 217, 659,
- 1181, 641, 641, 641, 641, 641, 641, 641, 1024, 1189,
- 264, 322, 612, 1190, 400, 398, 967, 399, 158, 481,
-
- 400, 606, 830, 905, 264, 400, 159, 400, 324, 400,
- 641, 641, 641, 641, 641, 641, 641, 1562, 967, 404,
- 405, 406, 528, 161, 970, 1077, 162, 832, 1467, 832,
- 357, 644, 833, 833, 833, 833, 833, 833, 833, 835,
- 1132, 835, 662, 1403, 836, 836, 836, 836, 836, 836,
- 836, 264, 1183, 612, 905, 400, 398, 905, 399, 158,
- 1561, 400, 401, 1467, 663, 402, 400, 159, 400, 1474,
- 400, 620, 620, 620, 620, 620, 620, 620, 1185, 1186,
- 404, 405, 406, 1560, 161, 1016, 663, 162, 620, 620,
- 620, 620, 620, 620, 1010, 1010, 941, 1104, 1104, 818,
-
- 651, 651, 651, 651, 651, 651, 651, 651, 651, 651,
- 651, 651, 651, 651, 411, 905, 400, 657, 657, 657,
- 657, 657, 657, 657, 238, 239, 1187, 240, 241, 242,
- 1150, 1013, 240, 1188, 240, 1623, 240, 657, 657, 657,
- 657, 657, 657, 657, 1005, 1005, 245, 246, 247, 749,
- 749, 749, 749, 749, 749, 749, 1207, 449, 683, 965,
- 965, 905, 252, 1470, 1208, 1687, 528, 322, 965, 254,
- 683, 255, 1486, 682, 682, 682, 682, 682, 682, 682,
- 257, 965, 240, 839, 324, 682, 682, 682, 682, 682,
- 682, 682, 1559, 840, 870, 840, 841, 662, 842, 843,
-
- 843, 843, 843, 843, 843, 845, 686, 910, 749, 749,
- 749, 749, 749, 749, 749, 846, 415, 846, 847, 663,
- 848, 849, 849, 849, 849, 849, 849, 851, 415, 528,
- 753, 737, 905, 322, 1472, 666, 626, 852, 626, 852,
- 853, 663, 854, 855, 855, 855, 855, 855, 855, 857,
- 324, 238, 239, 755, 240, 241, 242, 667, 1019, 858,
- 756, 858, 528, 240, 859, 860, 860, 860, 860, 860,
- 860, 244, 757, 245, 246, 247, 905, 1687, 1026, 667,
- 905, 467, 467, 467, 670, 467, 467, 1480, 251, 252,
- 1385, 944, 671, 1197, 1155, 872, 254, 872, 255, 1687,
-
- 873, 873, 873, 873, 873, 873, 873, 257, 1024, 240,
- 237, 1536, 238, 239, 946, 240, 241, 242, 1198, 1019,
- 240, 947, 240, 905, 240, 752, 752, 752, 752, 752,
- 752, 752, 244, 948, 245, 246, 247, 929, 929, 929,
- 929, 929, 929, 929, 905, 249, 921, 905, 1279, 251,
- 252, 528, 353, 1481, 1386, 1022, 918, 254, 918, 255,
- 1543, 919, 919, 919, 919, 919, 919, 919, 257, 1024,
- 240, 470, 862, 470, 470, 470, 470, 470, 470, 470,
- 863, 470, 864, 470, 864, 865, 470, 866, 867, 867,
- 867, 867, 867, 867, 868, 470, 470, 674, 470, 470,
-
- 1535, 470, 471, 869, 869, 869, 869, 869, 869, 869,
- 869, 869, 869, 869, 869, 869, 869, 869, 869, 869,
- 869, 869, 869, 869, 869, 869, 869, 869, 869, 470,
- 470, 470, 470, 683, 752, 752, 752, 752, 752, 752,
- 752, 905, 1090, 1090, 1213, 1213, 684, 1279, 477, 477,
- 477, 477, 477, 477, 477, 755, 923, 353, 923, 353,
- 1469, 924, 924, 924, 924, 924, 924, 924, 666, 686,
- 1165, 1165, 1272, 1272, 1117, 765, 687, 928, 767, 767,
- 767, 767, 767, 767, 1404, 471, 1199, 471, 688, 158,
- 667, 261, 353, 737, 262, 263, 1117, 159, 528, 262,
-
- 1483, 262, 772, 262, 942, 774, 774, 774, 774, 774,
- 774, 1200, 667, 265, 266, 267, 528, 268, 943, 943,
- 943, 943, 943, 943, 943, 984, 905, 984, 1311, 875,
- 985, 985, 985, 985, 985, 985, 985, 737, 158, 1119,
- 1193, 1475, 528, 158, 1485, 158, 159, 269, 1194, 270,
- 158, 159, 261, 159, 1195, 262, 263, 158, 159, 967,
- 262, 1119, 262, 161, 262, 159, 162, 1122, 161, 158,
- 161, 162, 1133, 162, 265, 266, 267, 159, 268, 357,
- 1134, 967, 161, 1117, 158, 162, 528, 970, 956, 357,
- 951, 1117, 159, 876, 161, 952, 957, 162, 813, 813,
-
- 813, 813, 813, 813, 813, 1482, 1311, 1279, 269, 161,
- 270, 717, 162, 161, 905, 737, 162, 322, 1539, 718,
- 953, 771, 264, 771, 772, 1245, 773, 774, 774, 774,
- 774, 774, 774, 1245, 324, 954, 1687, 527, 527, 527,
- 527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
- 527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
- 527, 527, 527, 527, 527, 527, 1279, 527, 528, 906,
- 906, 906, 906, 906, 906, 906, 906, 906, 906, 906,
- 906, 906, 906, 906, 906, 906, 906, 906, 906, 906,
- 906, 906, 906, 906, 906, 527, 527, 527, 527, 352,
-
- 762, 352, 352, 352, 352, 352, 352, 352, 763, 352,
- 764, 352, 764, 765, 352, 766, 767, 767, 767, 767,
- 767, 767, 768, 352, 352, 352, 352, 352, 1534, 352,
- 353, 769, 769, 769, 769, 769, 769, 769, 769, 769,
- 769, 769, 769, 769, 769, 769, 769, 769, 769, 769,
- 769, 769, 769, 769, 769, 769, 769, 352, 352, 352,
- 352, 930, 158, 767, 767, 767, 767, 767, 767, 767,
- 159, 963, 966, 967, 1213, 1213, 905, 905, 353, 964,
- 968, 931, 1544, 1000, 932, 1272, 1272, 161, 528, 353,
- 162, 933, 1379, 1380, 357, 967, 161, 969, 1398, 162,
-
- 471, 970, 1245, 934, 352, 352, 352, 352, 352, 352,
- 352, 352, 352, 352, 352, 935, 352, 935, 936, 352,
- 937, 938, 938, 938, 938, 938, 938, 352, 352, 352,
- 352, 352, 352, 1005, 352, 353, 939, 939, 939, 939,
- 939, 939, 939, 939, 939, 939, 939, 939, 939, 939,
- 939, 939, 939, 939, 939, 939, 939, 939, 939, 939,
- 939, 939, 352, 352, 352, 352, 352, 352, 352, 352,
- 352, 352, 352, 352, 352, 352, 352, 352, 352, 352,
- 352, 352, 940, 940, 940, 940, 940, 940, 940, 352,
- 352, 352, 352, 352, 352, 557, 352, 353, 940, 940,
-
- 940, 940, 940, 940, 940, 940, 940, 940, 940, 940,
- 940, 940, 940, 940, 940, 940, 940, 940, 940, 940,
- 940, 940, 940, 940, 352, 352, 352, 940, 944, 158,
- 774, 774, 774, 774, 774, 774, 774, 159, 158, 158,
- 1000, 1010, 1083, 967, 158, 1019, 159, 159, 945, 528,
- 1084, 946, 159, 158, 161, 1146, 1146, 162, 947, 1399,
- 158, 159, 927, 161, 161, 967, 162, 162, 159, 161,
- 948, 970, 162, 971, 967, 158, 158, 905, 161, 955,
- 528, 162, 959, 159, 159, 161, 1245, 960, 162, 958,
- 1005, 1005, 528, 367, 1478, 1024, 967, 1491, 1480, 158,
-
- 161, 161, 970, 162, 162, 1197, 961, 159, 1245, 962,
- 813, 813, 813, 813, 813, 813, 813, 816, 816, 816,
- 816, 816, 816, 816, 161, 972, 398, 162, 399, 158,
- 1198, 400, 606, 1514, 905, 905, 400, 159, 400, 1102,
- 400, 811, 811, 833, 833, 833, 833, 833, 833, 833,
- 404, 405, 406, 994, 161, 994, 1537, 162, 995, 995,
- 995, 995, 995, 995, 995, 833, 833, 833, 833, 833,
- 833, 833, 836, 836, 836, 836, 836, 836, 836, 357,
- 528, 1687, 761, 322, 612, 905, 400, 398, 1119, 399,
- 158, 1467, 400, 606, 528, 1479, 1501, 400, 159, 400,
-
- 324, 400, 814, 814, 814, 814, 814, 814, 814, 1487,
- 1119, 404, 405, 406, 528, 161, 1122, 1202, 162, 814,
- 814, 814, 814, 814, 814, 1496, 357, 1123, 1119, 1488,
- 986, 836, 836, 836, 836, 836, 836, 836, 999, 999,
- 999, 999, 999, 999, 999, 612, 1497, 400, 401, 528,
- 1119, 402, 528, 1550, 1498, 905, 1122, 816, 816, 816,
- 816, 816, 816, 816, 841, 1541, 998, 843, 843, 843,
- 843, 843, 843, 847, 1548, 1008, 849, 849, 849, 849,
- 849, 849, 1009, 1009, 1009, 1009, 1009, 1009, 1009, 853,
- 1563, 1017, 855, 855, 855, 855, 855, 855, 1564, 528,
-
- 411, 839, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 967,
- 528, 840, 1554, 840, 841, 1555, 842, 843, 843, 843,
- 843, 843, 843, 1000, 459, 460, 460, 460, 460, 460,
- 460, 967, 971, 967, 971, 967, 1001, 970, 843, 843,
- 843, 843, 843, 843, 843, 865, 158, 1030, 867, 867,
- 867, 867, 867, 867, 159, 967, 1002, 967, 904, 1003,
- 904, 970, 471, 970, 1118, 1119, 1004, 905, 904, 1467,
- 904, 161, 1120, 1005, 162, 1043, 1000, 1043, 1006, 1000,
- 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1119, 528, 1121,
- 1480, 1279, 1001, 1122, 843, 843, 843, 843, 843, 843,
-
- 843, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 873, 873,
- 873, 873, 873, 873, 873, 1003, 471, 683, 905, 1257,
- 905, 528, 1004, 1465, 905, 1590, 1005, 1480, 1476, 1005,
- 845, 1477, 873, 873, 873, 873, 873, 873, 873, 1538,
- 846, 1010, 846, 847, 528, 848, 849, 849, 849, 849,
- 849, 849, 1010, 919, 919, 919, 919, 919, 919, 919,
- 1392, 1393, 1687, 1279, 322, 1011, 905, 849, 849, 849,
- 849, 849, 849, 849, 919, 919, 919, 919, 919, 919,
- 919, 324, 905, 905, 1260, 1012, 905, 1467, 1013, 1203,
- 1279, 1005, 1133, 966, 967, 1014, 1381, 1540, 1542, 528,
-
- 1134, 968, 1005, 1382, 1086, 1019, 1086, 1015, 1010, 1087,
- 1087, 1087, 1087, 1087, 1087, 1087, 967, 161, 969, 1626,
- 162, 1011, 970, 849, 849, 849, 849, 849, 849, 849,
- 924, 924, 924, 924, 924, 924, 924, 924, 924, 924,
- 924, 924, 924, 924, 1013, 158, 905, 528, 1263, 905,
- 905, 1014, 1467, 159, 1592, 1024, 1547, 1552, 1005, 851,
- 158, 943, 943, 943, 943, 943, 943, 943, 159, 852,
- 161, 852, 853, 162, 854, 855, 855, 855, 855, 855,
- 855, 1019, 1103, 528, 1279, 161, 1199, 528, 162, 1123,
- 1119, 1027, 1115, 1558, 1020, 1110, 855, 855, 855, 855,
-
- 855, 855, 855, 1627, 929, 929, 929, 929, 929, 929,
- 929, 1200, 1119, 1028, 1021, 905, 528, 1022, 1122, 353,
- 905, 158, 905, 905, 1023, 1089, 451, 1594, 1589, 159,
- 251, 1024, 1687, 1591, 322, 663, 1025, 1019, 943, 943,
- 943, 943, 943, 943, 943, 1622, 161, 971, 967, 162,
- 1020, 324, 855, 855, 855, 855, 855, 855, 855, 946,
- 929, 929, 929, 929, 929, 929, 929, 1111, 528, 1464,
- 967, 158, 905, 1022, 1201, 353, 970, 1467, 1394, 159,
- 1023, 932, 905, 1463, 1105, 1395, 1105, 1024, 857, 1106,
- 1106, 1106, 1106, 1106, 1106, 1106, 161, 1545, 458, 162,
-
- 458, 528, 1462, 459, 460, 460, 460, 460, 460, 460,
- 244, 1112, 936, 905, 1094, 938, 938, 938, 938, 938,
- 938, 1595, 1480, 451, 905, 1461, 528, 251, 1027, 353,
- 238, 239, 1460, 240, 241, 242, 1489, 1383, 240, 1490,
- 240, 1384, 240, 860, 860, 860, 860, 860, 860, 860,
- 1028, 1247, 245, 246, 247, 1123, 1119, 528, 1205, 1119,
- 467, 467, 467, 670, 467, 467, 1206, 251, 252, 1459,
- 1396, 1029, 663, 1247, 1397, 254, 905, 255, 1119, 1250,
- 528, 1119, 1467, 665, 1122, 1597, 257, 1122, 240, 470,
- 862, 470, 470, 470, 470, 470, 470, 470, 863, 470,
-
- 864, 470, 864, 865, 470, 866, 867, 867, 867, 867,
- 867, 867, 868, 470, 470, 470, 470, 470, 1458, 470,
- 471, 869, 869, 869, 869, 869, 869, 869, 869, 869,
- 869, 869, 869, 869, 869, 869, 869, 869, 869, 869,
- 869, 869, 869, 869, 869, 869, 869, 470, 470, 470,
- 470, 1032, 528, 867, 867, 867, 867, 867, 867, 867,
- 1095, 1095, 1095, 1095, 1095, 1095, 1095, 527, 471, 527,
- 528, 1033, 905, 528, 1034, 353, 528, 527, 1557, 527,
- 471, 1035, 985, 985, 985, 985, 985, 985, 985, 1593,
- 1600, 1549, 1625, 1036, 470, 470, 470, 470, 470, 470,
-
- 470, 470, 470, 470, 470, 1037, 470, 1037, 1038, 470,
- 1039, 1040, 1040, 1040, 1040, 1040, 1040, 470, 470, 470,
- 470, 470, 470, 761, 470, 471, 1041, 1041, 1041, 1041,
- 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041,
- 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041,
- 1041, 1041, 470, 470, 470, 470, 470, 470, 470, 470,
- 470, 470, 470, 470, 470, 470, 470, 470, 470, 470,
- 470, 470, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 470,
- 470, 470, 470, 470, 470, 557, 470, 471, 1042, 1042,
- 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042,
-
- 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042,
- 1042, 1042, 1042, 1042, 470, 470, 470, 1042, 158, 528,
- 261, 528, 528, 262, 263, 158, 159, 528, 262, 158,
- 262, 158, 262, 159, 1551, 1596, 1553, 159, 1432, 159,
- 1598, 905, 265, 266, 267, 528, 268, 1063, 1064, 1065,
- 161, 1066, 1067, 162, 161, 1046, 161, 162, 1068, 162,
- 1556, 1467, 1069, 1070, 1404, 1114, 995, 995, 995, 995,
- 995, 995, 995, 737, 357, 322, 269, 1117, 270, 158,
- 353, 261, 1116, 528, 262, 263, 1010, 159, 1599, 262,
- 737, 262, 324, 262, 995, 995, 995, 995, 995, 995,
-
- 995, 1151, 1151, 265, 266, 267, 1147, 268, 1147, 1123,
- 1119, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1152, 967,
- 1152, 1666, 1565, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
- 1019, 1047, 1119, 1336, 1336, 1410, 1005, 269, 1122, 270,
- 1061, 967, 1062, 528, 1565, 1156, 1156, 970, 1601, 1157,
- 1062, 1157, 1062, 1119, 1158, 1158, 1158, 1158, 1158, 1158,
- 1158, 1377, 528, 1031, 1031, 1031, 1031, 1031, 1031, 1031,
- 1602, 905, 1063, 1064, 1065, 1119, 1066, 1067, 471, 528,
- 1024, 1122, 1376, 1068, 1164, 1480, 1467, 1069, 1070, 527,
- 527, 527, 527, 527, 527, 527, 527, 527, 527, 1072,
-
- 527, 527, 527, 527, 527, 1073, 1073, 1073, 1073, 1073,
- 1073, 1073, 527, 527, 527, 527, 527, 527, 732, 527,
- 528, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073,
- 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073,
- 1073, 1073, 1073, 1073, 1073, 1073, 1073, 527, 527, 527,
- 1073, 930, 158, 767, 767, 767, 767, 767, 767, 767,
- 159, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 353, 1119,
- 528, 905, 905, 1467, 932, 1480, 471, 161, 1467, 1375,
- 162, 933, 1034, 1170, 1170, 1170, 1170, 1170, 1170, 1170,
- 905, 1119, 1467, 934, 1091, 1374, 1091, 1122, 471, 1092,
-
- 1092, 1092, 1092, 1092, 1092, 1092, 1044, 1044, 1044, 1044,
- 1044, 1044, 1044, 1230, 353, 1093, 1093, 1093, 1093, 1093,
- 1093, 1093, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1279,
- 353, 158, 1093, 1093, 1093, 1093, 1093, 1093, 1096, 159,
- 938, 938, 938, 938, 938, 938, 938, 1087, 1087, 1087,
- 1087, 1087, 1087, 1087, 683, 353, 161, 528, 1097, 162,
- 528, 1098, 1480, 1480, 528, 1373, 1480, 1217, 1099, 1044,
- 1044, 1044, 1044, 1044, 1044, 1044, 528, 1372, 1480, 1371,
- 1100, 352, 352, 352, 352, 352, 352, 352, 352, 352,
- 352, 352, 352, 352, 352, 352, 352, 1101, 1101, 1101,
-
- 1101, 1101, 1101, 1101, 352, 352, 352, 352, 352, 352,
- 759, 352, 353, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 352,
- 352, 352, 1101, 352, 352, 352, 352, 352, 352, 352,
- 352, 352, 352, 352, 352, 352, 352, 352, 352, 940,
- 940, 940, 940, 940, 940, 940, 352, 352, 352, 352,
- 352, 352, 557, 352, 353, 940, 940, 940, 940, 940,
- 940, 940, 940, 940, 940, 940, 940, 940, 940, 940,
- 940, 940, 940, 940, 940, 940, 940, 940, 940, 940,
-
- 940, 352, 352, 352, 940, 956, 1083, 967, 158, 1251,
- 1247, 1205, 1119, 957, 1084, 771, 159, 771, 772, 1206,
- 773, 774, 774, 774, 774, 774, 774, 1370, 1369, 967,
- 161, 1113, 1247, 161, 1119, 970, 162, 1565, 1250, 1687,
- 1122, 771, 367, 771, 772, 1565, 773, 774, 774, 774,
- 774, 774, 774, 1368, 1367, 1366, 1687, 965, 1124, 967,
- 965, 965, 965, 965, 965, 965, 1125, 965, 1126, 965,
- 1126, 1127, 965, 1128, 1129, 1129, 1129, 1129, 1129, 1129,
- 1130, 967, 965, 965, 965, 965, 965, 970, 965, 1131,
- 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
-
- 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
- 1131, 1131, 1131, 1131, 1131, 965, 965, 965, 965, 398,
- 905, 399, 528, 1404, 400, 606, 1467, 491, 1405, 400,
- 1365, 400, 737, 400, 985, 985, 985, 985, 985, 985,
- 985, 471, 1480, 404, 405, 406, 1038, 1350, 1169, 1040,
- 1040, 1040, 1040, 1040, 1040, 1092, 1092, 1092, 1092, 1092,
- 1092, 1092, 1492, 471, 1118, 1119, 528, 528, 1493, 1350,
- 353, 1494, 1120, 1480, 965, 1351, 1352, 612, 1495, 400,
- 398, 1480, 399, 1687, 798, 400, 606, 1119, 798, 1121,
- 400, 798, 400, 1122, 400, 1092, 1092, 1092, 1092, 1092,
-
- 1092, 1092, 1123, 1119, 404, 405, 406, 1251, 1247, 965,
- 353, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1095,
- 1095, 1095, 1095, 1095, 1095, 1119, 353, 905, 1319, 1387,
- 1247, 1122, 1212, 353, 353, 1314, 1250, 1388, 612, 1098,
- 400, 1000, 1218, 1389, 1218, 1290, 1279, 1219, 1219, 1219,
- 1219, 1219, 1219, 1219, 1001, 1287, 843, 843, 843, 843,
- 843, 843, 843, 1106, 1106, 1106, 1106, 1106, 1106, 1106,
- 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1003, 158, 158,
- 158, 1286, 1285, 528, 1004, 1400, 159, 159, 159, 1284,
- 1283, 1005, 1282, 1401, 158, 1281, 1006, 1010, 1280, 1402,
-
- 1279, 158, 159, 161, 161, 161, 162, 162, 162, 159,
- 1011, 1278, 849, 849, 849, 849, 849, 849, 849, 161,
- 1251, 1247, 162, 367, 1277, 1320, 161, 367, 367, 162,
- 158, 1246, 1247, 1013, 1315, 1247, 1497, 1687, 159, 1248,
- 1014, 1221, 1316, 1247, 1498, 341, 1687, 1005, 322, 1250,
- 341, 341, 1015, 1019, 1247, 161, 1249, 1247, 162, 491,
- 1250, 161, 491, 1250, 162, 324, 1020, 1687, 855, 855,
- 855, 855, 855, 855, 855, 1255, 1687, 1255, 322, 367,
- 1256, 1256, 1256, 1256, 1256, 1256, 1256, 438, 1312, 1022,
- 1687, 491, 438, 438, 491, 324, 1023, 471, 1254, 1687,
-
- 467, 322, 1313, 1024, 798, 467, 467, 1253, 1025, 1160,
- 1148, 1148, 1148, 1148, 1148, 1148, 1148, 798, 324, 1161,
- 798, 1161, 847, 798, 1162, 1163, 1163, 1163, 1163, 1163,
- 1163, 1027, 1252, 238, 239, 328, 240, 241, 242, 1109,
- 1109, 240, 1220, 240, 353, 240, 1153, 1153, 1153, 1153,
- 1153, 1153, 1153, 1028, 1204, 245, 246, 247, 1158, 1158,
- 1158, 1158, 1158, 1158, 1158, 1196, 249, 1000, 620, 1192,
- 251, 252, 1191, 620, 620, 663, 1184, 514, 254, 514,
- 255, 514, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 257,
- 264, 240, 1032, 1178, 867, 867, 867, 867, 867, 867,
-
- 867, 1167, 1167, 1167, 1167, 1167, 1167, 1167, 1247, 471,
- 1251, 1247, 683, 471, 655, 1034, 471, 1005, 1258, 798,
- 1258, 1141, 1035, 1259, 1259, 1259, 1259, 1259, 1259, 1259,
- 1247, 798, 798, 1247, 1036, 1166, 1250, 1166, 798, 1250,
- 1167, 1167, 1167, 1167, 1167, 1167, 1167, 1140, 1010, 1139,
- 1138, 1137, 1361, 1136, 1135, 471, 1168, 1168, 1168, 1168,
- 1168, 1168, 1168, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
- 1109, 471, 158, 1168, 1168, 1168, 1168, 1168, 1168, 1171,
- 159, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1167, 1167,
- 1167, 1167, 1167, 1167, 1167, 950, 471, 161, 1005, 1172,
-
- 162, 353, 1173, 471, 927, 1261, 927, 1261, 1088, 1174,
- 1262, 1262, 1262, 1262, 1262, 1262, 1262, 1411, 1085, 1080,
- 905, 1175, 470, 470, 470, 470, 470, 470, 470, 470,
- 470, 470, 470, 470, 470, 470, 470, 470, 1176, 1176,
- 1176, 1176, 1176, 1176, 1176, 470, 470, 470, 470, 470,
- 470, 759, 470, 471, 1176, 1176, 1176, 1176, 1176, 1176,
- 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
- 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
- 470, 470, 470, 1176, 470, 470, 470, 470, 470, 470,
- 470, 470, 470, 470, 470, 470, 470, 470, 470, 470,
-
- 1042, 1042, 1042, 1042, 1042, 1042, 1042, 470, 470, 470,
- 470, 470, 470, 557, 470, 471, 1042, 1042, 1042, 1042,
- 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042,
- 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042,
- 1042, 1042, 470, 470, 470, 1042, 158, 1019, 261, 1060,
- 514, 262, 263, 1059, 159, 514, 262, 514, 262, 514,
- 262, 1265, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1058,
- 265, 266, 267, 847, 268, 1264, 1163, 1163, 1163, 1163,
- 1163, 1163, 510, 659, 1687, 996, 1177, 1170, 1170, 1170,
- 1170, 1170, 1170, 1170, 652, 983, 982, 1024, 981, 652,
-
- 652, 980, 471, 798, 269, 659, 270, 158, 1271, 261,
- 979, 1005, 262, 263, 1265, 159, 978, 262, 977, 262,
- 976, 262, 1170, 1170, 1170, 1170, 1170, 1170, 1170, 975,
- 974, 265, 266, 267, 967, 268, 659, 471, 1119, 973,
- 1251, 1247, 950, 1173, 1210, 1210, 1210, 1210, 1210, 1210,
- 1210, 761, 1413, 1413, 761, 927, 967, 481, 659, 353,
- 1119, 759, 970, 1247, 1005, 269, 1122, 270, 1061, 1250,
- 1062, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1062, 920,
- 1062, 917, 914, 913, 912, 1427, 353, 905, 1215, 1215,
- 1215, 1215, 1215, 1215, 1215, 514, 901, 514, 514, 514,
-
- 1063, 1064, 1065, 353, 1066, 1067, 900, 1427, 899, 898,
- 897, 1068, 1117, 1428, 1429, 1069, 1070, 527, 527, 527,
- 527, 527, 527, 527, 527, 527, 527, 1072, 527, 527,
- 527, 527, 527, 1073, 1073, 1073, 1073, 1073, 1073, 1073,
- 527, 527, 527, 527, 527, 527, 732, 527, 528, 1073,
- 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073,
- 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073,
- 1073, 1073, 1073, 1073, 1073, 527, 527, 527, 1073, 1078,
- 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1079, 896, 771,
- 895, 771, 772, 264, 773, 774, 774, 774, 774, 774,
-
- 774, 1113, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1687,
- 878, 771, 683, 771, 772, 683, 773, 774, 774, 774,
- 774, 774, 774, 1209, 471, 1209, 471, 655, 1210, 1210,
- 1210, 1210, 1210, 1210, 1210, 837, 1215, 1215, 1215, 1215,
- 1215, 1215, 1215, 353, 1093, 1093, 1093, 1093, 1093, 1093,
- 1093, 353, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 353,
- 1439, 1093, 1093, 1093, 1093, 1093, 1093, 415, 624, 624,
- 1247, 967, 1211, 1096, 622, 938, 938, 938, 938, 938,
- 938, 938, 1439, 1246, 1247, 1336, 1336, 965, 1440, 1441,
- 353, 1248, 1247, 967, 622, 716, 1098, 817, 1250, 970,
-
- 716, 716, 817, 1099, 750, 400, 1247, 609, 1249, 750,
- 750, 400, 1250, 809, 814, 1100, 1214, 798, 1214, 814,
- 814, 1215, 1215, 1215, 1215, 1215, 1215, 1215, 1259, 1259,
- 1259, 1259, 1259, 1259, 1259, 806, 353, 1216, 1216, 1216,
- 1216, 1216, 1216, 1216, 1262, 1262, 1262, 1262, 1262, 1262,
- 1262, 805, 353, 804, 1216, 1216, 1216, 1216, 1216, 1216,
- 352, 352, 352, 352, 352, 352, 352, 352, 352, 352,
- 352, 352, 352, 352, 352, 352, 1101, 1101, 1101, 1101,
- 1101, 1101, 1101, 352, 352, 352, 352, 352, 352, 759,
- 352, 353, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
-
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 352, 352,
- 352, 1101, 1117, 1222, 1119, 1117, 1117, 1117, 1117, 1117,
- 1117, 1223, 1117, 1224, 1117, 1224, 1225, 1117, 1226, 1227,
- 1227, 1227, 1227, 1227, 1227, 1228, 1119, 1117, 1117, 1117,
- 1117, 1117, 1122, 1117, 1229, 1229, 1229, 1229, 1229, 1229,
- 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229,
- 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229,
- 1117, 1117, 1117, 1117, 965, 1124, 967, 965, 965, 965,
- 965, 965, 965, 1125, 965, 1126, 965, 1126, 1127, 965,
-
- 1128, 1129, 1129, 1129, 1129, 1129, 1129, 1130, 967, 965,
- 965, 965, 965, 965, 970, 965, 1131, 1131, 1131, 1131,
- 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
- 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
- 1131, 1131, 965, 965, 965, 965, 967, 1315, 1247, 803,
- 1350, 834, 802, 801, 800, 1316, 834, 834, 1127, 799,
- 1231, 1129, 1129, 1129, 1129, 1129, 1129, 1000, 967, 798,
- 1247, 797, 1350, 353, 970, 967, 1250, 965, 1351, 1352,
- 1119, 761, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1232,
- 1232, 1232, 1232, 1232, 1232, 1232, 557, 967, 759, 745,
-
- 1405, 744, 1119, 970, 967, 743, 742, 967, 1122, 1687,
- 528, 322, 512, 512, 510, 264, 1233, 1005, 1129, 1129,
- 1129, 1129, 1129, 1129, 1129, 1350, 967, 967, 324, 967,
- 471, 469, 970, 469, 1406, 970, 1234, 1687, 1687, 1235,
- 1407, 1434, 1434, 1408, 1687, 624, 1236, 1350, 415, 967,
- 1409, 838, 965, 1351, 1352, 970, 838, 838, 1237, 965,
- 965, 967, 965, 965, 965, 965, 965, 965, 965, 965,
- 1238, 965, 1238, 1239, 965, 1240, 1241, 1241, 1241, 1241,
- 1241, 1241, 965, 967, 965, 965, 965, 965, 965, 970,
- 965, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242,
-
- 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242,
- 1242, 1242, 1242, 1242, 1242, 1242, 1242, 965, 965, 965,
- 965, 965, 965, 967, 965, 965, 965, 965, 965, 965,
- 965, 965, 965, 965, 965, 965, 965, 1243, 1243, 1243,
- 1243, 1243, 1243, 1243, 965, 967, 965, 965, 965, 965,
- 1244, 970, 965, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
- 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243,
- 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, 965,
- 965, 965, 1243, 1160, 844, 622, 413, 614, 400, 844,
- 844, 408, 1010, 1161, 614, 1161, 847, 400, 1162, 1163,
-
- 1163, 1163, 1163, 1163, 1163, 1265, 603, 1259, 1259, 1259,
- 1259, 1259, 1259, 1259, 1019, 1265, 599, 1508, 1011, 598,
- 1163, 1163, 1163, 1163, 1163, 1163, 1163, 659, 1247, 1262,
- 1262, 1262, 1262, 1262, 1262, 1262, 591, 659, 1012, 1508,
- 353, 1013, 1005, 557, 1117, 1509, 1510, 850, 1266, 659,
- 1247, 1687, 850, 850, 343, 1005, 1250, 343, 1457, 659,
- 1267, 1268, 543, 1268, 1024, 1005, 1269, 1269, 1269, 1269,
- 1269, 1269, 1269, 540, 1269, 1269, 1269, 1269, 1269, 1269,
- 1269, 471, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 471,
- 1269, 1269, 1269, 1269, 1269, 1269, 1269, 471, 539, 1168,
-
- 1168, 1168, 1168, 1168, 1168, 471, 538, 537, 1265, 1119,
- 1270, 1171, 536, 1040, 1040, 1040, 1040, 1040, 1040, 1040,
- 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1687, 471, 528,
- 659, 1119, 525, 514, 1173, 471, 1687, 1122, 322, 522,
- 521, 1174, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 520,
- 519, 518, 659, 1175, 1273, 324, 1273, 471, 1005, 1274,
- 1274, 1274, 1274, 1274, 1274, 1274, 325, 1318, 1318, 1318,
- 1318, 1318, 1318, 1318, 471, 1275, 1275, 1275, 1275, 1275,
- 1275, 1275, 353, 856, 517, 516, 515, 514, 856, 856,
- 471, 513, 1275, 1275, 1275, 1275, 1275, 1275, 470, 470,
-
- 470, 470, 470, 470, 470, 470, 470, 470, 470, 470,
- 470, 470, 470, 470, 1176, 1176, 1176, 1176, 1176, 1176,
- 1176, 470, 470, 470, 470, 470, 470, 759, 470, 471,
- 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
- 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
- 1176, 1176, 1176, 1176, 1176, 1176, 470, 470, 470, 1176,
- 158, 512, 261, 307, 507, 262, 263, 967, 159, 1247,
- 262, 1350, 262, 506, 262, 1318, 1318, 1318, 1318, 1318,
- 1318, 1318, 505, 1687, 265, 266, 267, 504, 268, 967,
- 353, 1247, 1687, 1350, 322, 970, 1276, 1250, 965, 1351,
-
- 1352, 1364, 1364, 1364, 1364, 1364, 1364, 1364, 874, 503,
- 502, 324, 481, 874, 874, 1442, 471, 499, 269, 925,
- 270, 158, 330, 261, 925, 925, 262, 263, 1427, 159,
- 498, 262, 497, 262, 496, 262, 1364, 1364, 1364, 1364,
- 1364, 1364, 1364, 1687, 1119, 265, 266, 267, 1119, 268,
- 1427, 471, 1687, 495, 322, 1117, 1428, 1429, 1413, 1413,
- 494, 493, 1503, 1503, 1571, 1567, 1119, 492, 490, 1427,
- 1119, 324, 1122, 1427, 489, 488, 1122, 1567, 487, 269,
- 1107, 270, 1291, 486, 1292, 1107, 1107, 1567, 485, 329,
- 484, 1427, 1292, 1570, 1292, 1427, 1117, 1428, 1429, 1567,
-
- 1117, 1428, 1429, 1149, 483, 1570, 967, 482, 1149, 1149,
- 1439, 481, 905, 1511, 1293, 1294, 1295, 480, 1296, 1297,
- 1434, 1434, 1439, 1571, 1567, 1298, 1439, 479, 967, 1299,
- 1300, 1301, 1439, 1302, 970, 478, 262, 965, 1440, 1441,
- 471, 1302, 262, 1302, 1439, 262, 1567, 1119, 1439, 965,
- 1440, 1441, 1570, 965, 1440, 1441, 469, 259, 240, 240,
- 250, 528, 240, 1303, 1304, 1305, 1515, 1306, 1307, 1119,
- 1350, 1154, 240, 1687, 1308, 1122, 1154, 1154, 1309, 1310,
- 1317, 1247, 1317, 1531, 1687, 1318, 1318, 1318, 1318, 1318,
- 1318, 1318, 1350, 415, 413, 1517, 1517, 965, 1351, 1352,
-
- 353, 1119, 1159, 1247, 353, 1531, 1508, 1159, 1159, 1250,
- 1245, 1532, 1533, 1225, 1508, 1321, 1227, 1227, 1227, 1227,
- 1227, 1227, 343, 1119, 156, 336, 335, 334, 1508, 1122,
- 1119, 1566, 1567, 1117, 1509, 1510, 1508, 332, 1687, 1568,
- 131, 1117, 1509, 1510, 1322, 1322, 1322, 1322, 1322, 1322,
- 1322, 131, 1119, 321, 1567, 317, 1569, 1362, 1122, 1119,
- 1570, 316, 1362, 1362, 309, 120, 1571, 1567, 1119, 308,
- 1427, 1323, 307, 1227, 1227, 1227, 1227, 1227, 1227, 1227,
- 1439, 1119, 1503, 1503, 1247, 230, 260, 1122, 259, 1567,
- 1119, 1324, 1427, 230, 1325, 1570, 1122, 1117, 1428, 1429,
-
- 230, 1326, 1439, 210, 227, 210, 1247, 965, 1440, 1441,
- 210, 121, 1250, 1327, 1117, 1117, 1119, 1117, 1117, 1117,
- 1117, 1117, 1117, 1117, 1117, 1328, 1117, 1328, 1329, 1117,
- 1330, 1331, 1331, 1331, 1331, 1331, 1331, 1117, 1119, 1117,
- 1117, 1117, 1117, 1117, 1122, 1117, 1332, 1332, 1332, 1332,
- 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
- 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
- 1332, 1332, 1117, 1117, 1117, 1117, 1117, 1117, 1119, 1117,
- 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
- 1117, 1117, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1117,
-
- 1119, 1117, 1117, 1117, 1117, 1334, 1122, 1117, 1333, 1333,
- 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333,
- 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333,
- 1333, 1333, 1333, 1333, 1117, 1117, 1117, 1333, 967, 157,
- 1508, 156, 121, 131, 121, 131, 120, 1571, 1567, 1247,
- 1567, 1687, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1567,
- 967, 1687, 1508, 1517, 1517, 1687, 970, 1117, 1509, 1510,
- 1567, 1247, 1567, 1335, 967, 1687, 1570, 1250, 1570, 1585,
- 1687, 1567, 1687, 1247, 1575, 1687, 1687, 1570, 1232, 1232,
- 1232, 1232, 1232, 1232, 1232, 1247, 967, 1580, 1580, 1687,
-
- 1687, 1585, 970, 1617, 1687, 1247, 1245, 1586, 1587, 1235,
- 967, 1250, 1687, 1531, 1571, 1567, 1687, 1247, 1687, 1337,
- 1687, 1337, 1531, 1250, 1338, 1338, 1338, 1338, 1338, 1338,
- 1338, 1687, 967, 1687, 1687, 1531, 1687, 1567, 970, 967,
- 1245, 1532, 1533, 1570, 1531, 1687, 1687, 1687, 1687, 1245,
- 1532, 1533, 1687, 1339, 1339, 1339, 1339, 1339, 1339, 1339,
- 1687, 967, 1687, 1687, 1687, 1687, 1588, 970, 1687, 1687,
- 1339, 1339, 1339, 1339, 1339, 1339, 967, 1687, 1687, 1531,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1508, 1239, 1567,
- 1340, 1241, 1241, 1241, 1241, 1241, 1241, 1687, 967, 1687,
-
- 1687, 1531, 1687, 1687, 970, 967, 1245, 1532, 1533, 1508,
- 1687, 1567, 1687, 1687, 1117, 1509, 1510, 1570, 1687, 1341,
- 1341, 1341, 1341, 1341, 1341, 1341, 1687, 967, 1567, 1687,
- 1567, 1687, 1687, 970, 1342, 1687, 1241, 1241, 1241, 1241,
- 1241, 1241, 1241, 1607, 1567, 1566, 1567, 1247, 1687, 1687,
- 1567, 1608, 1567, 1568, 1343, 1687, 1570, 1344, 1570, 1687,
- 1687, 1580, 1580, 1687, 1345, 1585, 1567, 1687, 1567, 1247,
- 1569, 1687, 1570, 1567, 1570, 1250, 1346, 1342, 1687, 1241,
- 1241, 1241, 1241, 1241, 1241, 1241, 1585, 1585, 1687, 1531,
- 1687, 1687, 1245, 1586, 1587, 1567, 1687, 965, 1687, 1687,
-
- 1344, 1570, 1687, 1687, 1687, 1687, 1687, 1345, 1585, 1687,
- 1687, 1531, 1687, 1245, 1586, 1587, 1245, 1532, 1533, 965,
- 965, 965, 967, 965, 965, 965, 965, 965, 965, 965,
- 965, 965, 965, 965, 965, 965, 1347, 1347, 1347, 1347,
- 1347, 1347, 1347, 965, 967, 965, 965, 965, 965, 1348,
- 970, 965, 1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347,
- 1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347,
- 1347, 1347, 1347, 1347, 1347, 1347, 1347, 1347, 965, 965,
- 965, 1347, 1245, 1353, 1247, 1245, 1245, 1245, 1245, 1245,
- 1245, 1354, 1245, 1355, 1245, 1355, 1356, 1245, 1357, 1358,
-
- 1358, 1358, 1358, 1358, 1358, 1359, 1247, 1245, 1245, 1245,
- 1245, 1245, 1250, 1245, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1245, 1245, 1245, 1245, 1363, 1585, 1363, 1687, 1687, 1364,
- 1364, 1364, 1364, 1364, 1364, 1364, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 471, 1119, 1687, 1585, 1607, 1567,
- 1687, 1687, 1245, 1586, 1587, 1687, 1608, 1585, 1687, 1322,
- 1322, 1322, 1322, 1322, 1322, 1322, 1687, 1119, 1687, 1621,
- 1687, 1567, 1687, 1122, 1687, 1687, 1687, 1570, 1687, 1585,
-
- 1412, 1119, 1687, 1687, 1245, 1586, 1587, 1687, 1687, 1687,
- 1567, 1687, 1662, 1687, 1687, 1322, 1322, 1322, 1322, 1322,
- 1322, 1322, 1687, 1119, 1648, 1648, 1687, 1687, 1687, 1122,
- 1687, 1687, 1567, 1687, 1662, 1687, 1325, 1119, 1570, 1565,
- 1663, 1664, 1687, 1687, 1687, 1676, 1414, 1567, 1414, 1567,
- 1687, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1687, 1119,
- 1687, 1648, 1648, 1671, 1671, 1122, 1119, 1676, 1687, 1567,
- 1687, 1567, 1565, 1677, 1678, 1570, 1687, 1570, 1687, 1687,
- 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1687, 1119, 1687,
- 1687, 1687, 1687, 1687, 1122, 1687, 1687, 1416, 1416, 1416,
-
- 1416, 1416, 1416, 1119, 1687, 1687, 1662, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1662, 1329, 1687, 1417, 1331, 1331,
- 1331, 1331, 1331, 1331, 1687, 1119, 1687, 1687, 1662, 1687,
- 1687, 1122, 1119, 1565, 1663, 1664, 1662, 1687, 1687, 1687,
- 1687, 1565, 1663, 1664, 1687, 1687, 1418, 1418, 1418, 1418,
- 1418, 1418, 1418, 1687, 1119, 1687, 1687, 1567, 1679, 1687,
- 1122, 1419, 1687, 1331, 1331, 1331, 1331, 1331, 1331, 1331,
- 1662, 1671, 1671, 1676, 1687, 1687, 1687, 1687, 1687, 1567,
- 1687, 1420, 1687, 1687, 1421, 1570, 1687, 1687, 1687, 1687,
- 1687, 1422, 1662, 1676, 1687, 1676, 1687, 1565, 1663, 1664,
-
- 1565, 1677, 1678, 1423, 1419, 1687, 1331, 1331, 1331, 1331,
- 1331, 1331, 1331, 1676, 1687, 1676, 1662, 1687, 1687, 1687,
- 1565, 1677, 1678, 1687, 1117, 1687, 1687, 1421, 1687, 1687,
- 1687, 1687, 1687, 1687, 1422, 1676, 1687, 1685, 1662, 1687,
- 1565, 1677, 1678, 1565, 1663, 1664, 1117, 1117, 1117, 1119,
- 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
- 1117, 1117, 1117, 1424, 1424, 1424, 1424, 1424, 1424, 1424,
- 1117, 1119, 1117, 1117, 1117, 1117, 1425, 1122, 1117, 1424,
- 1424, 1424, 1424, 1424, 1424, 1424, 1424, 1424, 1424, 1424,
- 1424, 1424, 1424, 1424, 1424, 1424, 1424, 1424, 1424, 1424,
-
- 1424, 1424, 1424, 1424, 1424, 1117, 1117, 1117, 1424, 967,
- 1687, 1687, 1676, 1687, 1687, 1687, 1687, 1687, 1430, 1687,
- 1430, 1687, 1687, 1431, 1431, 1431, 1431, 1431, 1431, 1431,
- 1687, 967, 1687, 1687, 1676, 1687, 1687, 970, 967, 1565,
- 1677, 1678, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1338, 1338, 1338, 1338, 1338, 1338, 1338, 1687,
- 967, 1687, 1687, 1687, 1687, 1687, 970, 967, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1338, 1338, 1338, 1338, 1338, 1338, 1338, 1687, 967,
- 1687, 1687, 1687, 1687, 1687, 970, 1342, 1687, 1241, 1241,
-
- 1241, 1241, 1241, 1241, 1241, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 965, 1687, 1687, 1344,
- 1687, 1687, 1687, 1687, 1687, 1687, 1345, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1346, 967,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
- 1687, 967, 1687, 1687, 1687, 1687, 1687, 970, 1687, 1687,
- 1687, 1687, 1687, 1687, 1433, 967, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1341,
- 1341, 1341, 1341, 1341, 1341, 1341, 1687, 967, 1687, 1687,
-
- 1687, 1687, 1687, 970, 1687, 1687, 1687, 1687, 1687, 1687,
- 1344, 967, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1435, 1687, 1435, 1687, 1687, 1436, 1436, 1436, 1436, 1436,
- 1436, 1436, 1687, 967, 1687, 1687, 1687, 1687, 1687, 970,
- 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1437, 1437, 1437,
- 1437, 1437, 1437, 1247, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1356, 1687, 1443, 1358, 1358,
- 1358, 1358, 1358, 1358, 1687, 1247, 1687, 1687, 1687, 1687,
- 1687, 1250, 1247, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
-
- 1687, 1687, 1687, 1687, 1687, 1687, 1444, 1444, 1444, 1444,
- 1444, 1444, 1444, 1687, 1247, 1687, 1687, 1687, 1687, 1687,
- 1250, 1247, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1445, 1687, 1358, 1358, 1358, 1358, 1358,
- 1358, 1358, 1687, 1247, 1687, 1687, 1687, 1687, 1687, 1250,
- 1687, 1687, 1687, 1446, 1687, 1687, 1447, 1687, 1687, 1687,
- 1687, 1687, 1687, 1448, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1449, 1245, 1245, 1247, 1245,
- 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1450, 1245, 1450,
- 1451, 1245, 1452, 1453, 1453, 1453, 1453, 1453, 1453, 1245,
-
- 1247, 1245, 1245, 1245, 1245, 1245, 1250, 1245, 1454, 1454,
- 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454,
- 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454,
- 1454, 1454, 1454, 1454, 1245, 1245, 1245, 1245, 1245, 1245,
- 1247, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
- 1245, 1245, 1245, 1245, 1455, 1455, 1455, 1455, 1455, 1455,
- 1455, 1245, 1247, 1245, 1245, 1245, 1245, 1456, 1250, 1245,
- 1455, 1455, 1455, 1455, 1455, 1455, 1455, 1455, 1455, 1455,
- 1455, 1455, 1455, 1455, 1455, 1455, 1455, 1455, 1455, 1455,
- 1455, 1455, 1455, 1455, 1455, 1455, 1245, 1245, 1245, 1455,
-
- 1119, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1499,
- 1687, 1499, 1687, 1687, 1500, 1500, 1500, 1500, 1500, 1500,
- 1500, 1687, 1119, 1687, 1687, 1687, 1687, 1687, 1122, 1119,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1415, 1415, 1415, 1415, 1415, 1415, 1415,
- 1687, 1119, 1687, 1687, 1687, 1687, 1687, 1122, 1119, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1687,
- 1119, 1687, 1687, 1687, 1687, 1687, 1122, 1419, 1687, 1331,
- 1331, 1331, 1331, 1331, 1331, 1331, 1687, 1687, 1687, 1687,
-
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1117, 1687, 1687,
- 1421, 1687, 1687, 1687, 1687, 1687, 1687, 1422, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1423,
- 1119, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1418, 1418, 1418, 1418, 1418, 1418,
- 1418, 1687, 1119, 1687, 1687, 1687, 1687, 1687, 1122, 1687,
- 1687, 1687, 1687, 1687, 1687, 1502, 1119, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1687, 1119, 1687,
- 1687, 1687, 1687, 1687, 1122, 1687, 1687, 1687, 1687, 1687,
-
- 1687, 1421, 1119, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1504, 1687, 1504, 1687, 1687, 1505, 1505, 1505, 1505,
- 1505, 1505, 1505, 1687, 1119, 1687, 1687, 1687, 1687, 1687,
- 1122, 1506, 1506, 1506, 1506, 1506, 1506, 1506, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1506, 1506,
- 1506, 1506, 1506, 1506, 967, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1431, 1431,
- 1431, 1431, 1431, 1431, 1431, 1687, 967, 1687, 1687, 1687,
- 1687, 1687, 970, 967, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1431, 1431, 1431,
-
- 1431, 1431, 1431, 1431, 1687, 967, 1687, 1687, 1687, 1687,
- 1687, 970, 967, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1512, 1687, 1512, 1687, 1687, 1513, 1513, 1513, 1513,
- 1513, 1513, 1513, 1687, 967, 1687, 1687, 1687, 1687, 1687,
- 970, 967, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1436, 1436, 1436, 1436, 1436,
- 1436, 1436, 1687, 967, 1687, 1687, 1687, 1687, 1687, 970,
- 967, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1436, 1436, 1436, 1436, 1436, 1436,
- 1436, 1687, 967, 1687, 1687, 1687, 1687, 1687, 970, 1247,
-
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1444, 1444, 1444, 1444, 1444, 1444, 1444,
- 1687, 1247, 1687, 1687, 1687, 1687, 1687, 1250, 1687, 1687,
- 1687, 1687, 1687, 1687, 1516, 1247, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1444,
- 1444, 1444, 1444, 1444, 1444, 1444, 1687, 1247, 1687, 1687,
- 1687, 1687, 1687, 1250, 1687, 1687, 1687, 1687, 1687, 1687,
- 1447, 1247, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1518, 1687, 1518, 1687, 1687, 1519, 1519, 1519, 1519, 1519,
- 1519, 1519, 1687, 1247, 1687, 1687, 1687, 1687, 1687, 1250,
-
- 1247, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1520, 1520, 1520, 1520, 1520, 1520,
- 1520, 1687, 1247, 1687, 1687, 1687, 1687, 1687, 1250, 1687,
- 1687, 1520, 1520, 1520, 1520, 1520, 1520, 1247, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1451,
- 1687, 1521, 1453, 1453, 1453, 1453, 1453, 1453, 1687, 1247,
- 1687, 1687, 1687, 1687, 1687, 1250, 1247, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1522, 1522, 1522, 1522, 1522, 1522, 1522, 1687, 1247, 1687,
- 1687, 1687, 1687, 1687, 1250, 1523, 1687, 1453, 1453, 1453,
-
- 1453, 1453, 1453, 1453, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1524, 1687, 1687, 1525, 1687,
- 1687, 1687, 1687, 1687, 1687, 1526, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1527, 1523, 1687,
- 1453, 1453, 1453, 1453, 1453, 1453, 1453, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1245, 1687,
- 1687, 1525, 1687, 1687, 1687, 1687, 1687, 1687, 1526, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1245, 1245, 1245, 1247, 1245, 1245, 1245, 1245, 1245, 1245,
- 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1528, 1528, 1528,
-
- 1528, 1528, 1528, 1528, 1245, 1247, 1245, 1245, 1245, 1245,
- 1529, 1250, 1245, 1528, 1528, 1528, 1528, 1528, 1528, 1528,
- 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528,
- 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1245,
- 1245, 1245, 1528, 1119, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1500, 1500, 1500,
- 1500, 1500, 1500, 1500, 1687, 1119, 1687, 1687, 1687, 1687,
- 1687, 1122, 1119, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1500, 1500, 1500, 1500,
- 1500, 1500, 1500, 1687, 1119, 1687, 1687, 1687, 1687, 1687,
-
- 1122, 1119, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1572, 1687, 1572, 1687, 1687, 1573, 1573, 1573, 1573, 1573,
- 1573, 1573, 1687, 1119, 1687, 1687, 1687, 1687, 1687, 1122,
- 1119, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1505, 1505, 1505, 1505, 1505, 1505,
- 1505, 1687, 1119, 1687, 1687, 1687, 1687, 1687, 1122, 1119,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1505, 1505, 1505, 1505, 1505, 1505, 1505,
- 1687, 1119, 1687, 1687, 1687, 1687, 1687, 1122, 967, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
-
- 1687, 1687, 1513, 1513, 1513, 1513, 1513, 1513, 1513, 1687,
- 967, 1687, 1687, 1687, 1687, 1687, 970, 967, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1513, 1513, 1513, 1513, 1513, 1513, 1513, 1687, 967,
- 1687, 1687, 1687, 1687, 1687, 970, 1247, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1576, 1687, 1576, 1687, 1687,
- 1577, 1577, 1577, 1577, 1577, 1577, 1577, 1687, 1247, 1687,
- 1687, 1687, 1687, 1687, 1250, 1247, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1519,
- 1519, 1519, 1519, 1519, 1519, 1519, 1687, 1247, 1687, 1687,
-
- 1687, 1687, 1687, 1250, 1247, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1519, 1519,
- 1519, 1519, 1519, 1519, 1519, 1687, 1247, 1687, 1687, 1687,
- 1687, 1687, 1250, 1523, 1687, 1453, 1453, 1453, 1453, 1453,
- 1453, 1453, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1245, 1687, 1687, 1525, 1687, 1687, 1687,
- 1687, 1687, 1687, 1526, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1527, 1247, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1522, 1522, 1522, 1522, 1522, 1522, 1522, 1687, 1247, 1687,
-
- 1687, 1687, 1687, 1687, 1250, 1687, 1687, 1687, 1687, 1687,
- 1687, 1579, 1247, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1522, 1522, 1522, 1522,
- 1522, 1522, 1522, 1687, 1247, 1687, 1687, 1687, 1687, 1687,
- 1250, 1687, 1687, 1687, 1687, 1687, 1687, 1525, 1247, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1581, 1687, 1581,
- 1687, 1687, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1687,
- 1247, 1687, 1687, 1687, 1687, 1687, 1250, 1583, 1583, 1583,
- 1583, 1583, 1583, 1583, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1583, 1583, 1583, 1583, 1583, 1583,
-
- 1565, 1609, 1567, 1565, 1565, 1565, 1565, 1565, 1565, 1610,
- 1565, 1611, 1565, 1611, 1612, 1565, 1613, 1614, 1614, 1614,
- 1614, 1614, 1614, 1615, 1567, 1565, 1565, 1565, 1565, 1565,
- 1570, 1565, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616,
- 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616,
- 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1565, 1565,
- 1565, 1565, 1119, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1573, 1573, 1573, 1573,
- 1573, 1573, 1573, 1687, 1119, 1687, 1687, 1687, 1687, 1687,
- 1122, 1119, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
-
- 1687, 1687, 1687, 1687, 1687, 1573, 1573, 1573, 1573, 1573,
- 1573, 1573, 1687, 1119, 1687, 1687, 1687, 1687, 1687, 1122,
- 1247, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1577, 1577, 1577, 1577, 1577, 1577,
- 1577, 1687, 1247, 1687, 1687, 1687, 1687, 1687, 1250, 1247,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1577, 1577, 1577, 1577, 1577, 1577, 1577,
- 1687, 1247, 1687, 1687, 1687, 1687, 1687, 1250, 1247, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1618, 1687, 1618,
- 1687, 1687, 1619, 1619, 1619, 1619, 1619, 1619, 1619, 1687,
-
- 1247, 1687, 1687, 1687, 1687, 1687, 1250, 1247, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1687, 1247,
- 1687, 1687, 1687, 1687, 1687, 1250, 1247, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1687, 1247, 1687,
- 1687, 1687, 1687, 1687, 1250, 1567, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1612, 1687, 1631,
- 1614, 1614, 1614, 1614, 1614, 1614, 1687, 1567, 1687, 1687,
- 1687, 1687, 1687, 1570, 1567, 1687, 1687, 1687, 1687, 1687,
-
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1632, 1632,
- 1632, 1632, 1632, 1632, 1632, 1687, 1567, 1687, 1687, 1687,
- 1687, 1687, 1570, 1567, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1633, 1687, 1614, 1614, 1614,
- 1614, 1614, 1614, 1614, 1687, 1567, 1687, 1687, 1687, 1687,
- 1687, 1570, 1687, 1687, 1687, 1634, 1687, 1687, 1635, 1687,
- 1687, 1687, 1687, 1687, 1687, 1636, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1637, 1565, 1565,
- 1567, 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1638,
- 1565, 1638, 1639, 1565, 1640, 1641, 1641, 1641, 1641, 1641,
-
- 1641, 1565, 1567, 1565, 1565, 1565, 1565, 1565, 1570, 1565,
- 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642,
- 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642,
- 1642, 1642, 1642, 1642, 1642, 1642, 1565, 1565, 1565, 1565,
- 1565, 1565, 1567, 1565, 1565, 1565, 1565, 1565, 1565, 1565,
- 1565, 1565, 1565, 1565, 1565, 1565, 1643, 1643, 1643, 1643,
- 1643, 1643, 1643, 1565, 1567, 1565, 1565, 1565, 1565, 1644,
- 1570, 1565, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
- 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643,
- 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1565, 1565,
-
- 1565, 1643, 1247, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1619, 1619, 1619, 1619,
- 1619, 1619, 1619, 1687, 1247, 1687, 1687, 1687, 1687, 1687,
- 1250, 1247, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1619, 1619, 1619, 1619, 1619,
- 1619, 1619, 1687, 1247, 1687, 1687, 1687, 1687, 1687, 1250,
- 1567, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1632, 1632, 1632, 1632, 1632, 1632,
- 1632, 1687, 1567, 1687, 1687, 1687, 1687, 1687, 1570, 1687,
- 1687, 1687, 1687, 1687, 1687, 1647, 1567, 1687, 1687, 1687,
-
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1632, 1632, 1632, 1632, 1632, 1632, 1632, 1687, 1567, 1687,
- 1687, 1687, 1687, 1687, 1570, 1687, 1687, 1687, 1687, 1687,
- 1687, 1635, 1567, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1649, 1687, 1649, 1687, 1687, 1650, 1650, 1650, 1650,
- 1650, 1650, 1650, 1687, 1567, 1687, 1687, 1687, 1687, 1687,
- 1570, 1567, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1651, 1651, 1651, 1651, 1651,
- 1651, 1651, 1687, 1567, 1687, 1687, 1687, 1687, 1687, 1570,
- 1687, 1687, 1651, 1651, 1651, 1651, 1651, 1651, 1567, 1687,
-
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1639, 1687, 1652, 1641, 1641, 1641, 1641, 1641, 1641, 1687,
- 1567, 1687, 1687, 1687, 1687, 1687, 1570, 1567, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1653, 1653, 1653, 1653, 1653, 1653, 1653, 1687, 1567,
- 1687, 1687, 1687, 1687, 1687, 1570, 1654, 1687, 1641, 1641,
- 1641, 1641, 1641, 1641, 1641, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1655, 1687, 1687, 1656,
- 1687, 1687, 1687, 1687, 1687, 1687, 1657, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1658, 1654,
-
- 1687, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1565,
- 1687, 1687, 1656, 1687, 1687, 1687, 1687, 1687, 1687, 1657,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1565, 1565, 1565, 1567, 1565, 1565, 1565, 1565, 1565,
- 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1659, 1659,
- 1659, 1659, 1659, 1659, 1659, 1565, 1567, 1565, 1565, 1565,
- 1565, 1660, 1570, 1565, 1659, 1659, 1659, 1659, 1659, 1659,
- 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659,
- 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659,
-
- 1565, 1565, 1565, 1659, 1567, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1667, 1687, 1667, 1687, 1687, 1668, 1668,
- 1668, 1668, 1668, 1668, 1668, 1687, 1567, 1687, 1687, 1687,
- 1687, 1687, 1570, 1567, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1650, 1650, 1650,
- 1650, 1650, 1650, 1650, 1687, 1567, 1687, 1687, 1687, 1687,
- 1687, 1570, 1567, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1650, 1650, 1650, 1650,
- 1650, 1650, 1650, 1687, 1567, 1687, 1687, 1687, 1687, 1687,
- 1570, 1654, 1687, 1641, 1641, 1641, 1641, 1641, 1641, 1641,
-
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1565, 1687, 1687, 1656, 1687, 1687, 1687, 1687, 1687,
- 1687, 1657, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1658, 1567, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1653, 1653,
- 1653, 1653, 1653, 1653, 1653, 1687, 1567, 1687, 1687, 1687,
- 1687, 1687, 1570, 1687, 1687, 1687, 1687, 1687, 1687, 1670,
- 1567, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1653, 1653, 1653, 1653, 1653, 1653,
- 1653, 1687, 1567, 1687, 1687, 1687, 1687, 1687, 1570, 1687,
-
- 1687, 1687, 1687, 1687, 1687, 1656, 1567, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1672, 1687, 1672, 1687, 1687,
- 1673, 1673, 1673, 1673, 1673, 1673, 1673, 1687, 1567, 1687,
- 1687, 1687, 1687, 1687, 1570, 1674, 1674, 1674, 1674, 1674,
- 1674, 1674, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1674, 1674, 1674, 1674, 1674, 1674, 1567, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1668, 1668, 1668, 1668, 1668, 1668, 1668, 1687,
- 1567, 1687, 1687, 1687, 1687, 1687, 1570, 1567, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
-
- 1687, 1668, 1668, 1668, 1668, 1668, 1668, 1668, 1687, 1567,
- 1687, 1687, 1687, 1687, 1687, 1570, 1567, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1682, 1687, 1682, 1687, 1687,
- 1683, 1683, 1683, 1683, 1683, 1683, 1683, 1687, 1567, 1687,
- 1687, 1687, 1687, 1687, 1570, 1567, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1673,
- 1673, 1673, 1673, 1673, 1673, 1673, 1687, 1567, 1687, 1687,
- 1687, 1687, 1687, 1570, 1567, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1673, 1673,
- 1673, 1673, 1673, 1673, 1673, 1687, 1567, 1687, 1687, 1687,
-
- 1687, 1687, 1570, 1567, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1683, 1683, 1683,
- 1683, 1683, 1683, 1683, 1687, 1567, 1687, 1687, 1687, 1687,
- 1687, 1570, 1567, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1683, 1683, 1683, 1683,
- 1683, 1683, 1683, 1687, 1567, 1687, 1687, 1687, 1687, 1687,
- 1570, 117, 117, 117, 117, 117, 117, 117, 117, 117,
- 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
- 117, 117, 117, 117, 117, 130, 130, 130, 130, 130,
- 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
-
- 130, 130, 130, 130, 130, 130, 130, 130, 130, 132,
- 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
- 132, 132, 132, 132, 132, 132, 132, 132, 132, 132,
- 132, 132, 132, 133, 133, 133, 133, 133, 133, 133,
- 155, 155, 155, 155, 1687, 1687, 155, 155, 155, 155,
- 155, 155, 155, 155, 1687, 155, 160, 1687, 1687, 160,
- 1687, 1687, 1687, 1687, 1687, 1687, 160, 1687, 160, 160,
- 160, 160, 160, 160, 160, 160, 160, 1687, 160, 258,
- 258, 258, 258, 1687, 1687, 258, 258, 258, 258, 258,
- 258, 258, 258, 1687, 258, 264, 1687, 264, 264, 1687,
-
- 264, 1687, 264, 1687, 264, 264, 1687, 264, 264, 264,
- 264, 264, 264, 264, 264, 264, 1687, 264, 306, 1687,
- 1687, 306, 306, 306, 306, 306, 306, 306, 306, 1687,
- 306, 323, 1687, 1687, 1687, 323, 1687, 1687, 323, 323,
- 323, 323, 323, 323, 323, 323, 1687, 323, 342, 342,
- 1687, 342, 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 351, 1687, 1687, 351, 1687, 351, 1687, 351,
- 351, 1687, 351, 351, 1687, 1687, 351, 351, 351, 351,
- 351, 351, 351, 352, 352, 352, 352, 352, 352, 352,
-
- 352, 352, 352, 352, 352, 352, 352, 1687, 352, 352,
- 352, 352, 352, 352, 352, 352, 352, 412, 412, 412,
- 412, 1687, 1687, 412, 412, 412, 412, 412, 412, 412,
- 412, 1687, 412, 414, 1687, 1687, 414, 414, 414, 414,
- 414, 414, 414, 414, 1687, 414, 214, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 214, 214, 1687, 1687,
- 1687, 1687, 214, 455, 1687, 1687, 1687, 1687, 455, 1687,
- 455, 1687, 1687, 455, 460, 1687, 1687, 1687, 1687, 460,
- 1687, 460, 1687, 1687, 460, 466, 1687, 1687, 1687, 1687,
- 466, 1687, 466, 1687, 1687, 466, 258, 258, 258, 258,
-
- 1687, 1687, 258, 258, 258, 258, 258, 258, 258, 258,
- 1687, 258, 468, 468, 1687, 468, 468, 468, 468, 468,
- 468, 468, 468, 468, 468, 468, 468, 468, 468, 468,
- 468, 468, 468, 468, 468, 468, 264, 1687, 264, 264,
- 1687, 264, 1687, 264, 1687, 264, 264, 1687, 264, 264,
- 264, 264, 264, 264, 264, 264, 264, 1687, 264, 470,
- 470, 470, 470, 470, 470, 470, 470, 470, 470, 470,
- 470, 470, 470, 1687, 470, 470, 470, 470, 470, 470,
- 470, 470, 470, 305, 1687, 1687, 1687, 1687, 1687, 1687,
- 305, 1687, 1687, 305, 305, 306, 1687, 1687, 306, 306,
-
- 306, 306, 306, 306, 306, 306, 1687, 306, 511, 511,
- 511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
- 511, 511, 1687, 511, 511, 511, 511, 511, 511, 511,
- 511, 511, 526, 526, 526, 526, 526, 526, 526, 323,
- 1687, 1687, 1687, 323, 1687, 1687, 323, 323, 323, 323,
- 323, 323, 323, 323, 1687, 323, 527, 527, 527, 527,
- 527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
- 1687, 527, 527, 527, 527, 527, 527, 527, 527, 527,
- 341, 1687, 1687, 1687, 1687, 341, 341, 341, 342, 342,
- 1687, 342, 342, 342, 342, 342, 342, 342, 342, 342,
-
- 342, 342, 342, 342, 342, 342, 342, 342, 342, 342,
- 342, 342, 555, 1687, 555, 555, 1687, 555, 1687, 1687,
- 1687, 555, 555, 555, 555, 555, 555, 555, 556, 1687,
- 1687, 556, 556, 556, 556, 556, 556, 556, 556, 1687,
- 556, 352, 352, 352, 352, 352, 352, 352, 352, 352,
- 352, 352, 352, 352, 352, 1687, 352, 352, 352, 352,
- 352, 352, 352, 352, 352, 160, 1687, 1687, 160, 1687,
- 1687, 1687, 1687, 1687, 1687, 160, 1687, 160, 160, 160,
- 160, 160, 160, 160, 160, 160, 1687, 160, 412, 412,
- 412, 412, 1687, 1687, 412, 412, 412, 412, 412, 412,
-
- 412, 412, 1687, 412, 621, 621, 1687, 621, 621, 621,
- 621, 621, 621, 621, 621, 621, 621, 621, 621, 621,
- 621, 621, 621, 621, 621, 621, 621, 621, 414, 1687,
- 1687, 414, 414, 414, 414, 414, 414, 414, 414, 1687,
- 414, 623, 623, 623, 623, 623, 623, 623, 623, 623,
- 623, 623, 623, 623, 623, 1687, 623, 623, 623, 623,
- 623, 623, 623, 623, 623, 438, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 438, 438, 1687, 1687, 1687,
- 438, 438, 438, 226, 1687, 226, 1687, 1687, 1687, 1687,
- 1687, 226, 226, 1687, 1687, 226, 448, 1687, 1687, 1687,
-
- 1687, 1687, 1687, 448, 1687, 1687, 448, 448, 460, 1687,
- 1687, 1687, 1687, 460, 1687, 460, 1687, 1687, 460, 455,
- 1687, 1687, 1687, 1687, 455, 1687, 455, 1687, 1687, 455,
- 466, 1687, 1687, 1687, 1687, 466, 1687, 466, 1687, 1687,
- 466, 468, 468, 1687, 468, 468, 468, 468, 468, 468,
- 468, 468, 468, 468, 468, 468, 468, 468, 468, 468,
- 468, 468, 468, 468, 468, 470, 470, 470, 470, 470,
- 470, 470, 470, 470, 470, 470, 470, 470, 470, 1687,
- 470, 470, 470, 470, 470, 470, 470, 470, 470, 351,
- 1687, 1687, 351, 1687, 351, 1687, 351, 351, 1687, 351,
-
- 351, 1687, 1687, 351, 351, 351, 351, 351, 351, 351,
- 264, 1687, 264, 264, 1687, 264, 1687, 264, 1687, 264,
- 264, 1687, 264, 264, 264, 264, 264, 264, 264, 264,
- 264, 1687, 264, 511, 511, 511, 511, 511, 511, 511,
- 511, 511, 511, 511, 511, 511, 511, 1687, 511, 511,
- 511, 511, 511, 511, 511, 511, 511, 731, 1687, 1687,
- 1687, 1687, 1687, 731, 1687, 1687, 731, 731, 731, 731,
- 731, 731, 731, 731, 1687, 731, 527, 527, 527, 527,
- 527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
- 1687, 527, 527, 527, 527, 527, 527, 527, 527, 527,
-
- 323, 1687, 1687, 1687, 323, 1687, 1687, 323, 323, 323,
- 323, 323, 323, 323, 323, 1687, 323, 349, 1687, 349,
- 1687, 1687, 1687, 1687, 1687, 349, 349, 1687, 1687, 349,
- 758, 1687, 1687, 758, 758, 758, 758, 758, 758, 758,
- 758, 1687, 758, 556, 1687, 1687, 556, 556, 556, 556,
- 556, 556, 556, 556, 1687, 556, 760, 760, 760, 760,
- 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
- 1687, 760, 760, 760, 760, 760, 760, 760, 760, 760,
- 352, 352, 352, 352, 352, 352, 352, 352, 352, 352,
- 352, 352, 352, 352, 1687, 352, 352, 352, 352, 352,
-
- 352, 352, 352, 352, 160, 1687, 1687, 160, 1687, 1687,
- 1687, 1687, 1687, 1687, 160, 1687, 160, 160, 160, 160,
- 160, 160, 160, 160, 160, 1687, 160, 775, 1687, 1687,
- 775, 1687, 775, 1687, 775, 775, 1687, 775, 1687, 775,
- 1687, 775, 775, 775, 775, 775, 775, 775, 621, 621,
- 1687, 621, 621, 621, 621, 621, 621, 621, 621, 621,
- 621, 621, 621, 621, 621, 621, 621, 621, 621, 621,
- 621, 621, 623, 623, 623, 623, 623, 623, 623, 623,
- 623, 623, 623, 623, 623, 623, 1687, 623, 623, 623,
- 623, 623, 623, 623, 623, 623, 414, 1687, 1687, 414,
-
- 414, 414, 414, 414, 414, 414, 414, 1687, 414, 434,
- 1687, 434, 1687, 1687, 1687, 1687, 1687, 434, 434, 1687,
- 1687, 434, 652, 1687, 1687, 1687, 1687, 652, 652, 652,
- 470, 470, 470, 470, 470, 470, 470, 470, 470, 470,
- 470, 470, 470, 470, 1687, 470, 470, 470, 470, 470,
- 470, 470, 470, 470, 264, 1687, 264, 264, 1687, 264,
- 1687, 264, 1687, 264, 264, 1687, 264, 264, 264, 264,
- 264, 264, 264, 264, 264, 1687, 264, 716, 1687, 1687,
- 1687, 1687, 716, 716, 716, 1687, 1687, 1687, 716, 731,
- 1687, 1687, 1687, 1687, 1687, 731, 1687, 1687, 731, 731,
-
- 731, 731, 731, 731, 731, 731, 1687, 731, 904, 904,
- 904, 904, 904, 904, 904, 904, 904, 904, 904, 904,
- 904, 904, 1687, 904, 904, 904, 904, 904, 904, 904,
- 904, 904, 323, 1687, 323, 1687, 1687, 1687, 323, 1687,
- 1687, 323, 323, 323, 323, 323, 323, 323, 323, 1687,
- 323, 750, 1687, 1687, 1687, 1687, 750, 750, 750, 554,
- 1687, 554, 1687, 1687, 1687, 1687, 1687, 554, 554, 1687,
- 1687, 554, 758, 1687, 1687, 758, 758, 758, 758, 758,
- 758, 758, 758, 1687, 758, 926, 926, 926, 926, 926,
- 926, 926, 926, 926, 926, 926, 926, 926, 926, 1687,
-
- 926, 926, 926, 926, 926, 926, 926, 926, 926, 760,
- 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
- 760, 760, 760, 1687, 760, 760, 760, 760, 760, 760,
- 760, 760, 760, 352, 352, 352, 352, 352, 352, 352,
- 352, 352, 352, 352, 352, 352, 352, 1687, 352, 352,
- 352, 352, 352, 352, 352, 352, 352, 160, 1687, 1687,
- 160, 1687, 1687, 1687, 1687, 1687, 1687, 160, 1687, 160,
- 160, 160, 160, 160, 160, 160, 160, 160, 1687, 160,
- 949, 1687, 1687, 949, 949, 949, 949, 949, 949, 949,
- 949, 1687, 949, 965, 965, 965, 965, 965, 965, 965,
-
- 965, 965, 965, 965, 965, 965, 965, 965, 965, 965,
- 965, 965, 965, 965, 965, 965, 965, 414, 1687, 1687,
- 414, 414, 414, 414, 414, 414, 414, 414, 1687, 414,
- 834, 1687, 1687, 1687, 1687, 834, 834, 834, 838, 1687,
- 1687, 1687, 1687, 838, 838, 838, 1687, 1687, 1687, 838,
- 844, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 844, 844, 1687, 1687, 1687, 844, 844, 844, 844, 850,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 850,
- 850, 1687, 1687, 1687, 850, 850, 850, 850, 856, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 856, 856,
-
- 1687, 1687, 1687, 856, 856, 856, 856, 470, 470, 470,
- 470, 470, 470, 470, 470, 470, 470, 470, 470, 470,
- 470, 1687, 470, 470, 470, 470, 470, 470, 470, 470,
- 470, 874, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 874, 1687, 1687, 1687, 1687, 874, 874, 874, 264,
- 1687, 264, 264, 1687, 264, 1687, 264, 1687, 264, 264,
- 1687, 264, 264, 264, 264, 264, 264, 264, 264, 264,
- 1687, 264, 904, 904, 904, 904, 904, 904, 904, 904,
- 904, 904, 904, 904, 904, 904, 1687, 904, 904, 904,
- 904, 904, 904, 904, 904, 904, 323, 1687, 1687, 1687,
-
- 323, 1687, 1687, 323, 323, 323, 323, 323, 323, 323,
- 323, 1687, 323, 965, 965, 965, 965, 965, 965, 965,
- 965, 965, 965, 965, 965, 965, 965, 965, 965, 965,
- 965, 965, 965, 965, 965, 965, 965, 925, 1687, 1687,
- 1687, 1687, 925, 925, 925, 926, 926, 926, 926, 926,
- 926, 926, 926, 926, 926, 926, 926, 926, 926, 1687,
- 926, 926, 926, 926, 926, 926, 926, 926, 926, 352,
- 352, 352, 352, 352, 352, 352, 352, 352, 352, 352,
- 352, 352, 352, 1687, 352, 352, 352, 352, 352, 352,
- 352, 352, 352, 160, 1687, 1687, 160, 1687, 1687, 1687,
-
- 1687, 1687, 1687, 160, 1687, 160, 160, 160, 160, 160,
- 160, 160, 160, 160, 1687, 160, 774, 1687, 774, 1687,
- 1687, 1687, 1687, 1687, 774, 774, 1687, 1687, 774, 949,
- 1687, 1687, 949, 949, 949, 949, 949, 949, 949, 949,
- 1687, 949, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108,
- 1108, 1108, 1108, 1108, 1108, 1108, 1687, 1108, 1108, 1108,
- 1108, 1108, 1108, 1108, 1108, 1108, 775, 1687, 1687, 775,
- 1687, 775, 1687, 775, 775, 1687, 775, 1687, 775, 1687,
- 775, 775, 775, 775, 775, 775, 775, 1117, 1117, 1117,
- 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
-
- 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
- 1117, 414, 1687, 1687, 414, 414, 414, 414, 414, 414,
- 414, 414, 1687, 414, 999, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 999, 1687, 1687, 1687, 1687, 1687,
- 999, 1687, 1687, 999, 1009, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1009, 1687, 1687, 1687, 1687, 1687,
- 1009, 1687, 1687, 1009, 1018, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1018, 1687, 1687, 1687, 1687, 1687,
- 1018, 1687, 1687, 1018, 470, 470, 470, 470, 470, 470,
- 470, 470, 470, 470, 470, 470, 470, 470, 1687, 470,
-
- 470, 470, 470, 470, 470, 470, 470, 470, 264, 1687,
- 264, 264, 1687, 264, 1687, 264, 1687, 264, 264, 1687,
- 264, 264, 264, 264, 264, 264, 264, 264, 264, 1687,
- 264, 904, 904, 904, 904, 904, 904, 904, 904, 904,
- 904, 904, 904, 904, 904, 1687, 904, 904, 904, 904,
- 904, 904, 904, 904, 904, 527, 527, 527, 527, 527,
- 527, 527, 527, 527, 527, 527, 527, 527, 527, 1687,
- 527, 527, 527, 527, 527, 527, 527, 527, 527, 323,
- 1687, 323, 1687, 1687, 1687, 323, 1687, 1687, 323, 323,
- 323, 323, 323, 323, 323, 323, 1687, 323, 775, 1687,
-
- 1687, 775, 1687, 775, 1687, 775, 775, 1687, 775, 1687,
- 1687, 1687, 775, 775, 775, 775, 775, 775, 775, 1117,
- 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
- 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117,
- 1117, 1117, 1117, 965, 965, 965, 965, 965, 965, 965,
- 965, 965, 965, 965, 965, 965, 965, 965, 965, 965,
- 965, 965, 965, 965, 965, 965, 965, 352, 352, 352,
- 352, 352, 352, 352, 352, 352, 352, 352, 352, 352,
- 352, 1687, 352, 352, 352, 352, 352, 352, 352, 352,
- 352, 160, 1687, 1687, 160, 1687, 1687, 1687, 1687, 1687,
-
- 1687, 160, 1687, 160, 160, 160, 160, 160, 160, 160,
- 160, 160, 1687, 160, 1107, 1687, 1687, 1687, 1687, 1107,
- 1107, 1107, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108,
- 1108, 1108, 1108, 1108, 1108, 1108, 1687, 1108, 1108, 1108,
- 1108, 1108, 1108, 1108, 1108, 1108, 1245, 1245, 1245, 1245,
- 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
- 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245, 1245,
- 414, 1687, 1687, 414, 414, 414, 414, 414, 414, 414,
- 414, 1687, 414, 1149, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1149, 1687, 1687, 1687, 1687, 1149, 1149,
-
- 1149, 1687, 1149, 1154, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1154, 1687, 1687, 1687, 1687, 1154, 1154,
- 1154, 1687, 1154, 1159, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1159, 1687, 1687, 1687, 1687, 1159, 1159,
- 1159, 1687, 1159, 470, 470, 470, 470, 470, 470, 470,
- 470, 470, 470, 470, 470, 470, 470, 1687, 470, 470,
- 470, 470, 470, 470, 470, 470, 470, 264, 1687, 264,
- 264, 1687, 264, 1687, 264, 1687, 264, 264, 1687, 264,
- 264, 264, 264, 264, 264, 264, 264, 264, 1687, 264,
- 904, 904, 904, 904, 904, 904, 904, 904, 904, 904,
-
- 904, 904, 904, 904, 1687, 904, 904, 904, 904, 904,
- 904, 904, 904, 904, 527, 527, 527, 527, 527, 527,
- 527, 527, 527, 527, 527, 527, 527, 527, 1687, 527,
- 527, 527, 527, 527, 527, 527, 527, 527, 323, 1687,
- 1687, 1687, 323, 1687, 323, 1687, 1687, 1687, 323, 1687,
- 1687, 323, 323, 323, 323, 323, 323, 323, 323, 1687,
- 323, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349,
- 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349, 1349,
- 1349, 1349, 1349, 1349, 1349, 1426, 1426, 1426, 1426, 1426,
- 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426,
-
- 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1438,
- 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438,
- 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438,
- 1438, 1438, 1438, 760, 760, 760, 760, 760, 760, 760,
- 760, 760, 760, 760, 760, 760, 760, 1687, 760, 760,
- 760, 760, 760, 760, 760, 760, 760, 1507, 1507, 1507,
- 1507, 1507, 1507, 1507, 1507, 1507, 1507, 1507, 1507, 1507,
- 1507, 1507, 1507, 1507, 1507, 1507, 1507, 1507, 1507, 1507,
- 1507, 926, 926, 926, 926, 926, 926, 926, 926, 926,
- 926, 926, 926, 926, 926, 1687, 926, 926, 926, 926,
-
- 926, 926, 926, 926, 926, 1530, 1530, 1530, 1530, 1530,
- 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530,
- 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1565,
- 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1565,
- 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1565,
- 1565, 1565, 1565, 1584, 1584, 1584, 1584, 1584, 1584, 1584,
- 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584,
- 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1661, 1661, 1661,
- 1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661,
- 1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661, 1661,
-
- 1661, 1675, 1675, 1675, 1675, 1675, 1675, 1675, 1675, 1675,
- 1675, 1675, 1675, 1675, 1675, 1675, 1675, 1675, 1675, 1675,
- 1675, 1675, 1675, 1675, 1675, 15, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687
- } ;
-
-static yyconst short int yy_chk[14289] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 3, 3, 32, 32, 3, 3, 13, 14,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 5, 5,
- 3, 5, 6, 6, 19, 6, 13, 14, 31, 34,
-
- 34, 19, 19, 19, 124, 19, 19, 66, 66, 68,
- 68, 124, 19, 87, 87, 296, 19, 19, 296, 3,
- 31, 3, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
-
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 11, 11, 125, 11,
- 25, 25, 125, 25, 74, 206, 25, 89, 89, 25,
- 80, 100, 100, 11, 123, 123, 25, 206, 25, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 27, 417, 27, 27, 27,
-
- 27, 27, 27, 27, 29, 29, 29, 29, 29, 29,
- 29, 74, 63, 96, 27, 27, 27, 80, 27, 27,
- 37, 96, 96, 417, 38, 27, 151, 151, 37, 27,
- 27, 27, 38, 27, 63, 27, 30, 419, 30, 30,
- 30, 30, 30, 30, 30, 37, 39, 1681, 37, 38,
- 85, 199, 38, 133, 39, 40, 30, 43, 419, 30,
- 105, 105, 39, 40, 99, 43, 30, 105, 38, 38,
- 133, 39, 85, 199, 39, 99, 99, 99, 30, 41,
- 40, 44, 43, 40, 204, 43, 42, 41, 202, 44,
- 106, 106, 39, 39, 42, 40, 204, 43, 106, 43,
-
- 45, 40, 40, 204, 41, 202, 44, 41, 45, 44,
- 46, 42, 103, 44, 42, 41, 103, 103, 46, 209,
- 42, 1676, 47, 94, 44, 45, 101, 46, 45, 42,
- 47, 48, 49, 42, 45, 46, 101, 101, 46, 48,
- 49, 50, 209, 207, 45, 213, 421, 47, 1674, 50,
- 47, 94, 94, 94, 94, 207, 48, 49, 228, 48,
- 49, 421, 47, 48, 51, 97, 50, 213, 137, 50,
- 48, 48, 51, 52, 97, 97, 97, 48, 97, 102,
- 48, 52, 98, 49, 98, 137, 98, 98, 999, 51,
- 95, 134, 51, 50, 95, 95, 95, 95, 52, 135,
-
- 51, 52, 137, 128, 51, 108, 102, 102, 134, 52,
- 54, 128, 54, 108, 108, 228, 135, 128, 54, 134,
- 54, 203, 54, 54, 999, 54, 54, 54, 54, 54,
- 54, 54, 218, 218, 135, 245, 245, 54, 999, 203,
- 203, 54, 54, 54, 54, 54, 54, 54, 54, 54,
- 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
- 54, 54, 54, 54, 54, 54, 54, 55, 205, 247,
- 247, 248, 248, 107, 55, 55, 55, 107, 55, 55,
- 231, 107, 107, 205, 158, 55, 879, 205, 879, 55,
- 55, 59, 158, 59, 59, 59, 59, 59, 59, 59,
-
- 61, 61, 61, 61, 61, 61, 61, 62, 81, 158,
- 81, 81, 81, 81, 81, 81, 81, 136, 138, 215,
- 62, 323, 62, 62, 62, 62, 62, 62, 62, 62,
- 71, 71, 1666, 71, 136, 138, 71, 231, 323, 71,
- 62, 215, 220, 62, 139, 226, 71, 76, 71, 136,
- 62, 265, 265, 138, 76, 76, 76, 490, 76, 76,
- 145, 139, 62, 64, 220, 76, 490, 226, 145, 76,
- 76, 235, 139, 64, 145, 64, 64, 145, 64, 64,
- 64, 64, 64, 64, 64, 83, 83, 83, 83, 83,
- 83, 83, 84, 235, 84, 84, 636, 84, 84, 84,
-
- 214, 483, 84, 140, 84, 84, 84, 84, 84, 84,
- 84, 84, 84, 84, 84, 160, 84, 84, 84, 483,
- 140, 164, 214, 160, 636, 84, 175, 84, 84, 164,
- 320, 84, 84, 320, 175, 84, 214, 140, 387, 84,
- 160, 84, 387, 160, 267, 267, 164, 84, 304, 164,
- 84, 175, 84, 92, 175, 92, 286, 286, 92, 92,
- 304, 92, 175, 92, 304, 92, 164, 92, 141, 141,
- 141, 141, 141, 141, 141, 104, 418, 92, 92, 92,
- 418, 92, 104, 104, 338, 338, 327, 104, 104, 104,
- 420, 109, 104, 109, 420, 326, 109, 109, 109, 109,
-
- 109, 109, 109, 327, 149, 149, 149, 149, 149, 149,
- 149, 92, 326, 92, 93, 423, 93, 385, 385, 93,
- 93, 327, 93, 423, 93, 149, 93, 216, 93, 150,
- 150, 150, 150, 150, 150, 150, 326, 163, 93, 93,
- 93, 1665, 93, 325, 349, 163, 152, 625, 152, 216,
- 150, 152, 152, 152, 152, 152, 152, 152, 93, 93,
- 325, 165, 163, 216, 325, 163, 349, 404, 404, 165,
- 386, 625, 93, 166, 93, 161, 422, 386, 406, 406,
- 422, 166, 165, 161, 163, 161, 165, 161, 161, 165,
- 161, 161, 161, 161, 161, 161, 161, 161, 166, 167,
-
- 271, 166, 208, 1383, 168, 169, 208, 167, 271, 170,
- 171, 172, 168, 169, 208, 173, 1383, 170, 171, 172,
- 208, 407, 407, 173, 167, 271, 730, 167, 166, 168,
- 169, 167, 168, 169, 170, 171, 172, 170, 171, 172,
- 173, 170, 174, 173, 176, 331, 395, 426, 177, 169,
- 174, 730, 176, 168, 172, 426, 177, 178, 173, 428,
- 328, 171, 331, 176, 176, 178, 416, 174, 395, 176,
- 174, 179, 176, 177, 174, 434, 177, 328, 428, 179,
- 180, 182, 178, 416, 331, 178, 181, 330, 180, 182,
- 183, 177, 402, 1662, 181, 402, 179, 434, 183, 179,
-
- 328, 181, 184, 178, 330, 180, 182, 424, 180, 182,
- 184, 181, 180, 185, 181, 183, 329, 186, 183, 632,
- 179, 185, 330, 187, 424, 186, 182, 184, 188, 409,
- 184, 187, 409, 329, 632, 183, 188, 237, 185, 189,
- 488, 185, 186, 827, 402, 186, 190, 189, 187, 185,
- 329, 187, 488, 188, 190, 191, 188, 186, 184, 237,
- 186, 425, 192, 191, 189, 390, 827, 189, 1651, 187,
- 192, 190, 237, 390, 190, 188, 237, 497, 425, 390,
- 191, 409, 189, 191, 194, 194, 194, 192, 194, 194,
- 192, 442, 442, 497, 477, 194, 192, 716, 191, 194,
-
- 194, 190, 195, 197, 197, 197, 197, 197, 197, 197,
- 547, 547, 195, 716, 195, 195, 477, 195, 195, 195,
- 195, 195, 195, 195, 196, 498, 196, 196, 196, 196,
- 196, 196, 196, 211, 211, 211, 211, 211, 211, 211,
- 244, 249, 498, 196, 196, 196, 438, 196, 196, 427,
- 244, 249, 244, 249, 196, 244, 249, 828, 196, 196,
- 198, 427, 198, 345, 427, 198, 198, 828, 438, 198,
- 198, 345, 198, 198, 198, 198, 198, 198, 198, 198,
- 198, 198, 251, 482, 198, 198, 198, 353, 345, 438,
- 482, 485, 251, 198, 251, 353, 198, 251, 485, 219,
-
- 1645, 219, 503, 198, 219, 219, 219, 219, 219, 219,
- 219, 514, 353, 526, 503, 198, 489, 353, 198, 514,
- 198, 217, 223, 489, 223, 223, 223, 223, 223, 223,
- 223, 217, 526, 217, 217, 1629, 217, 217, 217, 217,
- 217, 217, 217, 224, 224, 224, 224, 224, 224, 224,
- 225, 675, 225, 225, 225, 225, 225, 225, 225, 233,
- 233, 233, 233, 233, 233, 233, 1629, 500, 501, 554,
- 225, 628, 501, 225, 500, 675, 229, 628, 229, 439,
- 225, 229, 229, 229, 229, 229, 229, 229, 232, 530,
- 232, 554, 225, 232, 232, 232, 232, 232, 232, 232,
-
- 236, 236, 439, 236, 236, 236, 530, 1631, 236, 439,
- 236, 530, 236, 236, 236, 236, 236, 236, 236, 236,
- 435, 439, 236, 236, 236, 303, 303, 303, 303, 303,
- 303, 303, 357, 236, 236, 435, 435, 1630, 236, 697,
- 357, 647, 435, 697, 250, 236, 250, 236, 528, 250,
- 250, 250, 250, 250, 250, 250, 236, 357, 236, 253,
- 357, 253, 253, 647, 253, 253, 253, 528, 698, 253,
- 630, 253, 698, 253, 305, 305, 305, 305, 305, 305,
- 305, 253, 630, 253, 253, 253, 339, 339, 339, 339,
- 339, 339, 339, 516, 253, 633, 360, 602, 253, 253,
-
- 602, 516, 305, 633, 360, 337, 253, 337, 253, 877,
- 337, 337, 337, 337, 337, 337, 337, 253, 305, 253,
- 264, 360, 264, 518, 360, 264, 264, 516, 264, 877,
- 264, 518, 264, 696, 264, 340, 340, 340, 340, 340,
- 340, 340, 696, 360, 264, 264, 264, 346, 264, 346,
- 346, 346, 346, 346, 346, 346, 347, 347, 347, 347,
- 347, 347, 347, 518, 608, 608, 987, 354, 393, 393,
- 393, 393, 393, 393, 393, 354, 1628, 408, 264, 408,
- 264, 266, 408, 408, 408, 408, 408, 408, 408, 266,
- 987, 266, 354, 266, 266, 354, 266, 266, 266, 266,
-
- 266, 266, 266, 266, 643, 643, 266, 270, 627, 270,
- 354, 447, 270, 270, 355, 270, 356, 270, 358, 270,
- 359, 270, 355, 447, 356, 627, 358, 447, 359, 522,
- 361, 270, 270, 270, 767, 270, 356, 522, 361, 355,
- 634, 356, 355, 358, 356, 359, 358, 634, 359, 367,
- 367, 370, 629, 480, 359, 361, 767, 367, 361, 370,
- 367, 480, 515, 358, 522, 270, 355, 270, 272, 629,
- 515, 694, 367, 480, 367, 361, 370, 367, 272, 370,
- 272, 272, 694, 272, 272, 272, 272, 272, 272, 272,
- 348, 362, 348, 348, 348, 348, 348, 348, 348, 362,
-
- 365, 370, 1606, 637, 517, 480, 363, 515, 365, 520,
- 348, 451, 517, 348, 363, 637, 362, 520, 712, 362,
- 348, 451, 364, 451, 712, 365, 451, 362, 365, 366,
- 364, 363, 348, 350, 363, 350, 350, 366, 350, 350,
- 350, 350, 350, 350, 350, 365, 363, 364, 368, 517,
- 364, 703, 520, 369, 366, 525, 368, 366, 703, 371,
- 372, 369, 364, 525, 649, 649, 373, 371, 372, 524,
- 680, 374, 366, 368, 373, 372, 368, 524, 369, 374,
- 368, 369, 375, 890, 371, 372, 369, 371, 372, 890,
- 375, 373, 376, 377, 373, 525, 374, 371, 680, 374,
-
- 376, 377, 373, 378, 673, 379, 374, 375, 487, 673,
- 375, 378, 535, 379, 380, 381, 487, 376, 377, 529,
- 376, 377, 380, 381, 1605, 524, 382, 383, 378, 535,
- 379, 378, 375, 379, 382, 383, 529, 376, 819, 380,
- 381, 535, 380, 381, 378, 379, 452, 631, 487, 377,
- 380, 382, 383, 819, 382, 383, 452, 529, 452, 484,
- 487, 452, 382, 429, 631, 429, 381, 484, 429, 429,
- 429, 429, 429, 429, 429, 679, 679, 1604, 383, 392,
- 679, 392, 392, 392, 392, 392, 392, 392, 431, 889,
- 431, 431, 431, 431, 431, 431, 431, 519, 392, 392,
-
- 392, 658, 392, 392, 692, 519, 484, 889, 521, 392,
- 523, 484, 692, 392, 392, 394, 521, 394, 523, 707,
- 394, 394, 707, 658, 532, 394, 532, 394, 394, 394,
- 394, 394, 394, 394, 394, 394, 394, 457, 821, 394,
- 394, 394, 519, 532, 521, 658, 493, 457, 394, 457,
- 533, 394, 457, 821, 493, 523, 463, 635, 394, 432,
- 432, 432, 432, 432, 432, 432, 463, 533, 463, 891,
- 394, 463, 536, 394, 635, 394, 396, 533, 396, 493,
- 536, 396, 396, 685, 685, 396, 396, 891, 396, 396,
- 396, 396, 396, 396, 396, 396, 396, 396, 493, 1293,
-
- 396, 396, 396, 436, 436, 436, 436, 436, 436, 436,
- 534, 531, 396, 709, 1293, 536, 660, 691, 709, 396,
- 440, 440, 440, 440, 440, 440, 440, 534, 531, 677,
- 677, 396, 531, 702, 396, 677, 396, 397, 660, 397,
- 731, 440, 397, 397, 702, 691, 397, 397, 534, 397,
- 437, 397, 397, 397, 397, 397, 397, 397, 397, 731,
- 660, 397, 397, 397, 575, 437, 437, 437, 437, 437,
- 437, 437, 437, 397, 575, 441, 441, 441, 441, 441,
- 441, 441, 443, 774, 443, 1603, 575, 443, 443, 443,
- 443, 443, 443, 443, 695, 397, 441, 397, 398, 699,
-
- 398, 486, 695, 398, 398, 774, 704, 699, 398, 486,
- 398, 701, 398, 446, 446, 446, 446, 446, 446, 446,
- 701, 1585, 398, 398, 398, 706, 448, 448, 448, 448,
- 448, 448, 448, 450, 704, 450, 706, 486, 450, 450,
- 450, 450, 450, 450, 450, 453, 453, 453, 453, 453,
- 453, 453, 715, 486, 448, 715, 398, 838, 398, 430,
- 458, 458, 458, 458, 458, 458, 458, 747, 747, 430,
- 448, 430, 430, 838, 430, 430, 430, 430, 430, 430,
- 430, 433, 1583, 433, 433, 433, 433, 433, 433, 433,
- 461, 461, 461, 461, 461, 461, 461, 700, 708, 887,
-
- 710, 433, 711, 820, 433, 700, 708, 710, 887, 711,
- 820, 433, 462, 462, 462, 462, 462, 462, 462, 754,
- 754, 831, 831, 433, 454, 464, 464, 464, 464, 464,
- 464, 464, 475, 475, 475, 475, 475, 475, 475, 454,
- 454, 454, 454, 454, 454, 454, 454, 474, 494, 474,
- 474, 474, 474, 474, 474, 474, 494, 492, 495, 823,
- 1562, 718, 496, 491, 491, 492, 495, 454, 454, 718,
- 496, 491, 826, 662, 491, 822, 826, 496, 823, 454,
- 456, 456, 822, 456, 456, 456, 491, 880, 456, 492,
- 456, 499, 456, 456, 456, 662, 495, 504, 494, 499,
-
- 494, 824, 456, 456, 456, 504, 664, 880, 824, 492,
- 495, 502, 506, 456, 496, 491, 505, 662, 456, 502,
- 506, 507, 513, 544, 505, 456, 1051, 456, 664, 507,
- 513, 1561, 734, 504, 734, 825, 456, 744, 456, 459,
- 1051, 499, 825, 499, 867, 744, 544, 666, 506, 504,
- 664, 734, 502, 544, 459, 459, 459, 459, 459, 459,
- 459, 459, 713, 502, 506, 544, 867, 505, 505, 666,
- 713, 905, 507, 507, 513, 541, 541, 541, 541, 541,
- 541, 541, 459, 459, 542, 542, 542, 542, 542, 542,
- 542, 666, 905, 878, 459, 465, 763, 545, 545, 545,
-
- 545, 545, 545, 545, 763, 713, 881, 881, 668, 878,
- 465, 465, 465, 465, 465, 465, 465, 465, 545, 546,
- 546, 546, 546, 546, 546, 546, 548, 883, 548, 883,
- 668, 548, 548, 548, 548, 548, 548, 548, 465, 465,
- 546, 551, 1560, 551, 551, 551, 551, 551, 551, 551,
- 465, 467, 668, 467, 467, 902, 467, 467, 467, 882,
- 882, 467, 735, 467, 735, 467, 467, 467, 467, 467,
- 467, 467, 467, 467, 776, 467, 467, 467, 886, 886,
- 902, 735, 776, 467, 467, 467, 467, 467, 467, 874,
- 467, 467, 888, 884, 467, 888, 735, 738, 467, 738,
-
- 467, 552, 552, 552, 552, 552, 552, 552, 938, 467,
- 1303, 467, 471, 884, 471, 558, 738, 471, 471, 561,
- 471, 564, 471, 558, 471, 1303, 471, 561, 738, 564,
- 938, 705, 874, 565, 922, 922, 471, 471, 471, 705,
- 558, 565, 471, 566, 561, 558, 564, 561, 565, 564,
- 893, 566, 568, 893, 567, 945, 945, 829, 565, 561,
- 568, 565, 567, 705, 564, 829, 1195, 863, 566, 1195,
- 471, 566, 471, 472, 705, 863, 991, 568, 566, 567,
- 568, 472, 567, 472, 568, 472, 472, 871, 472, 472,
- 472, 472, 472, 472, 472, 472, 473, 567, 991, 570,
-
- 1050, 988, 871, 871, 473, 988, 473, 570, 473, 473,
- 1050, 473, 473, 473, 473, 473, 473, 473, 473, 476,
- 571, 569, 572, 736, 570, 736, 993, 570, 571, 569,
- 572, 1559, 476, 570, 476, 476, 476, 476, 476, 476,
- 476, 1000, 736, 573, 993, 571, 569, 572, 571, 569,
- 572, 573, 476, 912, 990, 476, 569, 908, 990, 908,
- 992, 912, 476, 617, 992, 736, 617, 571, 573, 572,
- 1054, 573, 617, 617, 476, 478, 908, 478, 573, 1595,
- 478, 478, 574, 478, 577, 478, 576, 478, 1054, 478,
- 574, 1000, 577, 1378, 576, 1595, 578, 580, 579, 478,
-
- 478, 478, 907, 478, 578, 580, 579, 574, 1378, 577,
- 574, 576, 577, 579, 576, 617, 577, 574, 478, 907,
- 576, 578, 580, 579, 578, 580, 579, 907, 1004, 580,
- 965, 581, 578, 478, 1385, 478, 479, 1144, 479, 581,
- 1385, 479, 479, 582, 479, 585, 479, 583, 479, 584,
- 479, 582, 965, 585, 1144, 583, 581, 584, 965, 581,
- 479, 479, 479, 581, 479, 1010, 795, 795, 582, 1536,
- 585, 582, 583, 585, 584, 583, 818, 584, 1004, 818,
- 1535, 585, 586, 582, 587, 818, 818, 584, 479, 795,
- 586, 909, 587, 640, 479, 795, 479, 553, 583, 553,
-
- 553, 553, 553, 553, 553, 553, 588, 586, 909, 587,
- 586, 914, 587, 1396, 588, 1010, 640, 553, 586, 914,
- 553, 931, 931, 640, 989, 909, 1396, 553, 818, 1002,
- 1002, 588, 989, 587, 588, 640, 931, 1012, 1012, 553,
- 560, 560, 560, 560, 560, 560, 560, 560, 560, 560,
- 560, 560, 560, 560, 560, 560, 560, 560, 560, 560,
- 560, 560, 560, 560, 560, 560, 560, 560, 560, 1534,
- 560, 560, 560, 560, 560, 560, 560, 560, 560, 560,
- 560, 560, 560, 560, 560, 560, 560, 560, 560, 560,
- 560, 560, 560, 560, 560, 560, 560, 560, 560, 560,
-
- 560, 560, 562, 1021, 1021, 589, 740, 1049, 740, 1040,
- 562, 1049, 562, 589, 562, 562, 1477, 562, 562, 562,
- 562, 562, 562, 562, 885, 740, 590, 562, 563, 892,
- 589, 1040, 885, 589, 590, 740, 563, 892, 563, 1531,
- 563, 563, 1477, 563, 563, 563, 563, 563, 563, 563,
- 609, 590, 609, 563, 590, 609, 609, 609, 609, 609,
- 609, 609, 618, 618, 618, 618, 618, 618, 618, 1033,
- 1033, 1311, 590, 604, 1001, 604, 885, 1014, 604, 604,
- 1311, 892, 1520, 604, 1033, 604, 604, 604, 604, 604,
- 604, 604, 604, 604, 604, 1019, 1508, 604, 604, 604,
-
- 619, 619, 619, 619, 619, 619, 619, 672, 1300, 604,
- 1001, 910, 613, 910, 613, 672, 604, 613, 613, 613,
- 613, 613, 613, 613, 1001, 844, 1506, 1014, 604, 1300,
- 910, 604, 672, 604, 605, 1007, 605, 672, 1023, 605,
- 605, 1380, 910, 1380, 605, 1019, 605, 844, 605, 605,
- 605, 605, 605, 605, 605, 605, 639, 1007, 605, 605,
- 605, 638, 638, 638, 638, 638, 638, 638, 844, 844,
- 605, 639, 639, 639, 639, 639, 639, 639, 639, 1007,
- 1052, 641, 641, 641, 641, 641, 641, 641, 1023, 1066,
- 1052, 911, 605, 1066, 605, 610, 970, 610, 778, 1055,
-
- 610, 610, 641, 1379, 1055, 610, 778, 610, 911, 610,
- 642, 642, 642, 642, 642, 642, 642, 1495, 970, 610,
- 610, 610, 1310, 778, 970, 911, 778, 644, 1379, 644,
- 778, 642, 644, 644, 644, 644, 644, 644, 644, 648,
- 970, 648, 850, 1310, 648, 648, 648, 648, 648, 648,
- 648, 1056, 1056, 610, 1386, 610, 620, 1388, 620, 770,
- 1494, 620, 620, 1388, 850, 620, 620, 770, 620, 1386,
- 620, 620, 620, 620, 620, 620, 620, 620, 1064, 1064,
- 620, 620, 620, 1493, 770, 850, 850, 770, 620, 620,
- 620, 620, 620, 620, 1009, 1011, 770, 1104, 1104, 620,
-
- 650, 650, 650, 650, 650, 650, 650, 651, 651, 651,
- 651, 651, 651, 651, 620, 1593, 620, 656, 656, 656,
- 656, 656, 656, 656, 657, 657, 1065, 657, 657, 657,
- 1009, 1011, 657, 1065, 657, 1593, 657, 657, 657, 657,
- 657, 657, 657, 657, 1009, 1011, 657, 657, 657, 748,
- 748, 748, 748, 748, 748, 748, 1085, 657, 682, 1129,
- 1125, 1382, 657, 1382, 1085, 739, 1398, 739, 1125, 657,
- 684, 657, 1398, 682, 682, 682, 682, 682, 682, 682,
- 657, 1129, 657, 659, 739, 684, 684, 684, 684, 684,
- 684, 684, 1492, 659, 682, 659, 659, 1016, 659, 659,
-
- 659, 659, 659, 659, 659, 663, 684, 739, 749, 749,
- 749, 749, 749, 749, 749, 663, 1142, 663, 663, 1016,
- 663, 663, 663, 663, 663, 663, 663, 667, 1143, 1480,
- 751, 1074, 1384, 1074, 1384, 856, 1143, 667, 1142, 667,
- 667, 1016, 667, 667, 667, 667, 667, 667, 667, 670,
- 1074, 670, 670, 751, 670, 670, 670, 856, 1018, 670,
- 751, 670, 1392, 670, 670, 670, 670, 670, 670, 670,
- 670, 670, 751, 670, 670, 670, 1467, 1163, 856, 856,
- 1297, 670, 670, 670, 670, 670, 670, 1392, 670, 670,
- 1297, 942, 670, 1071, 1018, 686, 670, 686, 670, 1163,
-
- 686, 686, 686, 686, 686, 686, 686, 670, 1018, 670,
- 671, 1465, 671, 671, 942, 671, 671, 671, 1071, 1020,
- 671, 942, 671, 1071, 671, 752, 752, 752, 752, 752,
- 752, 752, 671, 942, 671, 671, 671, 765, 765, 765,
- 765, 765, 765, 765, 1298, 671, 752, 1473, 1464, 671,
- 671, 1393, 765, 1393, 1298, 1020, 746, 671, 746, 671,
- 1473, 746, 746, 746, 746, 746, 746, 746, 671, 1020,
- 671, 678, 678, 678, 678, 678, 678, 678, 678, 678,
- 678, 678, 678, 678, 678, 678, 678, 678, 678, 678,
- 678, 678, 678, 678, 678, 678, 678, 678, 678, 678,
-
- 1463, 678, 678, 678, 678, 678, 678, 678, 678, 678,
- 678, 678, 678, 678, 678, 678, 678, 678, 678, 678,
- 678, 678, 678, 678, 678, 678, 678, 678, 678, 678,
- 678, 678, 678, 681, 753, 753, 753, 753, 753, 753,
- 753, 1381, 1090, 1090, 1097, 1097, 681, 1462, 681, 681,
- 681, 681, 681, 681, 681, 753, 755, 1090, 755, 1097,
- 1381, 755, 755, 755, 755, 755, 755, 755, 1026, 681,
- 1165, 1165, 1172, 1172, 1227, 764, 681, 764, 764, 764,
- 764, 764, 764, 764, 1404, 1165, 1072, 1172, 681, 689,
- 1026, 689, 764, 1404, 689, 689, 1227, 689, 1395, 689,
-
- 1395, 689, 771, 689, 771, 771, 771, 771, 771, 771,
- 771, 1072, 1026, 689, 689, 689, 1072, 689, 772, 772,
- 772, 772, 772, 772, 772, 810, 1387, 810, 1680, 689,
- 810, 810, 810, 810, 810, 810, 810, 1680, 777, 1117,
- 1069, 1387, 1397, 779, 1397, 780, 777, 689, 1069, 689,
- 690, 779, 690, 780, 1069, 690, 690, 781, 690, 1132,
- 690, 1117, 690, 777, 690, 781, 777, 1117, 779, 782,
- 780, 779, 1057, 780, 690, 690, 690, 782, 690, 779,
- 1057, 1132, 781, 1223, 783, 781, 1394, 1132, 786, 781,
- 777, 1223, 783, 690, 782, 780, 786, 782, 812, 812,
-
- 812, 812, 812, 812, 812, 1394, 1201, 1461, 690, 783,
- 690, 717, 783, 786, 1469, 1201, 786, 1201, 1469, 717,
- 782, 717, 1057, 717, 717, 1354, 717, 717, 717, 717,
- 717, 717, 717, 1354, 1201, 783, 717, 733, 733, 733,
- 733, 733, 733, 733, 733, 733, 733, 733, 733, 733,
- 733, 733, 733, 733, 733, 733, 733, 733, 733, 733,
- 733, 733, 733, 733, 733, 733, 1460, 733, 733, 733,
- 733, 733, 733, 733, 733, 733, 733, 733, 733, 733,
- 733, 733, 733, 733, 733, 733, 733, 733, 733, 733,
- 733, 733, 733, 733, 733, 733, 733, 733, 733, 762,
-
- 762, 762, 762, 762, 762, 762, 762, 762, 762, 762,
- 762, 762, 762, 762, 762, 762, 762, 762, 762, 762,
- 762, 762, 762, 762, 762, 762, 762, 762, 1459, 762,
- 762, 762, 762, 762, 762, 762, 762, 762, 762, 762,
- 762, 762, 762, 762, 762, 762, 762, 762, 762, 762,
- 762, 762, 762, 762, 762, 762, 762, 762, 762, 762,
- 762, 766, 785, 766, 766, 766, 766, 766, 766, 766,
- 785, 793, 794, 794, 1213, 1213, 1294, 1475, 766, 793,
- 794, 766, 1475, 1257, 766, 1272, 1272, 785, 1307, 1213,
- 785, 766, 1294, 1294, 785, 794, 793, 794, 1307, 793,
-
- 1272, 794, 1443, 766, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 1257, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 768, 768, 768, 768, 768, 768, 768,
- 768, 768, 768, 768, 768, 768, 769, 769, 769, 769,
- 769, 769, 769, 769, 769, 769, 769, 769, 769, 769,
- 769, 769, 769, 769, 769, 769, 769, 769, 769, 769,
- 769, 769, 769, 769, 769, 769, 769, 769, 769, 769,
-
- 769, 769, 769, 769, 769, 769, 769, 769, 769, 769,
- 769, 769, 769, 769, 769, 769, 769, 769, 769, 769,
- 769, 769, 769, 769, 769, 769, 769, 769, 773, 784,
- 773, 773, 773, 773, 773, 773, 773, 784, 787, 788,
- 1146, 1260, 915, 915, 789, 1263, 787, 788, 773, 1308,
- 915, 773, 789, 790, 784, 1146, 1146, 784, 773, 1308,
- 791, 790, 1439, 787, 788, 915, 787, 788, 791, 789,
- 773, 915, 789, 916, 916, 792, 796, 1390, 790, 784,
- 1403, 790, 788, 792, 796, 791, 1358, 790, 791, 787,
- 1146, 1260, 1401, 789, 1390, 1263, 916, 1403, 1401, 941,
-
- 792, 796, 916, 792, 796, 1197, 791, 941, 1358, 792,
- 813, 813, 813, 813, 813, 813, 813, 815, 815, 815,
- 815, 815, 815, 815, 941, 796, 811, 941, 811, 951,
- 1197, 811, 811, 1437, 1466, 1197, 811, 951, 811, 941,
- 811, 811, 811, 832, 832, 832, 832, 832, 832, 832,
- 811, 811, 811, 830, 951, 830, 1466, 951, 830, 830,
- 830, 830, 830, 830, 830, 833, 833, 833, 833, 833,
- 833, 833, 835, 835, 835, 835, 835, 835, 835, 951,
- 1391, 1076, 1427, 1076, 811, 1474, 811, 814, 1230, 814,
- 955, 1474, 814, 814, 1399, 1391, 1416, 814, 955, 814,
-
- 1076, 814, 814, 814, 814, 814, 814, 814, 814, 1399,
- 1230, 814, 814, 814, 1400, 955, 1230, 1076, 955, 814,
- 814, 814, 814, 814, 814, 1410, 955, 964, 964, 1400,
- 814, 836, 836, 836, 836, 836, 836, 836, 841, 841,
- 841, 841, 841, 841, 841, 814, 1458, 814, 816, 1482,
- 964, 816, 1479, 1482, 1458, 1471, 964, 816, 816, 816,
- 816, 816, 816, 816, 840, 1471, 840, 840, 840, 840,
- 840, 840, 840, 846, 1479, 846, 846, 846, 846, 846,
- 846, 846, 847, 847, 847, 847, 847, 847, 847, 852,
- 1496, 852, 852, 852, 852, 852, 852, 852, 1496, 1486,
-
- 816, 839, 853, 853, 853, 853, 853, 853, 853, 1236,
- 1488, 839, 1486, 839, 839, 1488, 839, 839, 839, 839,
- 839, 839, 839, 842, 858, 858, 858, 858, 858, 858,
- 858, 1236, 968, 968, 971, 971, 842, 1236, 842, 842,
- 842, 842, 842, 842, 842, 864, 959, 864, 864, 864,
- 864, 864, 864, 864, 959, 968, 842, 971, 1292, 842,
- 1292, 968, 864, 971, 963, 963, 842, 1544, 1292, 1544,
- 1292, 959, 963, 842, 959, 870, 1149, 870, 842, 843,
- 870, 870, 870, 870, 870, 870, 870, 963, 1555, 963,
- 1555, 1377, 843, 963, 843, 843, 843, 843, 843, 843,
-
- 843, 865, 865, 865, 865, 865, 865, 865, 872, 872,
- 872, 872, 872, 872, 872, 843, 865, 873, 1389, 1149,
- 1538, 1487, 843, 1376, 1468, 1538, 1149, 1487, 1389, 843,
- 845, 1389, 873, 873, 873, 873, 873, 873, 873, 1468,
- 845, 1154, 845, 845, 1304, 845, 845, 845, 845, 845,
- 845, 845, 848, 918, 918, 918, 918, 918, 918, 918,
- 1304, 1304, 1077, 1375, 1077, 848, 1545, 848, 848, 848,
- 848, 848, 848, 848, 919, 919, 919, 919, 919, 919,
- 919, 1077, 1470, 1472, 1154, 848, 1295, 1545, 848, 1077,
- 1374, 1154, 972, 966, 966, 848, 1295, 1470, 1472, 1600,
-
- 972, 966, 848, 1295, 921, 1159, 921, 848, 849, 921,
- 921, 921, 921, 921, 921, 921, 966, 972, 966, 1600,
- 972, 849, 966, 849, 849, 849, 849, 849, 849, 849,
- 923, 923, 923, 923, 923, 923, 923, 924, 924, 924,
- 924, 924, 924, 924, 849, 952, 1478, 1484, 1159, 1540,
- 1590, 849, 1590, 952, 1540, 1159, 1478, 1484, 849, 851,
- 960, 943, 943, 943, 943, 943, 943, 943, 960, 851,
- 952, 851, 851, 952, 851, 851, 851, 851, 851, 851,
- 851, 854, 943, 1491, 1373, 960, 1199, 1602, 960, 1082,
- 1082, 1027, 960, 1491, 854, 952, 854, 854, 854, 854,
-
- 854, 854, 854, 1602, 929, 929, 929, 929, 929, 929,
- 929, 1199, 1082, 1027, 854, 1537, 1199, 854, 1082, 929,
- 1539, 953, 1542, 1589, 854, 929, 1027, 1542, 1537, 953,
- 1027, 854, 1075, 1539, 1075, 1027, 854, 855, 944, 944,
- 944, 944, 944, 944, 944, 1589, 953, 1084, 1084, 953,
- 855, 1075, 855, 855, 855, 855, 855, 855, 855, 944,
- 930, 930, 930, 930, 930, 930, 930, 953, 1305, 1372,
- 1084, 954, 1543, 855, 1075, 930, 1084, 1543, 1305, 954,
- 855, 930, 1476, 1371, 946, 1305, 946, 855, 857, 946,
- 946, 946, 946, 946, 946, 946, 954, 1476, 857, 954,
-
- 857, 1556, 1370, 857, 857, 857, 857, 857, 857, 857,
- 857, 954, 935, 1546, 935, 935, 935, 935, 935, 935,
- 935, 1546, 1556, 857, 1296, 1369, 1402, 857, 859, 935,
- 859, 859, 1368, 859, 859, 859, 1402, 1296, 859, 1402,
- 859, 1296, 859, 859, 859, 859, 859, 859, 859, 859,
- 859, 1245, 859, 859, 859, 1120, 1120, 1306, 1081, 1081,
- 859, 859, 859, 859, 859, 859, 1081, 859, 859, 1367,
- 1306, 859, 859, 1245, 1306, 859, 1547, 859, 1120, 1245,
- 1549, 1081, 1547, 859, 1120, 1549, 859, 1081, 859, 861,
- 861, 861, 861, 861, 861, 861, 861, 861, 861, 861,
-
- 861, 861, 861, 861, 861, 861, 861, 861, 861, 861,
- 861, 861, 861, 861, 861, 861, 861, 861, 1366, 861,
- 861, 861, 861, 861, 861, 861, 861, 861, 861, 861,
- 861, 861, 861, 861, 861, 861, 861, 861, 861, 861,
- 861, 861, 861, 861, 861, 861, 861, 861, 861, 861,
- 861, 866, 1490, 866, 866, 866, 866, 866, 866, 866,
- 936, 936, 936, 936, 936, 936, 936, 1302, 866, 1302,
- 1596, 866, 1541, 1552, 866, 936, 1481, 1302, 1490, 1302,
- 1365, 866, 984, 984, 984, 984, 984, 984, 984, 1541,
- 1552, 1481, 1596, 866, 868, 868, 868, 868, 868, 868,
-
- 868, 868, 868, 868, 868, 868, 868, 868, 868, 868,
- 868, 868, 868, 868, 868, 868, 868, 868, 868, 868,
- 868, 868, 868, 1350, 868, 868, 868, 868, 868, 868,
- 868, 868, 868, 868, 868, 868, 868, 868, 868, 868,
- 868, 868, 868, 868, 868, 868, 868, 868, 868, 868,
- 868, 868, 868, 868, 868, 868, 869, 869, 869, 869,
- 869, 869, 869, 869, 869, 869, 869, 869, 869, 869,
- 869, 869, 869, 869, 869, 869, 869, 869, 869, 869,
- 869, 869, 869, 869, 869, 869, 869, 869, 869, 869,
- 869, 869, 869, 869, 869, 869, 869, 869, 869, 869,
-
- 869, 869, 869, 869, 869, 869, 869, 869, 869, 869,
- 869, 869, 869, 869, 869, 869, 869, 869, 875, 1483,
- 875, 1485, 1548, 875, 875, 958, 875, 1550, 875, 961,
- 875, 962, 875, 958, 1483, 1548, 1485, 961, 1339, 962,
- 1550, 1622, 875, 875, 875, 1489, 875, 1062, 1062, 1062,
- 958, 1062, 1062, 958, 961, 875, 962, 961, 1062, 962,
- 1489, 1622, 1062, 1062, 1312, 958, 994, 994, 994, 994,
- 994, 994, 994, 1312, 961, 1312, 875, 1321, 875, 876,
- 1319, 876, 962, 1551, 876, 876, 1151, 876, 1551, 876,
- 1646, 876, 1312, 876, 995, 995, 995, 995, 995, 995,
-
- 995, 1151, 1151, 876, 876, 876, 1003, 876, 1003, 1123,
- 1123, 1003, 1003, 1003, 1003, 1003, 1003, 1003, 1013, 1234,
- 1013, 1646, 1614, 1013, 1013, 1013, 1013, 1013, 1013, 1013,
- 1156, 876, 1123, 1234, 1234, 1314, 1151, 876, 1123, 876,
- 903, 1234, 903, 1553, 1614, 1156, 1156, 1234, 1553, 1022,
- 903, 1022, 903, 1326, 1022, 1022, 1022, 1022, 1022, 1022,
- 1022, 1290, 1557, 1031, 1031, 1031, 1031, 1031, 1031, 1031,
- 1557, 1624, 903, 903, 903, 1326, 903, 903, 1031, 1558,
- 1156, 1326, 1289, 903, 1031, 1558, 1624, 903, 903, 906,
- 906, 906, 906, 906, 906, 906, 906, 906, 906, 906,
-
- 906, 906, 906, 906, 906, 906, 906, 906, 906, 906,
- 906, 906, 906, 906, 906, 906, 906, 906, 906, 906,
- 906, 906, 906, 906, 906, 906, 906, 906, 906, 906,
- 906, 906, 906, 906, 906, 906, 906, 906, 906, 906,
- 906, 906, 906, 906, 906, 906, 906, 906, 906, 906,
- 906, 928, 1110, 928, 928, 928, 928, 928, 928, 928,
- 1110, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 928, 1122,
- 1554, 1592, 1591, 1592, 928, 1554, 1032, 1110, 1591, 1288,
- 1110, 928, 1032, 1038, 1038, 1038, 1038, 1038, 1038, 1038,
- 1594, 1122, 1594, 928, 932, 1287, 932, 1122, 1038, 932,
-
- 932, 932, 932, 932, 932, 932, 1043, 1043, 1043, 1043,
- 1043, 1043, 1043, 1122, 932, 934, 934, 934, 934, 934,
- 934, 934, 1086, 1086, 1086, 1086, 1086, 1086, 1086, 1286,
- 934, 1102, 934, 934, 934, 934, 934, 934, 937, 1102,
- 937, 937, 937, 937, 937, 937, 937, 1087, 1087, 1087,
- 1087, 1087, 1087, 1087, 1044, 937, 1102, 1598, 937, 1102,
- 1597, 937, 1597, 1598, 1599, 1285, 1599, 1102, 937, 1044,
- 1044, 1044, 1044, 1044, 1044, 1044, 1601, 1284, 1601, 1283,
- 937, 939, 939, 939, 939, 939, 939, 939, 939, 939,
- 939, 939, 939, 939, 939, 939, 939, 939, 939, 939,
-
- 939, 939, 939, 939, 939, 939, 939, 939, 939, 939,
- 939, 939, 939, 939, 939, 939, 939, 939, 939, 939,
- 939, 939, 939, 939, 939, 939, 939, 939, 939, 939,
- 939, 939, 939, 939, 939, 939, 939, 939, 939, 939,
- 939, 939, 939, 940, 940, 940, 940, 940, 940, 940,
- 940, 940, 940, 940, 940, 940, 940, 940, 940, 940,
- 940, 940, 940, 940, 940, 940, 940, 940, 940, 940,
- 940, 940, 940, 940, 940, 940, 940, 940, 940, 940,
- 940, 940, 940, 940, 940, 940, 940, 940, 940, 940,
- 940, 940, 940, 940, 940, 940, 940, 940, 940, 940,
-
- 940, 940, 940, 940, 940, 956, 1083, 1083, 1112, 1134,
- 1134, 1205, 1205, 956, 1083, 956, 1112, 956, 956, 1205,
- 956, 956, 956, 956, 956, 956, 956, 1282, 1281, 1083,
- 956, 957, 1134, 1112, 1205, 1083, 1112, 1610, 1134, 957,
- 1205, 957, 1112, 957, 957, 1610, 957, 957, 957, 957,
- 957, 957, 957, 1280, 1278, 1277, 957, 969, 969, 969,
- 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
- 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
- 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
- 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
-
- 969, 969, 969, 969, 969, 969, 969, 969, 969, 969,
- 969, 969, 969, 969, 969, 969, 969, 969, 969, 985,
- 1623, 985, 1625, 1686, 985, 985, 1623, 1276, 1405, 985,
- 1275, 985, 1686, 985, 985, 985, 985, 985, 985, 985,
- 985, 1270, 1625, 985, 985, 985, 1037, 1244, 1037, 1037,
- 1037, 1037, 1037, 1037, 1037, 1091, 1091, 1091, 1091, 1091,
- 1091, 1091, 1405, 1037, 1118, 1118, 1627, 1626, 1405, 1244,
- 1091, 1405, 1118, 1626, 1244, 1244, 1244, 985, 1405, 985,
- 986, 1627, 986, 1264, 1254, 986, 986, 1118, 1253, 1118,
- 986, 1252, 986, 1118, 986, 1092, 1092, 1092, 1092, 1092,
-
- 1092, 1092, 1206, 1206, 986, 986, 986, 1208, 1208, 1231,
- 1092, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1096, 1096,
- 1096, 1096, 1096, 1096, 1096, 1206, 1095, 1299, 1216, 1299,
- 1208, 1206, 1095, 1096, 1211, 1204, 1208, 1299, 986, 1096,
- 986, 998, 1103, 1299, 1103, 1196, 1194, 1103, 1103, 1103,
- 1103, 1103, 1103, 1103, 998, 1193, 998, 998, 998, 998,
- 998, 998, 998, 1105, 1105, 1105, 1105, 1105, 1105, 1105,
- 1106, 1106, 1106, 1106, 1106, 1106, 1106, 998, 1111, 1221,
- 1115, 1192, 1191, 1309, 998, 1309, 1111, 1221, 1115, 1190,
- 1189, 998, 1188, 1309, 1114, 1187, 998, 1008, 1186, 1309,
-
- 1185, 1116, 1114, 1111, 1221, 1115, 1111, 1221, 1115, 1116,
- 1008, 1184, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1114,
- 1248, 1248, 1114, 1115, 1183, 1221, 1116, 1111, 1114, 1116,
- 1217, 1133, 1133, 1008, 1207, 1207, 1411, 1202, 1217, 1133,
- 1008, 1116, 1207, 1248, 1411, 1698, 1202, 1008, 1202, 1248,
- 1698, 1698, 1008, 1017, 1133, 1217, 1133, 1207, 1217, 1182,
- 1133, 1411, 1181, 1207, 1411, 1202, 1017, 1203, 1017, 1017,
- 1017, 1017, 1017, 1017, 1017, 1145, 1203, 1145, 1203, 1217,
- 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1705, 1202, 1017,
- 1407, 1180, 1705, 1705, 1179, 1203, 1017, 1174, 1141, 1407,
-
- 1709, 1407, 1203, 1017, 1140, 1709, 1709, 1139, 1017, 1028,
- 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1138, 1407, 1028,
- 1137, 1028, 1028, 1136, 1028, 1028, 1028, 1028, 1028, 1028,
- 1028, 1029, 1135, 1029, 1029, 1407, 1029, 1029, 1029, 1109,
- 1108, 1029, 1107, 1029, 1099, 1029, 1152, 1152, 1152, 1152,
- 1152, 1152, 1152, 1029, 1080, 1029, 1029, 1029, 1157, 1157,
- 1157, 1157, 1157, 1157, 1157, 1070, 1029, 1148, 1726, 1068,
- 1029, 1029, 1067, 1726, 1726, 1029, 1063, 1060, 1029, 1059,
- 1029, 1058, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1029,
- 1053, 1029, 1030, 1048, 1030, 1030, 1030, 1030, 1030, 1030,
-
- 1030, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1250, 1030,
- 1251, 1251, 1045, 1035, 997, 1030, 1166, 1148, 1150, 983,
- 1150, 982, 1030, 1150, 1150, 1150, 1150, 1150, 1150, 1150,
- 1250, 981, 980, 1251, 1030, 1034, 1250, 1034, 979, 1251,
- 1034, 1034, 1034, 1034, 1034, 1034, 1034, 978, 1153, 977,
- 976, 975, 1250, 974, 973, 1034, 1036, 1036, 1036, 1036,
- 1036, 1036, 1036, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
- 950, 1036, 1320, 1036, 1036, 1036, 1036, 1036, 1036, 1039,
- 1320, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1167, 1167,
- 1167, 1167, 1167, 1167, 1167, 949, 1039, 1320, 1153, 1039,
-
- 1320, 933, 1039, 1167, 927, 1155, 926, 1155, 925, 1039,
- 1155, 1155, 1155, 1155, 1155, 1155, 1155, 1320, 917, 913,
- 904, 1039, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041,
- 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041,
- 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041,
- 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041,
- 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041,
- 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041,
- 1041, 1041, 1041, 1041, 1042, 1042, 1042, 1042, 1042, 1042,
- 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042,
-
- 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042,
- 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042,
- 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042,
- 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042,
- 1042, 1042, 1042, 1042, 1042, 1042, 1046, 1158, 1046, 901,
- 900, 1046, 1046, 899, 1046, 898, 1046, 897, 1046, 896,
- 1046, 1265, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 895,
- 1046, 1046, 1046, 1161, 1046, 1161, 1161, 1161, 1161, 1161,
- 1161, 1161, 894, 1265, 860, 834, 1046, 1170, 1170, 1170,
- 1170, 1170, 1170, 1170, 1733, 809, 808, 1158, 807, 1733,
-
- 1733, 806, 1170, 805, 1046, 1265, 1046, 1047, 1170, 1047,
- 804, 1265, 1047, 1047, 1266, 1047, 803, 1047, 802, 1047,
- 801, 1047, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 800,
- 799, 1047, 1047, 1047, 1345, 1047, 1266, 1171, 1324, 797,
- 1316, 1316, 775, 1171, 1209, 1209, 1209, 1209, 1209, 1209,
- 1209, 761, 1324, 1324, 760, 759, 1345, 1047, 1266, 1209,
- 1324, 758, 1345, 1316, 1266, 1047, 1324, 1047, 1061, 1316,
- 1061, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1061, 750,
- 1061, 745, 743, 742, 741, 1334, 1210, 732, 1214, 1214,
- 1214, 1214, 1214, 1214, 1214, 729, 728, 727, 726, 725,
-
- 1061, 1061, 1061, 1214, 1061, 1061, 724, 1334, 723, 722,
- 721, 1061, 1334, 1334, 1334, 1061, 1061, 1073, 1073, 1073,
- 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073,
- 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073,
- 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073,
- 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073,
- 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073,
- 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1078,
- 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1078, 720, 1078,
- 719, 1078, 1078, 714, 1078, 1078, 1078, 1078, 1078, 1078,
-
- 1078, 1079, 1219, 1219, 1219, 1219, 1219, 1219, 1219, 1079,
- 693, 1079, 687, 1079, 1079, 683, 1079, 1079, 1079, 1079,
- 1079, 1079, 1079, 1089, 676, 1089, 674, 653, 1089, 1089,
- 1089, 1089, 1089, 1089, 1089, 652, 1215, 1215, 1215, 1215,
- 1215, 1215, 1215, 1089, 1093, 1093, 1093, 1093, 1093, 1093,
- 1093, 1215, 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1093,
- 1348, 1093, 1093, 1093, 1093, 1093, 1093, 626, 624, 623,
- 1361, 1336, 1093, 1094, 622, 1094, 1094, 1094, 1094, 1094,
- 1094, 1094, 1348, 1246, 1246, 1336, 1336, 1348, 1348, 1348,
- 1094, 1246, 1361, 1336, 621, 1742, 1094, 616, 1361, 1336,
-
- 1742, 1742, 615, 1094, 1748, 612, 1246, 607, 1246, 1748,
- 1748, 606, 1246, 603, 1755, 1094, 1098, 601, 1098, 1755,
- 1755, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1258, 1258,
- 1258, 1258, 1258, 1258, 1258, 600, 1098, 1100, 1100, 1100,
- 1100, 1100, 1100, 1100, 1261, 1261, 1261, 1261, 1261, 1261,
- 1261, 599, 1100, 598, 1100, 1100, 1100, 1100, 1100, 1100,
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
-
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
- 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1101,
- 1101, 1101, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121,
- 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121,
- 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121,
- 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121,
- 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121,
- 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121,
- 1121, 1121, 1121, 1121, 1124, 1124, 1124, 1124, 1124, 1124,
- 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124,
-
- 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124,
- 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124,
- 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124,
- 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124,
- 1124, 1124, 1124, 1124, 1124, 1124, 1126, 1315, 1315, 597,
- 1349, 1760, 596, 595, 594, 1315, 1760, 1760, 1126, 593,
- 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1256, 1126, 592,
- 1315, 591, 1349, 559, 1126, 1127, 1315, 1349, 1349, 1349,
- 1422, 557, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1127,
- 1127, 1127, 1127, 1127, 1127, 1127, 556, 1127, 555, 540,
-
- 1313, 539, 1422, 1127, 1128, 538, 537, 1432, 1422, 1313,
- 527, 1313, 512, 511, 508, 481, 1128, 1256, 1128, 1128,
- 1128, 1128, 1128, 1128, 1128, 1352, 1128, 1343, 1313, 1432,
- 470, 469, 1128, 468, 1313, 1432, 1128, 466, 460, 1128,
- 1313, 1343, 1343, 1313, 455, 415, 1128, 1352, 414, 1343,
- 1313, 1762, 1352, 1352, 1352, 1343, 1762, 1762, 1128, 1130,
- 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130,
- 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130,
- 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130,
- 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130,
-
- 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130,
- 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130,
- 1130, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
- 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
- 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
- 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
- 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
- 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
- 1131, 1131, 1131, 1160, 1763, 413, 412, 411, 405, 1763,
- 1763, 403, 1259, 1160, 401, 1160, 1160, 399, 1160, 1160,
-
- 1160, 1160, 1160, 1160, 1160, 1162, 391, 1259, 1259, 1259,
- 1259, 1259, 1259, 1259, 1262, 1362, 389, 1425, 1162, 388,
- 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1448, 1262,
- 1262, 1262, 1262, 1262, 1262, 1262, 384, 1362, 1162, 1425,
- 352, 1162, 1259, 351, 1425, 1425, 1425, 1764, 1162, 1162,
- 1448, 344, 1764, 1764, 343, 1162, 1448, 342, 1362, 1362,
- 1162, 1164, 341, 1164, 1262, 1362, 1164, 1164, 1164, 1164,
- 1164, 1164, 1164, 336, 1268, 1268, 1268, 1268, 1268, 1268,
- 1268, 1164, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1268,
- 1269, 1269, 1269, 1269, 1269, 1269, 1269, 1168, 335, 1168,
-
- 1168, 1168, 1168, 1168, 1168, 1269, 334, 333, 1457, 1501,
- 1168, 1169, 332, 1169, 1169, 1169, 1169, 1169, 1169, 1169,
- 1273, 1273, 1273, 1273, 1273, 1273, 1273, 1406, 1169, 324,
- 1457, 1501, 321, 319, 1169, 1273, 1406, 1501, 1406, 318,
- 317, 1169, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 316,
- 315, 314, 1457, 1169, 1173, 1406, 1173, 1274, 1457, 1173,
- 1173, 1173, 1173, 1173, 1173, 1173, 1406, 1317, 1317, 1317,
- 1317, 1317, 1317, 1317, 1173, 1175, 1175, 1175, 1175, 1175,
- 1175, 1175, 1317, 1765, 313, 312, 311, 310, 1765, 1765,
- 1175, 309, 1175, 1175, 1175, 1175, 1175, 1175, 1176, 1176,
-
- 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
- 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
- 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
- 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
- 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
- 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
- 1177, 307, 1177, 306, 302, 1177, 1177, 1514, 1177, 1526,
- 1177, 1351, 1177, 301, 1177, 1318, 1318, 1318, 1318, 1318,
- 1318, 1318, 300, 1409, 1177, 1177, 1177, 299, 1177, 1514,
- 1318, 1526, 1409, 1351, 1409, 1514, 1177, 1526, 1351, 1351,
-
- 1351, 1363, 1363, 1363, 1363, 1363, 1363, 1363, 1767, 298,
- 297, 1409, 295, 1767, 1767, 1351, 1363, 294, 1177, 1775,
- 1177, 1178, 1409, 1178, 1775, 1775, 1178, 1178, 1426, 1178,
- 293, 1178, 292, 1178, 291, 1178, 1364, 1364, 1364, 1364,
- 1364, 1364, 1364, 1408, 1413, 1178, 1178, 1178, 1420, 1178,
- 1426, 1364, 1408, 290, 1408, 1426, 1426, 1426, 1413, 1413,
- 289, 288, 1420, 1420, 1498, 1498, 1413, 287, 285, 1428,
- 1420, 1408, 1413, 1429, 284, 283, 1420, 1565, 282, 1178,
- 1800, 1178, 1198, 281, 1198, 1800, 1800, 1498, 280, 1408,
- 279, 1428, 1198, 1498, 1198, 1429, 1428, 1428, 1428, 1565,
-
- 1429, 1429, 1429, 1807, 278, 1565, 1434, 277, 1807, 1807,
- 1438, 276, 1198, 1428, 1198, 1198, 1198, 275, 1198, 1198,
- 1434, 1434, 1440, 1564, 1564, 1198, 1441, 274, 1434, 1198,
- 1198, 1200, 1438, 1200, 1434, 273, 269, 1438, 1438, 1438,
- 268, 1200, 263, 1200, 1440, 261, 1564, 1574, 1441, 1440,
- 1440, 1440, 1564, 1441, 1441, 1441, 259, 258, 257, 246,
- 243, 1200, 241, 1200, 1200, 1200, 1440, 1200, 1200, 1574,
- 1442, 1809, 238, 234, 1200, 1574, 1809, 1809, 1200, 1200,
- 1212, 1446, 1212, 1456, 212, 1212, 1212, 1212, 1212, 1212,
- 1212, 1212, 1442, 201, 200, 1446, 1446, 1442, 1442, 1442,
-
- 1212, 1224, 1811, 1446, 162, 1456, 1507, 1811, 1811, 1446,
- 1456, 1456, 1456, 1224, 1510, 1224, 1224, 1224, 1224, 1224,
- 1224, 1224, 156, 1224, 155, 148, 147, 146, 1507, 1224,
- 1225, 1497, 1497, 1507, 1507, 1507, 1510, 144, 142, 1497,
- 132, 1510, 1510, 1510, 1225, 1225, 1225, 1225, 1225, 1225,
- 1225, 130, 1225, 129, 1497, 127, 1497, 1835, 1225, 1226,
- 1497, 126, 1835, 1835, 122, 120, 1568, 1568, 1503, 119,
- 1511, 1226, 116, 1226, 1226, 1226, 1226, 1226, 1226, 1226,
- 1515, 1226, 1503, 1503, 1578, 110, 91, 1226, 90, 1568,
- 1503, 1226, 1511, 88, 1226, 1568, 1503, 1511, 1511, 1511,
-
- 78, 1226, 1515, 70, 69, 67, 1578, 1515, 1515, 1515,
- 57, 53, 1578, 1226, 1228, 1228, 1228, 1228, 1228, 1228,
- 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228,
- 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228,
- 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228,
- 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228,
- 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228,
- 1228, 1228, 1228, 1228, 1228, 1228, 1229, 1229, 1229, 1229,
- 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229,
- 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229,
-
- 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229,
- 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229,
- 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229,
- 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1232, 36,
- 1509, 35, 33, 24, 23, 20, 17, 1571, 1571, 1517,
- 1617, 15, 1232, 1232, 1232, 1232, 1232, 1232, 1232, 1570,
- 1232, 0, 1509, 1517, 1517, 0, 1232, 1509, 1509, 1509,
- 1571, 1517, 1617, 1232, 1233, 0, 1571, 1517, 1617, 1529,
- 0, 1570, 0, 1524, 1509, 0, 0, 1570, 1233, 1233,
- 1233, 1233, 1233, 1233, 1233, 1620, 1233, 1524, 1524, 0,
-
- 0, 1529, 1233, 1570, 0, 1524, 1529, 1529, 1529, 1233,
- 1235, 1524, 0, 1530, 1608, 1608, 0, 1620, 0, 1235,
- 0, 1235, 1532, 1620, 1235, 1235, 1235, 1235, 1235, 1235,
- 1235, 0, 1235, 0, 0, 1530, 0, 1608, 1235, 1237,
- 1530, 1530, 1530, 1608, 1532, 0, 0, 0, 0, 1532,
- 1532, 1532, 0, 1237, 1237, 1237, 1237, 1237, 1237, 1237,
- 0, 1237, 0, 0, 0, 0, 1532, 1237, 0, 0,
- 1237, 1237, 1237, 1237, 1237, 1237, 1238, 0, 0, 1533,
- 0, 0, 0, 0, 0, 0, 0, 1575, 1238, 1636,
- 1238, 1238, 1238, 1238, 1238, 1238, 1238, 0, 1238, 0,
-
- 0, 1533, 0, 0, 1238, 1239, 1533, 1533, 1533, 1575,
- 0, 1636, 0, 0, 1575, 1575, 1575, 1636, 0, 1239,
- 1239, 1239, 1239, 1239, 1239, 1239, 0, 1239, 1657, 0,
- 1669, 0, 0, 1239, 1240, 0, 1240, 1240, 1240, 1240,
- 1240, 1240, 1240, 1563, 1563, 1566, 1566, 1580, 0, 0,
- 1657, 1563, 1669, 1566, 1240, 0, 1657, 1240, 1669, 0,
- 0, 1580, 1580, 0, 1240, 1584, 1563, 0, 1566, 1580,
- 1566, 0, 1563, 1684, 1566, 1580, 1240, 1241, 0, 1241,
- 1241, 1241, 1241, 1241, 1241, 1241, 1587, 1584, 0, 1588,
- 0, 0, 1584, 1584, 1584, 1684, 0, 1241, 0, 0,
-
- 1241, 1684, 0, 0, 0, 0, 0, 1241, 1587, 0,
- 0, 1588, 0, 1587, 1587, 1587, 1588, 1588, 1588, 1241,
- 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242,
- 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242,
- 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242,
- 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242,
- 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242,
- 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242,
- 1242, 1242, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249,
- 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249,
-
- 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249,
- 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249,
- 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249,
- 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249,
- 1249, 1249, 1249, 1249, 1271, 1586, 1271, 0, 0, 1271,
- 1271, 1271, 1271, 1271, 1271, 1271, 0, 0, 0, 0,
- 0, 0, 0, 0, 1271, 1322, 0, 1586, 1607, 1607,
- 0, 0, 1586, 1586, 1586, 0, 1607, 1621, 0, 1322,
- 1322, 1322, 1322, 1322, 1322, 1322, 0, 1322, 0, 1586,
- 0, 1607, 0, 1322, 0, 0, 0, 1607, 0, 1621,
-
- 1322, 1323, 0, 0, 1621, 1621, 1621, 0, 0, 0,
- 1634, 0, 1644, 0, 0, 1323, 1323, 1323, 1323, 1323,
- 1323, 1323, 0, 1323, 1634, 1634, 0, 0, 0, 1323,
- 0, 0, 1634, 0, 1644, 0, 1323, 1325, 1634, 1644,
- 1644, 1644, 0, 0, 0, 1660, 1325, 1648, 1325, 1655,
- 0, 1325, 1325, 1325, 1325, 1325, 1325, 1325, 0, 1325,
- 0, 1648, 1648, 1655, 1655, 1325, 1327, 1660, 0, 1648,
- 0, 1655, 1660, 1660, 1660, 1648, 0, 1655, 0, 0,
- 1327, 1327, 1327, 1327, 1327, 1327, 1327, 0, 1327, 0,
- 0, 0, 0, 0, 1327, 0, 0, 1327, 1327, 1327,
-
- 1327, 1327, 1327, 1328, 0, 0, 1661, 0, 0, 0,
- 0, 0, 0, 0, 1663, 1328, 0, 1328, 1328, 1328,
- 1328, 1328, 1328, 1328, 0, 1328, 0, 0, 1661, 0,
- 0, 1328, 1329, 1661, 1661, 1661, 1663, 0, 0, 0,
- 0, 1663, 1663, 1663, 0, 0, 1329, 1329, 1329, 1329,
- 1329, 1329, 1329, 0, 1329, 0, 0, 1671, 1663, 0,
- 1329, 1330, 0, 1330, 1330, 1330, 1330, 1330, 1330, 1330,
- 1664, 1671, 1671, 1675, 0, 0, 0, 0, 0, 1671,
- 0, 1330, 0, 0, 1330, 1671, 0, 0, 0, 0,
- 0, 1330, 1664, 1677, 0, 1675, 0, 1664, 1664, 1664,
-
- 1675, 1675, 1675, 1330, 1331, 0, 1331, 1331, 1331, 1331,
- 1331, 1331, 1331, 1678, 0, 1677, 1679, 0, 0, 0,
- 1677, 1677, 1677, 0, 1331, 0, 0, 1331, 0, 0,
- 0, 0, 0, 0, 1331, 1678, 0, 1677, 1679, 0,
- 1678, 1678, 1678, 1679, 1679, 1679, 1331, 1332, 1332, 1332,
- 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
- 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
- 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
- 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
- 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
-
- 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1335,
- 0, 0, 1685, 0, 0, 0, 0, 0, 1335, 0,
- 1335, 0, 0, 1335, 1335, 1335, 1335, 1335, 1335, 1335,
- 0, 1335, 0, 0, 1685, 0, 0, 1335, 1337, 1685,
- 1685, 1685, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1337, 1337, 1337, 1337, 1337, 1337, 1337, 0,
- 1337, 0, 0, 0, 0, 0, 1337, 1338, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1338, 1338, 1338, 1338, 1338, 1338, 1338, 0, 1338,
- 0, 0, 0, 0, 0, 1338, 1340, 0, 1340, 1340,
-
- 1340, 1340, 1340, 1340, 1340, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1340, 0, 0, 1340,
- 0, 0, 0, 0, 0, 0, 1340, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1340, 1341,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1341, 1341, 1341, 1341, 1341, 1341, 1341,
- 0, 1341, 0, 0, 0, 0, 0, 1341, 0, 0,
- 0, 0, 0, 0, 1341, 1342, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1342,
- 1342, 1342, 1342, 1342, 1342, 1342, 0, 1342, 0, 0,
-
- 0, 0, 0, 1342, 0, 0, 0, 0, 0, 0,
- 1342, 1344, 0, 0, 0, 0, 0, 0, 0, 0,
- 1344, 0, 1344, 0, 0, 1344, 1344, 1344, 1344, 1344,
- 1344, 1344, 0, 1344, 0, 0, 0, 0, 0, 1344,
- 1346, 1346, 1346, 1346, 1346, 1346, 1346, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1346, 1346, 1346,
- 1346, 1346, 1346, 1355, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1355, 0, 1355, 1355, 1355,
- 1355, 1355, 1355, 1355, 0, 1355, 0, 0, 0, 0,
- 0, 1355, 1356, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 1356, 1356, 1356, 1356,
- 1356, 1356, 1356, 0, 1356, 0, 0, 0, 0, 0,
- 1356, 1357, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1357, 0, 1357, 1357, 1357, 1357, 1357,
- 1357, 1357, 0, 1357, 0, 0, 0, 0, 0, 1357,
- 0, 0, 0, 1357, 0, 0, 1357, 0, 0, 0,
- 0, 0, 0, 1357, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1357, 1359, 1359, 1359, 1359,
- 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359,
- 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359,
-
- 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359,
- 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359,
- 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359,
- 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
- 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360,
-
- 1412, 0, 0, 0, 0, 0, 0, 0, 0, 1412,
- 0, 1412, 0, 0, 1412, 1412, 1412, 1412, 1412, 1412,
- 1412, 0, 1412, 0, 0, 0, 0, 0, 1412, 1414,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1414, 1414, 1414, 1414, 1414, 1414, 1414,
- 0, 1414, 0, 0, 0, 0, 0, 1414, 1415, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 0,
- 1415, 0, 0, 0, 0, 0, 1415, 1417, 0, 1417,
- 1417, 1417, 1417, 1417, 1417, 1417, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0,
- 1417, 0, 0, 0, 0, 0, 0, 1417, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1417,
- 1418, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1418, 1418, 1418, 1418, 1418, 1418,
- 1418, 0, 1418, 0, 0, 0, 0, 0, 1418, 0,
- 0, 0, 0, 0, 0, 1418, 1419, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1419, 1419, 1419, 1419, 1419, 1419, 1419, 0, 1419, 0,
- 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0,
-
- 0, 1419, 1421, 0, 0, 0, 0, 0, 0, 0,
- 0, 1421, 0, 1421, 0, 0, 1421, 1421, 1421, 1421,
- 1421, 1421, 1421, 0, 1421, 0, 0, 0, 0, 0,
- 1421, 1423, 1423, 1423, 1423, 1423, 1423, 1423, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1423, 1423,
- 1423, 1423, 1423, 1423, 1430, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1430, 1430,
- 1430, 1430, 1430, 1430, 1430, 0, 1430, 0, 0, 0,
- 0, 0, 1430, 1431, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1431, 1431, 1431,
-
- 1431, 1431, 1431, 1431, 0, 1431, 0, 0, 0, 0,
- 0, 1431, 1433, 0, 0, 0, 0, 0, 0, 0,
- 0, 1433, 0, 1433, 0, 0, 1433, 1433, 1433, 1433,
- 1433, 1433, 1433, 0, 1433, 0, 0, 0, 0, 0,
- 1433, 1435, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1435, 1435, 1435, 1435, 1435,
- 1435, 1435, 0, 1435, 0, 0, 0, 0, 0, 1435,
- 1436, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1436, 1436, 1436, 1436, 1436, 1436,
- 1436, 0, 1436, 0, 0, 0, 0, 0, 1436, 1444,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1444, 1444, 1444, 1444, 1444, 1444, 1444,
- 0, 1444, 0, 0, 0, 0, 0, 1444, 0, 0,
- 0, 0, 0, 0, 1444, 1445, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1445,
- 1445, 1445, 1445, 1445, 1445, 1445, 0, 1445, 0, 0,
- 0, 0, 0, 1445, 0, 0, 0, 0, 0, 0,
- 1445, 1447, 0, 0, 0, 0, 0, 0, 0, 0,
- 1447, 0, 1447, 0, 0, 1447, 1447, 1447, 1447, 1447,
- 1447, 1447, 0, 1447, 0, 0, 0, 0, 0, 1447,
-
- 1449, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1449, 1449, 1449, 1449, 1449, 1449,
- 1449, 0, 1449, 0, 0, 0, 0, 0, 1449, 0,
- 0, 1449, 1449, 1449, 1449, 1449, 1449, 1450, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1450,
- 0, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 0, 1450,
- 0, 0, 0, 0, 0, 1450, 1451, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1451, 1451, 1451, 1451, 1451, 1451, 1451, 0, 1451, 0,
- 0, 0, 0, 0, 1451, 1452, 0, 1452, 1452, 1452,
-
- 1452, 1452, 1452, 1452, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1452, 0, 0, 1452, 0,
- 0, 0, 0, 0, 0, 1452, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1452, 1453, 0,
- 1453, 1453, 1453, 1453, 1453, 1453, 1453, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1453, 0,
- 0, 1453, 0, 0, 0, 0, 0, 0, 1453, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1453, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454,
- 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454,
-
- 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454,
- 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454,
- 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454,
- 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454,
- 1454, 1454, 1454, 1499, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1499, 1499, 1499,
- 1499, 1499, 1499, 1499, 0, 1499, 0, 0, 0, 0,
- 0, 1499, 1500, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1500, 1500, 1500, 1500,
- 1500, 1500, 1500, 0, 1500, 0, 0, 0, 0, 0,
-
- 1500, 1502, 0, 0, 0, 0, 0, 0, 0, 0,
- 1502, 0, 1502, 0, 0, 1502, 1502, 1502, 1502, 1502,
- 1502, 1502, 0, 1502, 0, 0, 0, 0, 0, 1502,
- 1504, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1504, 1504, 1504, 1504, 1504, 1504,
- 1504, 0, 1504, 0, 0, 0, 0, 0, 1504, 1505,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1505, 1505, 1505, 1505, 1505, 1505, 1505,
- 0, 1505, 0, 0, 0, 0, 0, 1505, 1512, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 1512, 1512, 1512, 1512, 1512, 1512, 1512, 0,
- 1512, 0, 0, 0, 0, 0, 1512, 1513, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1513, 1513, 1513, 1513, 1513, 1513, 1513, 0, 1513,
- 0, 0, 0, 0, 0, 1513, 1516, 0, 0, 0,
- 0, 0, 0, 0, 0, 1516, 0, 1516, 0, 0,
- 1516, 1516, 1516, 1516, 1516, 1516, 1516, 0, 1516, 0,
- 0, 0, 0, 0, 1516, 1518, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1518,
- 1518, 1518, 1518, 1518, 1518, 1518, 0, 1518, 0, 0,
-
- 0, 0, 0, 1518, 1519, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1519, 1519,
- 1519, 1519, 1519, 1519, 1519, 0, 1519, 0, 0, 0,
- 0, 0, 1519, 1521, 0, 1521, 1521, 1521, 1521, 1521,
- 1521, 1521, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1521, 0, 0, 1521, 0, 0, 0,
- 0, 0, 0, 1521, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1521, 1522, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1522, 1522, 1522, 1522, 1522, 1522, 1522, 0, 1522, 0,
-
- 0, 0, 0, 0, 1522, 0, 0, 0, 0, 0,
- 0, 1522, 1523, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1523, 1523, 1523, 1523,
- 1523, 1523, 1523, 0, 1523, 0, 0, 0, 0, 0,
- 1523, 0, 0, 0, 0, 0, 0, 1523, 1525, 0,
- 0, 0, 0, 0, 0, 0, 0, 1525, 0, 1525,
- 0, 0, 1525, 1525, 1525, 1525, 1525, 1525, 1525, 0,
- 1525, 0, 0, 0, 0, 0, 1525, 1527, 1527, 1527,
- 1527, 1527, 1527, 1527, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1527, 1527, 1527, 1527, 1527, 1527,
-
- 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569,
- 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569,
- 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569,
- 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569,
- 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569,
- 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569,
- 1569, 1569, 1572, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1572, 1572, 1572, 1572,
- 1572, 1572, 1572, 0, 1572, 0, 0, 0, 0, 0,
- 1572, 1573, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 1573, 1573, 1573, 1573, 1573,
- 1573, 1573, 0, 1573, 0, 0, 0, 0, 0, 1573,
- 1576, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1576, 1576, 1576, 1576, 1576, 1576,
- 1576, 0, 1576, 0, 0, 0, 0, 0, 1576, 1577,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1577, 1577, 1577, 1577, 1577, 1577, 1577,
- 0, 1577, 0, 0, 0, 0, 0, 1577, 1579, 0,
- 0, 0, 0, 0, 0, 0, 0, 1579, 0, 1579,
- 0, 0, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 0,
-
- 1579, 0, 0, 0, 0, 0, 1579, 1581, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 0, 1581,
- 0, 0, 0, 0, 0, 1581, 1582, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1582, 1582, 1582, 1582, 1582, 1582, 1582, 0, 1582, 0,
- 0, 0, 0, 0, 1582, 1611, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1611, 0, 1611,
- 1611, 1611, 1611, 1611, 1611, 1611, 0, 1611, 0, 0,
- 0, 0, 0, 1611, 1612, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 1612, 1612,
- 1612, 1612, 1612, 1612, 1612, 0, 1612, 0, 0, 0,
- 0, 0, 1612, 1613, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1613, 0, 1613, 1613, 1613,
- 1613, 1613, 1613, 1613, 0, 1613, 0, 0, 0, 0,
- 0, 1613, 0, 0, 0, 1613, 0, 0, 1613, 0,
- 0, 0, 0, 0, 0, 1613, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1613, 1615, 1615,
- 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615,
- 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615,
-
- 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615,
- 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615,
- 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615,
- 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615,
- 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616,
- 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616,
- 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616,
- 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616,
- 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616,
- 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616, 1616,
-
- 1616, 1616, 1618, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1618, 1618, 1618, 1618,
- 1618, 1618, 1618, 0, 1618, 0, 0, 0, 0, 0,
- 1618, 1619, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1619, 1619, 1619, 1619, 1619,
- 1619, 1619, 0, 1619, 0, 0, 0, 0, 0, 1619,
- 1632, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1632, 1632, 1632, 1632, 1632, 1632,
- 1632, 0, 1632, 0, 0, 0, 0, 0, 1632, 0,
- 0, 0, 0, 0, 0, 1632, 1633, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1633, 1633, 1633, 1633, 1633, 1633, 1633, 0, 1633, 0,
- 0, 0, 0, 0, 1633, 0, 0, 0, 0, 0,
- 0, 1633, 1635, 0, 0, 0, 0, 0, 0, 0,
- 0, 1635, 0, 1635, 0, 0, 1635, 1635, 1635, 1635,
- 1635, 1635, 1635, 0, 1635, 0, 0, 0, 0, 0,
- 1635, 1637, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1637, 1637, 1637, 1637, 1637,
- 1637, 1637, 0, 1637, 0, 0, 0, 0, 0, 1637,
- 0, 0, 1637, 1637, 1637, 1637, 1637, 1637, 1638, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1638, 0, 1638, 1638, 1638, 1638, 1638, 1638, 1638, 0,
- 1638, 0, 0, 0, 0, 0, 1638, 1639, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1639, 1639, 1639, 1639, 1639, 1639, 1639, 0, 1639,
- 0, 0, 0, 0, 0, 1639, 1640, 0, 1640, 1640,
- 1640, 1640, 1640, 1640, 1640, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1640, 0, 0, 1640,
- 0, 0, 0, 0, 0, 0, 1640, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1640, 1641,
-
- 0, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1641,
- 0, 0, 1641, 0, 0, 0, 0, 0, 0, 1641,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1641, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642,
- 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642,
- 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642,
- 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642,
- 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642,
- 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642, 1642,
-
- 1642, 1642, 1642, 1642, 1647, 0, 0, 0, 0, 0,
- 0, 0, 0, 1647, 0, 1647, 0, 0, 1647, 1647,
- 1647, 1647, 1647, 1647, 1647, 0, 1647, 0, 0, 0,
- 0, 0, 1647, 1649, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1649, 1649, 1649,
- 1649, 1649, 1649, 1649, 0, 1649, 0, 0, 0, 0,
- 0, 1649, 1650, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1650, 1650, 1650, 1650,
- 1650, 1650, 1650, 0, 1650, 0, 0, 0, 0, 0,
- 1650, 1652, 0, 1652, 1652, 1652, 1652, 1652, 1652, 1652,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1652, 0, 0, 1652, 0, 0, 0, 0, 0,
- 0, 1652, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1652, 1653, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1653, 1653,
- 1653, 1653, 1653, 1653, 1653, 0, 1653, 0, 0, 0,
- 0, 0, 1653, 0, 0, 0, 0, 0, 0, 1653,
- 1654, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1654, 1654, 1654, 1654, 1654, 1654,
- 1654, 0, 1654, 0, 0, 0, 0, 0, 1654, 0,
-
- 0, 0, 0, 0, 0, 1654, 1656, 0, 0, 0,
- 0, 0, 0, 0, 0, 1656, 0, 1656, 0, 0,
- 1656, 1656, 1656, 1656, 1656, 1656, 1656, 0, 1656, 0,
- 0, 0, 0, 0, 1656, 1658, 1658, 1658, 1658, 1658,
- 1658, 1658, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1658, 1658, 1658, 1658, 1658, 1658, 1667, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1667, 1667, 1667, 1667, 1667, 1667, 1667, 0,
- 1667, 0, 0, 0, 0, 0, 1667, 1668, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 1668, 1668, 1668, 1668, 1668, 1668, 1668, 0, 1668,
- 0, 0, 0, 0, 0, 1668, 1670, 0, 0, 0,
- 0, 0, 0, 0, 0, 1670, 0, 1670, 0, 0,
- 1670, 1670, 1670, 1670, 1670, 1670, 1670, 0, 1670, 0,
- 0, 0, 0, 0, 1670, 1672, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1672,
- 1672, 1672, 1672, 1672, 1672, 1672, 0, 1672, 0, 0,
- 0, 0, 0, 1672, 1673, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1673, 1673,
- 1673, 1673, 1673, 1673, 1673, 0, 1673, 0, 0, 0,
-
- 0, 0, 1673, 1682, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1682, 1682, 1682,
- 1682, 1682, 1682, 1682, 0, 1682, 0, 0, 0, 0,
- 0, 1682, 1683, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1683, 1683, 1683, 1683,
- 1683, 1683, 1683, 0, 1683, 0, 0, 0, 0, 0,
- 1683, 1688, 1688, 1688, 1688, 1688, 1688, 1688, 1688, 1688,
- 1688, 1688, 1688, 1688, 1688, 1688, 1688, 1688, 1688, 1688,
- 1688, 1688, 1688, 1688, 1688, 1689, 1689, 1689, 1689, 1689,
- 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689,
-
- 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1689, 1690,
- 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690, 1690,
- 1690, 1690, 1690, 1691, 1691, 1691, 1691, 1691, 1691, 1691,
- 1692, 1692, 1692, 1692, 0, 0, 1692, 1692, 1692, 1692,
- 1692, 1692, 1692, 1692, 0, 1692, 1693, 0, 0, 1693,
- 0, 0, 0, 0, 0, 0, 1693, 0, 1693, 1693,
- 1693, 1693, 1693, 1693, 1693, 1693, 1693, 0, 1693, 1694,
- 1694, 1694, 1694, 0, 0, 1694, 1694, 1694, 1694, 1694,
- 1694, 1694, 1694, 0, 1694, 1695, 0, 1695, 1695, 0,
-
- 1695, 0, 1695, 0, 1695, 1695, 0, 1695, 1695, 1695,
- 1695, 1695, 1695, 1695, 1695, 1695, 0, 1695, 1696, 0,
- 0, 1696, 1696, 1696, 1696, 1696, 1696, 1696, 1696, 0,
- 1696, 1697, 0, 0, 0, 1697, 0, 0, 1697, 1697,
- 1697, 1697, 1697, 1697, 1697, 1697, 0, 1697, 1699, 1699,
- 0, 1699, 1699, 1699, 1699, 1699, 1699, 1699, 1699, 1699,
- 1699, 1699, 1699, 1699, 1699, 1699, 1699, 1699, 1699, 1699,
- 1699, 1699, 1700, 0, 0, 1700, 0, 1700, 0, 1700,
- 1700, 0, 1700, 1700, 0, 0, 1700, 1700, 1700, 1700,
- 1700, 1700, 1700, 1701, 1701, 1701, 1701, 1701, 1701, 1701,
-
- 1701, 1701, 1701, 1701, 1701, 1701, 1701, 0, 1701, 1701,
- 1701, 1701, 1701, 1701, 1701, 1701, 1701, 1702, 1702, 1702,
- 1702, 0, 0, 1702, 1702, 1702, 1702, 1702, 1702, 1702,
- 1702, 0, 1702, 1703, 0, 0, 1703, 1703, 1703, 1703,
- 1703, 1703, 1703, 1703, 0, 1703, 1704, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1704, 1704, 0, 0,
- 0, 0, 1704, 1706, 0, 0, 0, 0, 1706, 0,
- 1706, 0, 0, 1706, 1707, 0, 0, 0, 0, 1707,
- 0, 1707, 0, 0, 1707, 1708, 0, 0, 0, 0,
- 1708, 0, 1708, 0, 0, 1708, 1710, 1710, 1710, 1710,
-
- 0, 0, 1710, 1710, 1710, 1710, 1710, 1710, 1710, 1710,
- 0, 1710, 1711, 1711, 0, 1711, 1711, 1711, 1711, 1711,
- 1711, 1711, 1711, 1711, 1711, 1711, 1711, 1711, 1711, 1711,
- 1711, 1711, 1711, 1711, 1711, 1711, 1712, 0, 1712, 1712,
- 0, 1712, 0, 1712, 0, 1712, 1712, 0, 1712, 1712,
- 1712, 1712, 1712, 1712, 1712, 1712, 1712, 0, 1712, 1713,
- 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713, 1713,
- 1713, 1713, 1713, 0, 1713, 1713, 1713, 1713, 1713, 1713,
- 1713, 1713, 1713, 1714, 0, 0, 0, 0, 0, 0,
- 1714, 0, 0, 1714, 1714, 1715, 0, 0, 1715, 1715,
-
- 1715, 1715, 1715, 1715, 1715, 1715, 0, 1715, 1716, 1716,
- 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
- 1716, 1716, 0, 1716, 1716, 1716, 1716, 1716, 1716, 1716,
- 1716, 1716, 1717, 1717, 1717, 1717, 1717, 1717, 1717, 1718,
- 0, 0, 0, 1718, 0, 0, 1718, 1718, 1718, 1718,
- 1718, 1718, 1718, 1718, 0, 1718, 1719, 1719, 1719, 1719,
- 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719,
- 0, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719, 1719,
- 1720, 0, 0, 0, 0, 1720, 1720, 1720, 1721, 1721,
- 0, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721,
-
- 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721,
- 1721, 1721, 1722, 0, 1722, 1722, 0, 1722, 0, 0,
- 0, 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1723, 0,
- 0, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 0,
- 1723, 1724, 1724, 1724, 1724, 1724, 1724, 1724, 1724, 1724,
- 1724, 1724, 1724, 1724, 1724, 0, 1724, 1724, 1724, 1724,
- 1724, 1724, 1724, 1724, 1724, 1725, 0, 0, 1725, 0,
- 0, 0, 0, 0, 0, 1725, 0, 1725, 1725, 1725,
- 1725, 1725, 1725, 1725, 1725, 1725, 0, 1725, 1727, 1727,
- 1727, 1727, 0, 0, 1727, 1727, 1727, 1727, 1727, 1727,
-
- 1727, 1727, 0, 1727, 1728, 1728, 0, 1728, 1728, 1728,
- 1728, 1728, 1728, 1728, 1728, 1728, 1728, 1728, 1728, 1728,
- 1728, 1728, 1728, 1728, 1728, 1728, 1728, 1728, 1729, 0,
- 0, 1729, 1729, 1729, 1729, 1729, 1729, 1729, 1729, 0,
- 1729, 1730, 1730, 1730, 1730, 1730, 1730, 1730, 1730, 1730,
- 1730, 1730, 1730, 1730, 1730, 0, 1730, 1730, 1730, 1730,
- 1730, 1730, 1730, 1730, 1730, 1731, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1731, 1731, 0, 0, 0,
- 1731, 1731, 1731, 1732, 0, 1732, 0, 0, 0, 0,
- 0, 1732, 1732, 0, 0, 1732, 1734, 0, 0, 0,
-
- 0, 0, 0, 1734, 0, 0, 1734, 1734, 1735, 0,
- 0, 0, 0, 1735, 0, 1735, 0, 0, 1735, 1736,
- 0, 0, 0, 0, 1736, 0, 1736, 0, 0, 1736,
- 1737, 0, 0, 0, 0, 1737, 0, 1737, 0, 0,
- 1737, 1738, 1738, 0, 1738, 1738, 1738, 1738, 1738, 1738,
- 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738, 1738,
- 1738, 1738, 1738, 1738, 1738, 1739, 1739, 1739, 1739, 1739,
- 1739, 1739, 1739, 1739, 1739, 1739, 1739, 1739, 1739, 0,
- 1739, 1739, 1739, 1739, 1739, 1739, 1739, 1739, 1739, 1740,
- 0, 0, 1740, 0, 1740, 0, 1740, 1740, 0, 1740,
-
- 1740, 0, 0, 1740, 1740, 1740, 1740, 1740, 1740, 1740,
- 1741, 0, 1741, 1741, 0, 1741, 0, 1741, 0, 1741,
- 1741, 0, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741,
- 1741, 0, 1741, 1743, 1743, 1743, 1743, 1743, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 0, 1743, 1743,
- 1743, 1743, 1743, 1743, 1743, 1743, 1743, 1744, 0, 0,
- 0, 0, 0, 1744, 0, 0, 1744, 1744, 1744, 1744,
- 1744, 1744, 1744, 1744, 0, 1744, 1745, 1745, 1745, 1745,
- 1745, 1745, 1745, 1745, 1745, 1745, 1745, 1745, 1745, 1745,
- 0, 1745, 1745, 1745, 1745, 1745, 1745, 1745, 1745, 1745,
-
- 1746, 0, 0, 0, 1746, 0, 0, 1746, 1746, 1746,
- 1746, 1746, 1746, 1746, 1746, 0, 1746, 1747, 0, 1747,
- 0, 0, 0, 0, 0, 1747, 1747, 0, 0, 1747,
- 1749, 0, 0, 1749, 1749, 1749, 1749, 1749, 1749, 1749,
- 1749, 0, 1749, 1750, 0, 0, 1750, 1750, 1750, 1750,
- 1750, 1750, 1750, 1750, 0, 1750, 1751, 1751, 1751, 1751,
- 1751, 1751, 1751, 1751, 1751, 1751, 1751, 1751, 1751, 1751,
- 0, 1751, 1751, 1751, 1751, 1751, 1751, 1751, 1751, 1751,
- 1752, 1752, 1752, 1752, 1752, 1752, 1752, 1752, 1752, 1752,
- 1752, 1752, 1752, 1752, 0, 1752, 1752, 1752, 1752, 1752,
-
- 1752, 1752, 1752, 1752, 1753, 0, 0, 1753, 0, 0,
- 0, 0, 0, 0, 1753, 0, 1753, 1753, 1753, 1753,
- 1753, 1753, 1753, 1753, 1753, 0, 1753, 1754, 0, 0,
- 1754, 0, 1754, 0, 1754, 1754, 0, 1754, 0, 1754,
- 0, 1754, 1754, 1754, 1754, 1754, 1754, 1754, 1756, 1756,
- 0, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756,
- 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756, 1756,
- 1756, 1756, 1757, 1757, 1757, 1757, 1757, 1757, 1757, 1757,
- 1757, 1757, 1757, 1757, 1757, 1757, 0, 1757, 1757, 1757,
- 1757, 1757, 1757, 1757, 1757, 1757, 1758, 0, 0, 1758,
-
- 1758, 1758, 1758, 1758, 1758, 1758, 1758, 0, 1758, 1759,
- 0, 1759, 0, 0, 0, 0, 0, 1759, 1759, 0,
- 0, 1759, 1761, 0, 0, 0, 0, 1761, 1761, 1761,
- 1766, 1766, 1766, 1766, 1766, 1766, 1766, 1766, 1766, 1766,
- 1766, 1766, 1766, 1766, 0, 1766, 1766, 1766, 1766, 1766,
- 1766, 1766, 1766, 1766, 1768, 0, 1768, 1768, 0, 1768,
- 0, 1768, 0, 1768, 1768, 0, 1768, 1768, 1768, 1768,
- 1768, 1768, 1768, 1768, 1768, 0, 1768, 1769, 0, 0,
- 0, 0, 1769, 1769, 1769, 0, 0, 0, 1769, 1770,
- 0, 0, 0, 0, 0, 1770, 0, 0, 1770, 1770,
-
- 1770, 1770, 1770, 1770, 1770, 1770, 0, 1770, 1771, 1771,
- 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771, 1771,
- 1771, 1771, 0, 1771, 1771, 1771, 1771, 1771, 1771, 1771,
- 1771, 1771, 1772, 0, 1772, 0, 0, 0, 1772, 0,
- 0, 1772, 1772, 1772, 1772, 1772, 1772, 1772, 1772, 0,
- 1772, 1773, 0, 0, 0, 0, 1773, 1773, 1773, 1774,
- 0, 1774, 0, 0, 0, 0, 0, 1774, 1774, 0,
- 0, 1774, 1776, 0, 0, 1776, 1776, 1776, 1776, 1776,
- 1776, 1776, 1776, 0, 1776, 1777, 1777, 1777, 1777, 1777,
- 1777, 1777, 1777, 1777, 1777, 1777, 1777, 1777, 1777, 0,
-
- 1777, 1777, 1777, 1777, 1777, 1777, 1777, 1777, 1777, 1778,
- 1778, 1778, 1778, 1778, 1778, 1778, 1778, 1778, 1778, 1778,
- 1778, 1778, 1778, 0, 1778, 1778, 1778, 1778, 1778, 1778,
- 1778, 1778, 1778, 1779, 1779, 1779, 1779, 1779, 1779, 1779,
- 1779, 1779, 1779, 1779, 1779, 1779, 1779, 0, 1779, 1779,
- 1779, 1779, 1779, 1779, 1779, 1779, 1779, 1780, 0, 0,
- 1780, 0, 0, 0, 0, 0, 0, 1780, 0, 1780,
- 1780, 1780, 1780, 1780, 1780, 1780, 1780, 1780, 0, 1780,
- 1781, 0, 0, 1781, 1781, 1781, 1781, 1781, 1781, 1781,
- 1781, 0, 1781, 1782, 1782, 1782, 1782, 1782, 1782, 1782,
-
- 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1782,
- 1782, 1782, 1782, 1782, 1782, 1782, 1782, 1783, 0, 0,
- 1783, 1783, 1783, 1783, 1783, 1783, 1783, 1783, 0, 1783,
- 1784, 0, 0, 0, 0, 1784, 1784, 1784, 1785, 0,
- 0, 0, 0, 1785, 1785, 1785, 0, 0, 0, 1785,
- 1786, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1786, 1786, 0, 0, 0, 1786, 1786, 1786, 1786, 1787,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1787,
- 1787, 0, 0, 0, 1787, 1787, 1787, 1787, 1788, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1788, 1788,
-
- 0, 0, 0, 1788, 1788, 1788, 1788, 1789, 1789, 1789,
- 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789,
- 1789, 0, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789,
- 1789, 1790, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1790, 0, 0, 0, 0, 1790, 1790, 1790, 1791,
- 0, 1791, 1791, 0, 1791, 0, 1791, 0, 1791, 1791,
- 0, 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791,
- 0, 1791, 1792, 1792, 1792, 1792, 1792, 1792, 1792, 1792,
- 1792, 1792, 1792, 1792, 1792, 1792, 0, 1792, 1792, 1792,
- 1792, 1792, 1792, 1792, 1792, 1792, 1793, 0, 0, 0,
-
- 1793, 0, 0, 1793, 1793, 1793, 1793, 1793, 1793, 1793,
- 1793, 0, 1793, 1794, 1794, 1794, 1794, 1794, 1794, 1794,
- 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1794,
- 1794, 1794, 1794, 1794, 1794, 1794, 1794, 1795, 0, 0,
- 0, 0, 1795, 1795, 1795, 1796, 1796, 1796, 1796, 1796,
- 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1796, 0,
- 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1796, 1797,
- 1797, 1797, 1797, 1797, 1797, 1797, 1797, 1797, 1797, 1797,
- 1797, 1797, 1797, 0, 1797, 1797, 1797, 1797, 1797, 1797,
- 1797, 1797, 1797, 1798, 0, 0, 1798, 0, 0, 0,
-
- 0, 0, 0, 1798, 0, 1798, 1798, 1798, 1798, 1798,
- 1798, 1798, 1798, 1798, 0, 1798, 1799, 0, 1799, 0,
- 0, 0, 0, 0, 1799, 1799, 0, 0, 1799, 1801,
- 0, 0, 1801, 1801, 1801, 1801, 1801, 1801, 1801, 1801,
- 0, 1801, 1802, 1802, 1802, 1802, 1802, 1802, 1802, 1802,
- 1802, 1802, 1802, 1802, 1802, 1802, 0, 1802, 1802, 1802,
- 1802, 1802, 1802, 1802, 1802, 1802, 1803, 0, 0, 1803,
- 0, 1803, 0, 1803, 1803, 0, 1803, 0, 1803, 0,
- 1803, 1803, 1803, 1803, 1803, 1803, 1803, 1804, 1804, 1804,
- 1804, 1804, 1804, 1804, 1804, 1804, 1804, 1804, 1804, 1804,
-
- 1804, 1804, 1804, 1804, 1804, 1804, 1804, 1804, 1804, 1804,
- 1804, 1805, 0, 0, 1805, 1805, 1805, 1805, 1805, 1805,
- 1805, 1805, 0, 1805, 1806, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1806, 0, 0, 0, 0, 0,
- 1806, 0, 0, 1806, 1808, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1808, 0, 0, 0, 0, 0,
- 1808, 0, 0, 1808, 1810, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1810, 0, 0, 0, 0, 0,
- 1810, 0, 0, 1810, 1812, 1812, 1812, 1812, 1812, 1812,
- 1812, 1812, 1812, 1812, 1812, 1812, 1812, 1812, 0, 1812,
-
- 1812, 1812, 1812, 1812, 1812, 1812, 1812, 1812, 1813, 0,
- 1813, 1813, 0, 1813, 0, 1813, 0, 1813, 1813, 0,
- 1813, 1813, 1813, 1813, 1813, 1813, 1813, 1813, 1813, 0,
- 1813, 1814, 1814, 1814, 1814, 1814, 1814, 1814, 1814, 1814,
- 1814, 1814, 1814, 1814, 1814, 0, 1814, 1814, 1814, 1814,
- 1814, 1814, 1814, 1814, 1814, 1815, 1815, 1815, 1815, 1815,
- 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 0,
- 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1815, 1816,
- 0, 1816, 0, 0, 0, 1816, 0, 0, 1816, 1816,
- 1816, 1816, 1816, 1816, 1816, 1816, 0, 1816, 1817, 0,
-
- 0, 1817, 0, 1817, 0, 1817, 1817, 0, 1817, 0,
- 0, 0, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1818,
- 1818, 1818, 1818, 1818, 1818, 1818, 1818, 1818, 1818, 1818,
- 1818, 1818, 1818, 1818, 1818, 1818, 1818, 1818, 1818, 1818,
- 1818, 1818, 1818, 1819, 1819, 1819, 1819, 1819, 1819, 1819,
- 1819, 1819, 1819, 1819, 1819, 1819, 1819, 1819, 1819, 1819,
- 1819, 1819, 1819, 1819, 1819, 1819, 1819, 1820, 1820, 1820,
- 1820, 1820, 1820, 1820, 1820, 1820, 1820, 1820, 1820, 1820,
- 1820, 0, 1820, 1820, 1820, 1820, 1820, 1820, 1820, 1820,
- 1820, 1821, 0, 0, 1821, 0, 0, 0, 0, 0,
-
- 0, 1821, 0, 1821, 1821, 1821, 1821, 1821, 1821, 1821,
- 1821, 1821, 0, 1821, 1822, 0, 0, 0, 0, 1822,
- 1822, 1822, 1823, 1823, 1823, 1823, 1823, 1823, 1823, 1823,
- 1823, 1823, 1823, 1823, 1823, 1823, 0, 1823, 1823, 1823,
- 1823, 1823, 1823, 1823, 1823, 1823, 1824, 1824, 1824, 1824,
- 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824,
- 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824, 1824,
- 1825, 0, 0, 1825, 1825, 1825, 1825, 1825, 1825, 1825,
- 1825, 0, 1825, 1826, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1826, 0, 0, 0, 0, 1826, 1826,
-
- 1826, 0, 1826, 1827, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1827, 0, 0, 0, 0, 1827, 1827,
- 1827, 0, 1827, 1828, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1828, 0, 0, 0, 0, 1828, 1828,
- 1828, 0, 1828, 1829, 1829, 1829, 1829, 1829, 1829, 1829,
- 1829, 1829, 1829, 1829, 1829, 1829, 1829, 0, 1829, 1829,
- 1829, 1829, 1829, 1829, 1829, 1829, 1829, 1830, 0, 1830,
- 1830, 0, 1830, 0, 1830, 0, 1830, 1830, 0, 1830,
- 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 0, 1830,
- 1831, 1831, 1831, 1831, 1831, 1831, 1831, 1831, 1831, 1831,
-
- 1831, 1831, 1831, 1831, 0, 1831, 1831, 1831, 1831, 1831,
- 1831, 1831, 1831, 1831, 1832, 1832, 1832, 1832, 1832, 1832,
- 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 0, 1832,
- 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1833, 0,
- 0, 0, 1833, 0, 1833, 0, 0, 0, 1833, 0,
- 0, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 1833, 0,
- 1833, 1834, 1834, 1834, 1834, 1834, 1834, 1834, 1834, 1834,
- 1834, 1834, 1834, 1834, 1834, 1834, 1834, 1834, 1834, 1834,
- 1834, 1834, 1834, 1834, 1834, 1836, 1836, 1836, 1836, 1836,
- 1836, 1836, 1836, 1836, 1836, 1836, 1836, 1836, 1836, 1836,
-
- 1836, 1836, 1836, 1836, 1836, 1836, 1836, 1836, 1836, 1837,
- 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
- 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837,
- 1837, 1837, 1837, 1838, 1838, 1838, 1838, 1838, 1838, 1838,
- 1838, 1838, 1838, 1838, 1838, 1838, 1838, 0, 1838, 1838,
- 1838, 1838, 1838, 1838, 1838, 1838, 1838, 1839, 1839, 1839,
- 1839, 1839, 1839, 1839, 1839, 1839, 1839, 1839, 1839, 1839,
- 1839, 1839, 1839, 1839, 1839, 1839, 1839, 1839, 1839, 1839,
- 1839, 1840, 1840, 1840, 1840, 1840, 1840, 1840, 1840, 1840,
- 1840, 1840, 1840, 1840, 1840, 0, 1840, 1840, 1840, 1840,
-
- 1840, 1840, 1840, 1840, 1840, 1841, 1841, 1841, 1841, 1841,
- 1841, 1841, 1841, 1841, 1841, 1841, 1841, 1841, 1841, 1841,
- 1841, 1841, 1841, 1841, 1841, 1841, 1841, 1841, 1841, 1842,
- 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842,
- 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842, 1842,
- 1842, 1842, 1842, 1843, 1843, 1843, 1843, 1843, 1843, 1843,
- 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843,
- 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1844, 1844, 1844,
- 1844, 1844, 1844, 1844, 1844, 1844, 1844, 1844, 1844, 1844,
- 1844, 1844, 1844, 1844, 1844, 1844, 1844, 1844, 1844, 1844,
-
- 1844, 1845, 1845, 1845, 1845, 1845, 1845, 1845, 1845, 1845,
- 1845, 1845, 1845, 1845, 1845, 1845, 1845, 1845, 1845, 1845,
- 1845, 1845, 1845, 1845, 1845, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
- 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687
- } ;
-
-static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
-static char *yy_full_match;
-static int yy_lp;
-static int yy_looking_for_trail_begin = 0;
-static int yy_full_lp;
-static int *yy_full_state;
-#define YY_TRAILING_MASK 0x2000
-#define YY_TRAILING_HEAD_MASK 0x4000
-#define REJECT \
-{ \
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
-yy_cp = yy_full_match; /* restore poss. backed-over text */ \
-yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \
-yy_state_ptr = yy_full_state; /* restore orig. state */ \
-yy_current_state = *yy_state_ptr; /* restore curr. state */ \
-++yy_lp; \
-goto find_rule; \
-}
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-#ifndef YYLMAX
-#define YYLMAX 8192
-#endif
-
-char yytext[YYLMAX];
-char *filttext_ptr;
-#line 1 "filt.l"
-#define INITIAL 0
-#line 5 "filt.l"
-
-#include <stdio.h>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#include <ctype.h>
-#include <string.h>
-#include <math.h>
-#include <filter.h>
-
-#define MAX_INCLUDE_DEPTH 100
-#define SEGINC 1024
-#define MASKINC 1024
-
-#define LARGE_NUMBER 65536
-
-/* must match regions.h */
-#define PSTOP -142857.142857
-
-/* stolen from fitsy/xos.h */
-#define X__PI 3.14159265358979323846
-#define X_2PI ( 2 * X__PI )
-#define X_R2D (X_2PI / 360.0)
-#define X_R2H (X_2PI / 24.0)
-#define X_H2D (360.0 / 24.0)
-
-#define r2h(r) ( (r) / X_R2H )
-#define h2r(d) ( (d) * X_R2H )
-#define r2d(r) ( (r) / X_R2D )
-#define d2r(d) ( (d) * X_R2D )
-#define h2d(r) ( (r) * X_H2D )
-#define d2h(d) ( (d) / X_H2D )
-
-/* region types */
-#define TY_ANNULUS 1
-#define TY_BOX 2
-#define TY_CIRCLE 3
-#define TY_ELLIPSE 4
-#define TY_FIELD 5
-#define TY_LINE 6
-#define TY_PANDA 7
-#define TY_BPANDA 8
-#define TY_CPANDA 9
-#define TY_EPANDA 10
-#define TY_PIE 11
-#define TY_QTPIE 11
-#define TY_POINT 12
-#define TY_POLYGON 13
-#define TY_IMAGEMASK 14
-
-/* oft-used checks on argument and coord types */
-#define XARG ((narg % 2) == 1)
-#define YARG ((narg % 2) == 0)
-#define POSARG ((regid == TY_POLYGON) || (regid == TY_LINE) || (narg<=2))
-#define ANGARG (((regid == TY_PANDA) && (narg==3)) || \
- ((regid == TY_PANDA) && (narg==4)) || \
- ((regid == TY_BPANDA) && (narg==3)) || \
- ((regid == TY_BPANDA) && (narg==4)) || \
- ((regid == TY_CPANDA) && (narg==3)) || \
- ((regid == TY_CPANDA) && (narg==4)) || \
- ((regid == TY_EPANDA) && (narg==3)) || \
- ((regid == TY_EPANDA) && (narg==4)) || \
- ((regid == TY_PIE) && (narg>=3)) )
-
-#define NUMARG (((regid == TY_PANDA) && (narg==5)) || \
- ((regid == TY_PANDA) && (narg==8)) || \
- ((regid == TY_BPANDA) && (narg==5)) || \
- ((regid == TY_BPANDA) && (narg==10)) || \
- ((regid == TY_CPANDA) && (narg==5)) || \
- ((regid == TY_CPANDA) && (narg==8)) || \
- ((regid == TY_EPANDA) && (narg==5)) || \
- ((regid == TY_EPANDA) && (narg==10)) )
-
-#define SAVEANG ((regid == TY_BOX) || (regid == TY_ELLIPSE))
-
-#define USEPHYS (filt->fhd->table && \
- (filt->type == TYPE_EVENTS) && !filt->evsect)
-
-#define USEWCS (gcoordsys && \
- strcmp(gcoordsys, "image") && strcmp(gcoordsys, "physical"))
-
-#define IMFLIP (USEWCS && wcs->imflip)
-
-#define WCSSIZE (iswcs(wcs) && (cdelt1!=0) && (cdelt2!=0))
-
-/* format statements */
-#define DFMT1 ",%f"
-#define DFMT2 ",%f,%f"
-#define DFMT4 ",%f,%f,%f,%f"
-#define SFMT1 ",%s"
-#define IFMT1 ",%d"
-
-/* flex is not thread-safe, so we did not put any effort into avoiding
- globals, i.e. by putting read-write variables below into a struct */
-
-static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
-static int include_stack_ptr = 0;
-static int parse_error = 0;
-
-static int colargs;
-static int filtlen;
-static int radanglen;
-static int initbindefs;
-static int regtype;
-static int regid;
-static int laststart;
-static int maxfiltseg;
-static int setargs;
-static int inexpr;
-static int macropass;
-static int narg;
-static int nparen;
-static int nsparen;
-static int nrparen;
-static int nfiltseg;
-static int nrange;
-static int nroutine;
-static int nshape;
-static int nregion;
-static int nmask;
-static int got;
-static int offscl;
-static int xtype, ytype;
-static int tltyp[2];
-
-static double lastd1;
-static double lastd2;
-static double xpos, ypos;
-static double xpix, ypix;
-static double cdelt1, cdelt2, crot;
-static double dval, dval2;
-static double tlmin[2];
-static double tlmax[2];
-static double binsiz[2];
-
-static char lastarg[SZ_LINE];
-static char regname[SZ_LINE];
-static char colnames[2][SZ_LINE];
-static char wcsnames[2][SZ_LINE];
-static char macrobuf[SZ_LINE];
-static char rangename[SZ_LINE];
-static char sbuf[SZ_LINE];
-static char saveang[SZ_LINE];
-
-static char *fcoordsys=NULL;
-static char *gcoordsys=NULL;
-static char *filter=NULL;
-static char *radang=NULL;
-
-static struct WorldCoor *wcs=NULL;
-static FiltSeg *filtseg=NULL;
-static Filter filt=NULL;
-
-/* these are read-only */
-static char *rnames[] = {"annulus", "box", "circle", "ellipse",
- "line", "panda", "pie", "qtpie", "point",
- "polygon", "field", "bpanda", "cpanda", "epanda",
- "imagemask", NULL};
-static int rargs[] = {4, 5, 3, 5,
- 4, 8, 4, 4, 2,
- 6, 0, 11, 8, 11,
- 0, 0};
-static int vargs[] = {'y', 'o', 'y', 'o',
- 'n', 'n', 'y', 'n', 'e',
- 'e', 'n', 'n', 'n', 'n',
- 'n', '\0'};
-
-static int _FiltLexTypeCmp(const void *s1, const void *s2);
-static int _FiltLexTypeMatch(int ftype, int ttype);
-static int _FiltLexAccel _PRx((int n));
-static int _FiltLexRegionPanda _PRx((void));
-static int _FiltLexLcx _PRx((void));
-static int _FiltLexArgCheck _PRx((char *name, int args));
-static int _FiltLexNeedOp _PRx((int i, char *s));
-static void _FiltLexOp _PRx((char *s));
-static void _FiltLexTypeSet _PRx((int type));
-static void _FiltLexNew _PRx((void));
-static void _FiltLexParen _PRx((char *s));
-static void _FiltLexCat _PRx((char *s));
-static void _FiltLexRegionStart _PRx((int docols));
-static void _FiltLexRegionVal _PRx((char *s));
-static void _FiltLexRegionEnd _PRx((void));
-static void _FiltLexRangeAdd _PRx((char *xname, char *str, int type, int n, int maxlen));
-static void _FiltLexArgSave _PRx((double dval));
-static void _FiltLexSetWcs _PRx((char *s));
-static void _FiltLexWcsCols _PRx((FITSHead header, char *name1, char *name2));
-static void _FiltLexNum _PRx((int lcx));
-static void _FiltLexEnd _PRx((void));
-static void _FiltLexMake _PRx((void));
-static char *_FiltLexGetWcs _PRx((void));
-static int _FiltIncMask(FilterMask masks, int maxmask, int nmask);
-static int _FiltFitsMask(char *filename, FilterMask *rmasks, FITSHead *rhead, int *nreg);
-static void bin2num(char *d, char *s, int maxlen);
-
-int _filterror _PRx((char *msg));
-#define RLIST 1
-
-#define RTINE 2
-
-#define REG 3
-
-#define AREG 4
-
-#define INCLUDE 5
-
-#define COMM 6
-
-#line 4563 "lex.filt.c"
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
-#else
-extern int yywrap YY_PROTO(( void ));
-#endif
-#endif
-
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
-#endif
-
-#ifndef filttext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
-#endif
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
-
-#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
-#endif
-
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines. This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
- if ( yy_current_buffer->yy_is_interactive ) \
- { \
- int c = '*', n; \
- for ( n = 0; n < max_size && \
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
- && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" );
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
- YY_USER_ACTION
-
-YY_DECL
- {
- register yy_state_type yy_current_state;
- register char *yy_cp = NULL, *yy_bp = NULL;
- register int yy_act;
-
-#line 247 "filt.l"
-
-
-#line 4717 "lex.filt.c"
-
- if ( yy_init )
- {
- yy_init = 0;
-
-#ifdef YY_USER_INIT
- YY_USER_INIT;
-#endif
-
- if ( ! yy_start )
- yy_start = 1; /* first start state */
-
- if ( ! yyin )
- yyin = stdin;
-
- if ( ! yyout )
- yyout = stdout;
-
- if ( ! yy_current_buffer )
- yy_current_buffer =
- yy_create_buffer( yyin, YY_BUF_SIZE );
-
- yy_load_buffer_state();
- }
-
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = yy_c_buf_p;
-
- /* Support of yytext. */
- *yy_cp = yy_hold_char;
-
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
-
- yy_current_state = yy_start;
- yy_state_ptr = yy_state_buf;
- *yy_state_ptr++ = yy_current_state;
-yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 1688 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- *yy_state_ptr++ = yy_current_state;
- ++yy_cp;
- }
- while ( yy_base[yy_current_state] != 14226 );
-
-yy_find_action:
- yy_current_state = *--yy_state_ptr;
- yy_lp = yy_accept[yy_current_state];
-find_rule: /* we branch to this label when backing up */
- for ( ; ; ) /* until we find what rule we matched */
- {
- if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
- {
- yy_act = yy_acclist[yy_lp];
- if ( yy_act & YY_TRAILING_HEAD_MASK ||
- yy_looking_for_trail_begin )
- {
- if ( yy_act == yy_looking_for_trail_begin )
- {
- yy_looking_for_trail_begin = 0;
- yy_act &= ~YY_TRAILING_HEAD_MASK;
- break;
- }
- }
- else if ( yy_act & YY_TRAILING_MASK )
- {
- yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
- yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
- }
- else
- {
- yy_full_match = yy_cp;
- yy_full_state = yy_state_ptr;
- yy_full_lp = yy_lp;
- break;
- }
- ++yy_lp;
- goto find_rule;
- }
- --yy_cp;
- yy_current_state = *--yy_state_ptr;
- yy_lp = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
-
-
-do_action: /* This label is used only to access EOF actions. */
-
-
- switch ( yy_act )
- { /* beginning of action switch */
-case 1:
-YY_RULE_SETUP
-#line 249 "filt.l"
-{ _FiltLexCat(yytext); }
- YY_BREAK
-case 2:
-YY_RULE_SETUP
-#line 251 "filt.l"
-{ _FiltLexSetWcs(yytext); }
- YY_BREAK
-case 3:
-YY_RULE_SETUP
-#line 253 "filt.l"
-{ BEGIN COMM; }
- YY_BREAK
-case 4:
-YY_RULE_SETUP
-#line 254 "filt.l"
-{ BEGIN COMM; }
- YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 255 "filt.l"
-{ BEGIN COMM; }
- YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 256 "filt.l"
-{
- /* comment acts like EOL */
- if( YY_START == REG ){
- _FiltLexRegionEnd();
- _FiltLexNew();
- }
- else if( YY_START == RLIST ){
- _FiltLexParen(")");
- _FiltLexNew();
- }
- else{
- _FiltLexNew();
- }
- BEGIN COMM;
-}
- YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 271 "filt.l"
-{ BEGIN INITIAL; }
- YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 272 "filt.l"
-{ BEGIN INITIAL; }
- YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 273 "filt.l"
-{ /* ignore comments up to eol */ ; }
- YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 275 "filt.l"
-{ ; /* ignore */ }
- YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 276 "filt.l"
-{ ; /* ignore */ }
- YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 277 "filt.l"
-{ ; /* ignore */ }
- YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 278 "filt.l"
-{ ; /* ignore */ }
- YY_BREAK
-case 14:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp = yy_bp + 1;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-#line 280 "filt.l"
-{
- if( YY_START == REG ){
- _FiltLexRegionEnd();
- _FiltLexNew();
- }
- /* Found an asc-style region */
- colargs = 0;
- laststart = YY_START;
- BEGIN AREG;
-}
- YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 290 "filt.l"
-{
- if( colargs > 2 )
- _filterror("illegal Chandra region (too many column args)");
- if( !FilterSymbolEnter(filt, yytext, &got) ){
- switch(got){
- case -1:
- _filterror("missing column or header parameter");
- break;
- case -2:
- _filterror("column is not an array");
- break;
- case -3:
- _filterror("internal error while processing column");
- break;
- }
- }
- strcpy(colnames[colargs],yytext);
- colargs++;
-}
- YY_BREAK
-case 16:
-YY_RULE_SETUP
-#line 309 "filt.l"
-{ ; }
- YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 310 "filt.l"
-{ ; }
- YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 311 "filt.l"
-{ ; }
- YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 312 "filt.l"
-{
- /* end of asc part of region */
- if( colargs != 2 )
- _filterror("illegal Chandra region (wrong number of cols)");
- BEGIN INITIAL;
-}
- YY_BREAK
-case 20:
-#line 320 "filt.l"
-case 21:
-YY_RULE_SETUP
-#line 320 "filt.l"
-{
- /* finish off previous */
- if( YY_START == REG ){
- _FiltLexRegionEnd();
- _FiltLexNew();
- }
- /* Found a region */
- BEGIN REG;
- if( filt->type == TYPE_EVENTS ){
- /* if asc-style, re-do wcs for specified columns */
- if( colargs == 2 ){
- _FiltLexRegionStart(2);
- _FiltLexWcsCols(filt->fhd, colnames[0], colnames[1]);
- }
- /* set up default columns */
- else{
- _FiltLexRegionStart(1);
- }
- }
- /* its an image */
- else{
- _FiltLexRegionStart(0);
- }
-}
- YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 344 "filt.l"
-{
- /* can't happen */
- _filterror("invalid characters following the region name");
-}
- YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 348 "filt.l"
-{
- narg++;
- /* process this pure number in the current coord system */
- _FiltLexNum(_FiltLexLcx());
-}
- YY_BREAK
-case 24:
-YY_RULE_SETUP
-#line 353 "filt.l"
-{
- narg++;
- /* remove trailing unit character */
- yytext[strlen(yytext)-1] = '\0';
- /* process this as a pure number in image coord sys */
- _FiltLexNum(LCX_IMAGE);
-}
- YY_BREAK
-case 25:
-YY_RULE_SETUP
-#line 360 "filt.l"
-{
- narg++;
- /* remove trailing unit character */
- yytext[strlen(yytext)-1] = '\0';
- /* process this as a pure number in physical coord sys */
- _FiltLexNum(LCX_PHYS);
-}
- YY_BREAK
-case 26:
-YY_RULE_SETUP
-#line 367 "filt.l"
-{
- char *coordsys;
- if( nowcs(wcs) )
- _filterror("no WCS information in file");
- narg++;
- /* save x value for processing with y next time */
- if( XARG ){
- xpos = SAOstrtod(yytext,NULL);
- xtype = SAOdtype;
- if( (xtype !=0) && (xtype != '.') && (xtype != 'd') ){
- coordsys = _FiltLexGetWcs();
- /* arg1 coords are hms, but ecliptic, galactic are deg */
- if( !coordsys ||
- (strncasecmp(coordsys, "ecl", 3) &&
- strncasecmp(coordsys, "gal", 3)) ){
- xpos = h2d(xpos);
- }
- }
- }
- else{
- ypos = SAOstrtod(yytext,NULL);
- ytype = SAOdtype;
- /* convert wcs to image pixels */
- wcsc2pix(wcs, xpos,ypos, _FiltLexGetWcs(), &xpix,&ypix,
- &offscl);
- /* convert to physical for single event filtering */
- if( USEPHYS ){
- xpix = tli2p(xpix, tlmin[0], binsiz[0], tltyp[0]);
- ypix = tli2p(ypix, tlmin[1], binsiz[1], tltyp[1]);
- }
- snprintf(sbuf, SZ_LINE, DFMT2, xpix, ypix);
- _FiltLexCat(sbuf);
- }
-}
- YY_BREAK
-case 27:
-YY_RULE_SETUP
-#line 401 "filt.l"
-{
- narg++;
- /* handle position arguments */
- if( POSARG ){
- if( nowcs(wcs) )
- _filterror("no WCS information in file");
- /* save x value for processing with y next time */
- if( XARG ){
- xpos = strtod(yytext,NULL);
- }
- else{
- ypos = strtod(yytext,NULL);
- /* convert wcs to image pixels */
- wcsc2pix(wcs, xpos, ypos, _FiltLexGetWcs(),
- &xpix, &ypix, &offscl);
- /* convert to physical for single event filtering */
- if( USEPHYS ){
- xpix = tli2p(xpix, tlmin[0], binsiz[0], tltyp[0]);
- ypix = tli2p(ypix, tlmin[1], binsiz[1], tltyp[1]);
- }
- snprintf(sbuf, SZ_LINE, DFMT2, xpix, ypix);
- _FiltLexCat(sbuf);
- }
- }
- /* angle arguments are just passed along, with updated crot */
- else if( ANGARG ){
- dval = strtod(yytext,NULL);
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* panda numeric args are just passed along */
- else if( NUMARG ){
- dval = strtod(yytext,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* handle size arguments */
- else{
- if( !WCSSIZE )
- _filterror("no WCS (or CDELT) information in file");
- if( SAVEANG ){
- dval = strtod(yytext,NULL);
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(saveang, SZ_LINE, DFMT1, dval);
- }
- /* arg 1 is ra, arg2 is dec */
- if( XARG )
- dval = ABS(strtod(yytext,NULL)/cdelt1);
- else
- dval = ABS(strtod(yytext,NULL)/cdelt2);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
-}
- YY_BREAK
-case 28:
-YY_RULE_SETUP
-#line 459 "filt.l"
-{
- narg++;
- /* handle position arguments */
- if( POSARG ){
- if( nowcs(wcs) )
- _filterror("no WCS information in file");
- /* save x value for processing with y next time */
- if( XARG ){
- xpos = r2d(strtod(yytext,NULL));
- }
- else{
- ypos = r2d(strtod(yytext,NULL));
- /* convert wcs to image pixels */
- wcsc2pix(wcs, xpos, ypos, _FiltLexGetWcs(),
- &xpix, &ypix, &offscl);
- /* convert to physical for single event filtering */
- if( USEPHYS ){
- xpix = tli2p(xpix, tlmin[0], binsiz[0], tltyp[0]);
- ypix = tli2p(ypix, tlmin[1], binsiz[1], tltyp[1]);
- }
- snprintf(sbuf, SZ_LINE, DFMT2, xpix, ypix);
- _FiltLexCat(sbuf);
- }
- }
- /* angle arguments are just passed along, with updated crot */
- else if( ANGARG ){
- dval = r2d(strtod(yytext,NULL));
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* panda numeric args are just passed along */
- else if( NUMARG ){
- dval = strtod(yytext,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* handle size arguments */
- else{
- if( !WCSSIZE )
- _filterror("no WCS (or CDELT) information in file");
- if( SAVEANG ){
- dval = r2d(strtod(yytext,NULL));
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(saveang, SZ_LINE, DFMT1, dval);
- }
- /* arg 1 is ra, arg2 is dec */
- if( XARG )
- dval = r2d(ABS(strtod(yytext,NULL)/cdelt1));
- else
- dval = r2d(ABS(strtod(yytext,NULL)/cdelt2));
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
-}
- YY_BREAK
-case 29:
-YY_RULE_SETUP
-#line 517 "filt.l"
-{
- if( !WCSSIZE )
- _filterror("no WCS (or CDELT) information in file");
- narg++;
- /* arg 1 is ra, arg2 is dec */
- if( XARG )
- dval = ABS(strtod(yytext,NULL)/(cdelt1*60.0));
- else
- dval = ABS(strtod(yytext,NULL)/(cdelt2*60.0));
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
-}
- YY_BREAK
-case 30:
-YY_RULE_SETUP
-#line 530 "filt.l"
-{
- if( !WCSSIZE )
- _filterror("no WCS (or CDELT) information in file");
- narg++;
- /* arg 1 is ra, arg2 is dec */
- if( XARG )
- dval = ABS(strtod(yytext,NULL)/(cdelt1*3600.0));
- else
- dval = ABS(strtod(yytext,NULL)/(cdelt2*3600.0));
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
-}
- YY_BREAK
-case 31:
-YY_RULE_SETUP
-#line 543 "filt.l"
-{
- int n;
- n = strtol(strchr(yytext, '=')+1, NULL, 10);
- if( n <=0 ){
- _filterror("invalid region accelerator");
- }
- else{
- if( !_FiltLexAccel(n) ){
- _filterror("invalid region accelerator");
- }
- }
-}
- YY_BREAK
-case 32:
-YY_RULE_SETUP
-#line 555 "filt.l"
-{
- if( _FiltLexArgCheck(regname, narg) == 0 ){
- /* new expression without an expression separator ... sigh */
- _FiltLexRegionEnd();
- _FiltLexNew();
- BEGIN INITIAL;
- yyless(0);
- } else {
- narg++;
- /* process this pure number in the current coord system */
- _FiltLexNum(_FiltLexLcx());
- }
-}
- YY_BREAK
-case 33:
-YY_RULE_SETUP
-#line 568 "filt.l"
-{
- /* new expression without an expression separator ... sigh */
- _FiltLexRegionEnd();
- _FiltLexNew();
- BEGIN INITIAL;
- yyless(0);
-}
- YY_BREAK
-case 34:
-YY_RULE_SETUP
-#line 575 "filt.l"
-{
- /* explicit rule avoids the _FiltLexNew of general rule */
- ;
-}
- YY_BREAK
-case 35:
-YY_RULE_SETUP
-#line 579 "filt.l"
-{
- _FiltLexRegionVal(yytext);
- if( !nsparen ){
- _FiltLexRegionEnd();
- BEGIN INITIAL;
- }
-}
- YY_BREAK
-case 36:
-YY_RULE_SETUP
-#line 586 "filt.l"
-{
- nsparen++;
-}
- YY_BREAK
-case 37:
-YY_RULE_SETUP
-#line 589 "filt.l"
-{
- _FiltLexRegionVal(yytext+1);
- if( nsparen ){
- nsparen--;
- if( !nsparen ){
- _FiltLexRegionEnd();
- BEGIN INITIAL;
- }
- } else {
- _FiltLexRegionEnd();
- BEGIN INITIAL;
- /* REJECT; */
- /* explicit execution of general rule instead of REJECT */
- nparen--;
- _FiltLexNew();
- _FiltLexCat(")");
- _FiltLexNew();
- }
-}
- YY_BREAK
-case 38:
-YY_RULE_SETUP
-#line 608 "filt.l"
-{
- if( nsparen ){
- nsparen--;
- if( !nsparen ){
- _FiltLexRegionEnd();
- BEGIN INITIAL;
- }
- } else {
- _FiltLexRegionEnd();
- BEGIN INITIAL;
- /* REJECT; */
- /* explicit execution of general rule instead of REJECT */
- nparen--;
- _FiltLexNew();
- _FiltLexCat(")");
- _FiltLexNew();
- }
-}
- YY_BREAK
-case 39:
-YY_RULE_SETUP
-#line 626 "filt.l"
-{
- _FiltLexRegionEnd();
- _FiltLexOp(yytext);
- BEGIN INITIAL;
-}
- YY_BREAK
-case 40:
-YY_RULE_SETUP
-#line 631 "filt.l"
-{
- _FiltLexRegionEnd();
- _FiltLexNew();
- BEGIN INITIAL;
-}
- YY_BREAK
-case 41:
-YY_RULE_SETUP
-#line 637 "filt.l"
-{
- _filterror("you must use == to compare two columns,");
-}
- YY_BREAK
-case 42:
-YY_RULE_SETUP
-#line 641 "filt.l"
-{
- if( YY_START == REG ){
- _FiltLexRegionEnd();
- }
- _FiltLexParen("(");
- BEGIN RLIST;
- narg = 0;
- _FiltLexTypeSet(TOK_RLIST);
- nrange = 0;
- if( !FilterSymbolEnter(filt, yytext, &got) ){
- switch(got){
- case -1:
- _filterror("missing column or header parameter");
- break;
- case -2:
- _filterror("column is not an array");
- break;
- case -3:
- _filterror("internal error while processing column");
- break;
- }
- }
- strncpy(rangename, yytext, SZ_LINE-1);
-}
- YY_BREAK
-case 43:
-YY_RULE_SETUP
-#line 665 "filt.l"
-{
- _FiltLexRangeAdd(rangename, yytext, 3, nrange++, SZ_LINE);
-}
- YY_BREAK
-case 44:
-YY_RULE_SETUP
-#line 668 "filt.l"
-{
- _FiltLexRangeAdd(rangename, yytext, 1, nrange++, SZ_LINE);
-}
- YY_BREAK
-case 45:
-YY_RULE_SETUP
-#line 671 "filt.l"
-{
- _FiltLexRangeAdd(rangename, yytext, 4, nrange++, SZ_LINE);
-}
- YY_BREAK
-case 46:
-YY_RULE_SETUP
-#line 674 "filt.l"
-{
- _FiltLexRangeAdd(rangename, yytext, 2, nrange++, SZ_LINE);
-}
- YY_BREAK
-case 47:
-YY_RULE_SETUP
-#line 677 "filt.l"
-{ ; }
- YY_BREAK
-case 48:
-YY_RULE_SETUP
-#line 678 "filt.l"
-{ ; }
- YY_BREAK
-case 49:
-YY_RULE_SETUP
-#line 679 "filt.l"
-{ ; }
- YY_BREAK
-case 50:
-YY_RULE_SETUP
-#line 680 "filt.l"
-{
- _FiltLexParen(")");
- _FiltLexNew();
- BEGIN INITIAL;
-}
- YY_BREAK
-case 51:
-YY_RULE_SETUP
-#line 685 "filt.l"
-{
- _FiltLexParen(")");
- _FiltLexNew();
- _FiltLexParen(")");
- _FiltLexNew();
- BEGIN INITIAL;
-}
- YY_BREAK
-case 52:
-YY_RULE_SETUP
-#line 692 "filt.l"
-{
- _FiltLexParen(")");
- _FiltLexOp(yytext);
- BEGIN INITIAL;
-}
- YY_BREAK
-case 53:
-YY_RULE_SETUP
-#line 697 "filt.l"
-{
- _FiltLexParen(")");
- _FiltLexNew();
- BEGIN INITIAL;
-}
- YY_BREAK
-case 54:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
-YY_RULE_SETUP
-#line 703 "filt.l"
-{
- /* Found a routine */
- laststart = YY_START;
- BEGIN RTINE;
- narg = 0;
- nrparen = 0;
- _FiltLexTypeSet(TOK_RTINE);
- _FiltLexCat(FilterLexRoutine1(filt, yytext));
- nroutine++;
-}
- YY_BREAK
-case 55:
-YY_RULE_SETUP
-#line 713 "filt.l"
-{
- /* explicit rule avoids the _FiltLexNew of general rule */
- _FiltLexCat(",");
-}
- YY_BREAK
-case 56:
-YY_RULE_SETUP
-#line 717 "filt.l"
-{
- nrparen++;
- _FiltLexCat("(");
-}
- YY_BREAK
-case 57:
-YY_RULE_SETUP
-#line 721 "filt.l"
-{
- nrparen--;
- if( nrparen ){
- _FiltLexCat(")");
- }
- else{
- /* end of routine */
- BEGIN laststart;
- _FiltLexCat(FilterLexRoutine2(filt, ")"));
- }
-}
- YY_BREAK
-case 58:
-YY_RULE_SETUP
-#line 733 "filt.l"
-{
- /* Found an include file */
- char *s, *t;
- if( YY_START == REG ){
- _FiltLexRegionEnd();
- _FiltLexNew();
- }
- /* handle FITS mask file specially */
- filt->nmask = _FiltFitsMask(yytext+1,
- &(filt->masks),
- &(filt->maskhd),
- &(filt->nmaskreg));
- /* filt->nmask == -1 => its not a FITS file */
- if( filt->nmask != -1 ){
- switch(filt->nmask){
- case -2:
- _filterror("FITS image mask must be image data -");
- break;
- case -3:
- _filterror("Invalid dimensions for FITS image mask -");
- break;
- case -4:
- _filterror("FITS image mask cannot contain negative values -");
- break;
- default:
- if( (filt->type != TYPE_IMAGE) && !filt->evsect ){
- _filterror("FITS image mask is valid for image filtering only -");
- }
- else{
- if( nmask )
- _filterror("only one FITS image mask allowed at a time -");
- else
- nmask++;
- }
- break;
- }
- }
- else{
- if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) {
- _filterror("include files are nested too deeply");
- }
- if( (s = (char *)FileContents(yytext+1, 0, NULL)) == NULL ){
- _filterror("can't access include file");
- }
- /* ignore empty include file */
- else if( *s == '\0' ){
- ;
- }
- else {
- t = FilterClip(s);
- xfree(s);
- if( t && *t ){
- include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER;
- _FiltLexNew();
- _FiltLexParen("(");
- FiltScanString(t);
- xfree(t);
- }
- }
- }
-}
- YY_BREAK
-case 59:
-YY_RULE_SETUP
-#line 795 "filt.l"
-{
- if( !FilterSymbolEnter(filt, yytext, &got) ){
- switch(got){
- case -1:
- _filterror("missing column or header parameter");
- break;
- case -2:
- _filterror("column is not an array");
- break;
- case -3:
- _filterror("internal error while processing column");
- break;
- }
- }
- else{
- narg++;
- /* add if initial condition (not region, routine, etc.) */
- if( YY_START == INITIAL ) _FiltLexTypeSet(TOK_NAME);
- _FiltLexCat(FilterLexName(filt,yytext));
- }
-}
- YY_BREAK
-case 60:
-YY_RULE_SETUP
-#line 817 "filt.l"
-{ ; /* ignore white space */ }
- YY_BREAK
-case 61:
-YY_RULE_SETUP
-#line 819 "filt.l"
-{ narg++; _FiltLexCat(yytext); }
- YY_BREAK
-case 62:
-YY_RULE_SETUP
-#line 821 "filt.l"
-{
- char tbuf[SZ_LINE];
- bin2num(tbuf, yytext, SZ_LINE-1);
- narg++;
- _FiltLexCat(tbuf);
- }
- YY_BREAK
-case 63:
-YY_RULE_SETUP
-#line 828 "filt.l"
-{
- _FiltLexOp(yytext);
- if( YY_START != RTINE ) BEGIN INITIAL;
-}
- YY_BREAK
-case 64:
-YY_RULE_SETUP
-#line 833 "filt.l"
-{
- nparen++;
- _FiltLexNew();
- _FiltLexCat(yytext);
- _FiltLexNew();
-}
- YY_BREAK
-case 65:
-YY_RULE_SETUP
-#line 839 "filt.l"
-{
- nparen--;
- _FiltLexNew();
- _FiltLexCat(yytext);
- _FiltLexNew();
-}
- YY_BREAK
-case 66:
-YY_RULE_SETUP
-#line 845 "filt.l"
-{
- _FiltLexNew();
- BEGIN INITIAL;
-}
- YY_BREAK
-case 67:
-YY_RULE_SETUP
-#line 850 "filt.l"
-{ _FiltLexCat(yytext); }
- YY_BREAK
-case YY_STATE_EOF(INITIAL):
-case YY_STATE_EOF(RLIST):
-case YY_STATE_EOF(RTINE):
-case YY_STATE_EOF(REG):
-case YY_STATE_EOF(AREG):
-case YY_STATE_EOF(INCLUDE):
-case YY_STATE_EOF(COMM):
-#line 852 "filt.l"
-{
- if ( --include_stack_ptr < 0 ){
- _FiltLexMake();
- yy_delete_buffer( YY_CURRENT_BUFFER );
- yyterminate();
- } else {
- _FiltLexParen(")");
- _FiltLexNew();
- yy_delete_buffer( YY_CURRENT_BUFFER );
- yy_switch_to_buffer(include_stack[include_stack_ptr] );
- }
-}
- YY_BREAK
-case 68:
-YY_RULE_SETUP
-#line 865 "filt.l"
-ECHO;
- YY_BREAK
-#line 5704 "lex.filt.c"
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - filttext_ptr) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = yy_hold_char;
- YY_RESTORE_YY_MORE_OFFSET
-
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
- {
- /* We're scanning a new file or input source. It's
- * possible that this happened because the user
- * just pointed yyin at a new source and called
- * yylex(). If so, then we have to assure
- * consistency between yy_current_buffer and our
- * globals. Here is the right place to do so, because
- * this is the first action (other than possibly a
- * back-up) that will match for the new input source.
- */
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yy_current_buffer->yy_input_file = yyin;
- yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- /* Note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the
- * end-of-buffer state). Contrast this with the test
- * in input().
- */
- if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- yy_c_buf_p = filttext_ptr + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state();
-
- /* Okay, we're now positioned to make the NUL
- * transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we don't
- * want to build jamming into it because then it
- * will run more slowly).
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
-
- yy_bp = filttext_ptr + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++yy_c_buf_p;
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- yy_cp = yy_c_buf_p;
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_END_OF_FILE:
- {
- yy_did_buffer_switch_on_eof = 0;
-
- if ( yywrap() )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * yytext, we can now set up
- * yy_c_buf_p so that if some total
- * hoser (like flex itself) wants to
- * call the scanner after we return the
- * YY_NULL, it'll still work - another
- * YY_NULL will get returned.
- */
- yy_c_buf_p = filttext_ptr + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p =
- filttext_ptr + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state();
-
- yy_cp = yy_c_buf_p;
- yy_bp = filttext_ptr + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- yy_c_buf_p =
- &yy_current_buffer->yy_ch_buf[yy_n_chars];
-
- yy_current_state = yy_get_previous_state();
-
- yy_cp = yy_c_buf_p;
- yy_bp = filttext_ptr + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- } /* end of action switch */
- } /* end of scanning one token */
- } /* end of yylex */
-
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
- */
-
-static int yy_get_next_buffer()
- {
- register char *dest = yy_current_buffer->yy_ch_buf;
- register char *source = filttext_ptr;
- register int number_to_move, i;
- int ret_val;
-
- if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- if ( yy_current_buffer->yy_fill_buffer == 0 )
- { /* Don't try to fill the buffer, so this is an EOF. */
- if ( yy_c_buf_p - filttext_ptr - YY_MORE_ADJ == 1 )
- {
- /* We matched a single character, the EOB, so
- * treat this as a final EOF.
- */
- return EOB_ACT_END_OF_FILE;
- }
-
- else
- {
- /* We matched some text prior to the EOB, first
- * process it.
- */
- return EOB_ACT_LAST_MATCH;
- }
- }
-
- /* Try to read more data. */
-
- /* First move last chars to start of buffer. */
- number_to_move = (int) (yy_c_buf_p - filttext_ptr) - 1;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- yy_current_buffer->yy_n_chars = yy_n_chars = 0;
-
- else
- {
- int num_to_read =
- yy_current_buffer->yy_buf_size - number_to_move - 1;
-
- while ( num_to_read <= 0 )
- { /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
- YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
-
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = yy_current_buffer;
-
- int yy_c_buf_p_offset =
- (int) (yy_c_buf_p - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
-
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
-
- b->yy_ch_buf = (char *)
- /* Include room in for 2 EOB chars. */
- yy_flex_realloc( (void *) b->yy_ch_buf,
- b->yy_buf_size + 2 );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
- num_to_read = yy_current_buffer->yy_buf_size -
- number_to_move - 1;
-#endif
- }
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* Read in more data. */
- YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
- yy_n_chars, num_to_read );
-
- yy_current_buffer->yy_n_chars = yy_n_chars;
- }
-
- if ( yy_n_chars == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- yyrestart( yyin );
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- yy_current_buffer->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- yy_n_chars += number_to_move;
- yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
- filttext_ptr = &yy_current_buffer->yy_ch_buf[0];
-
- return ret_val;
- }
-
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-static yy_state_type yy_get_previous_state()
- {
- register yy_state_type yy_current_state;
- register char *yy_cp;
-
- yy_current_state = yy_start;
- yy_state_ptr = yy_state_buf;
- *yy_state_ptr++ = yy_current_state;
-
- for ( yy_cp = filttext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 1688 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- *yy_state_ptr++ = yy_current_state;
- }
-
- return yy_current_state;
- }
-
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- * next_state = yy_try_NUL_trans( current_state );
- */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
- {
- register int yy_is_jam;
-
- register YY_CHAR yy_c = 1;
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 1688 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 1687);
- if ( ! yy_is_jam )
- *yy_state_ptr++ = yy_current_state;
-
- return yy_is_jam ? 0 : yy_current_state;
- }
-
-
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
- {
- register char *yy_cp = yy_c_buf_p;
-
- /* undo effects of setting up yytext */
- *yy_cp = yy_hold_char;
-
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- /* +2 for EOB chars. */
- register int number_to_move = yy_n_chars + 2;
- register char *dest = &yy_current_buffer->yy_ch_buf[
- yy_current_buffer->yy_buf_size + 2];
- register char *source =
- &yy_current_buffer->yy_ch_buf[number_to_move];
-
- while ( source > yy_current_buffer->yy_ch_buf )
- *--dest = *--source;
-
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- yy_current_buffer->yy_n_chars =
- yy_n_chars = yy_current_buffer->yy_buf_size;
-
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
-
- *--yy_cp = (char) c;
-
-
- filttext_ptr = yy_bp;
- yy_hold_char = *yy_cp;
- yy_c_buf_p = yy_cp;
- }
-#endif /* ifndef YY_NO_UNPUT */
-
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput()
-#else
-static int input()
-#endif
- {
- int c;
-
- *yy_c_buf_p = yy_hold_char;
-
- if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
- /* This was really a NUL. */
- *yy_c_buf_p = '\0';
-
- else
- { /* need more input */
- int offset = yy_c_buf_p - filttext_ptr;
- ++yy_c_buf_p;
-
- switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_LAST_MATCH:
- /* This happens because yy_g_n_b()
- * sees that we've accumulated a
- * token and flags that we need to
- * try matching the token before
- * proceeding. But for input(),
- * there's no matching to consider.
- * So convert the EOB_ACT_LAST_MATCH
- * to EOB_ACT_END_OF_FILE.
- */
-
- /* Reset buffer status. */
- yyrestart( yyin );
-
- /* fall through */
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( yywrap() )
- return EOF;
-
- if ( ! yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
-#ifdef __cplusplus
- return yyinput();
-#else
- return input();
-#endif
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p = filttext_ptr + offset;
- break;
- }
- }
- }
-
- c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
- *yy_c_buf_p = '\0'; /* preserve yytext */
- yy_hold_char = *++yy_c_buf_p;
-
-
- return c;
- }
-#endif /* YY_NO_INPUT */
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
- {
- if ( ! yy_current_buffer )
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
-
- yy_init_buffer( yy_current_buffer, input_file );
- yy_load_buffer_state();
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
- {
- if ( yy_current_buffer == new_buffer )
- return;
-
- if ( yy_current_buffer )
- {
- /* Flush out information for old buffer. */
- *yy_c_buf_p = yy_hold_char;
- yy_current_buffer->yy_buf_pos = yy_c_buf_p;
- yy_current_buffer->yy_n_chars = yy_n_chars;
- }
-
- yy_current_buffer = new_buffer;
- yy_load_buffer_state();
-
- /* We don't actually know whether we did this switch during
- * EOF (yywrap()) processing, but the only time this flag
- * is looked at is after yywrap() is called, so it's safe
- * to go ahead and always set it.
- */
- yy_did_buffer_switch_on_eof = 1;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
- {
- yy_n_chars = yy_current_buffer->yy_n_chars;
- filttext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
- yyin = yy_current_buffer->yy_input_file;
- yy_hold_char = *yy_c_buf_p;
- }
-
-
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
- {
- YY_BUFFER_STATE b;
-
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_buf_size = size;
-
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_is_our_buffer = 1;
-
- yy_init_buffer( b, file );
-
- return b;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
- {
- if ( ! b )
- return;
-
- if ( b == yy_current_buffer )
- yy_current_buffer = (YY_BUFFER_STATE) 0;
-
- if ( b->yy_is_our_buffer )
- yy_flex_free( (void *) b->yy_ch_buf );
-
- yy_flex_free( (void *) b );
- }
-
-
-
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
- {
- yy_flush_buffer( b );
-
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
-
-#if YY_ALWAYS_INTERACTIVE
- b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
- b->yy_is_interactive = 0;
-#else
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-
- {
- if ( ! b )
- return;
-
- b->yy_n_chars = 0;
-
- /* We always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
- b->yy_buf_pos = &b->yy_ch_buf[0];
-
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- if ( b == yy_current_buffer )
- yy_load_buffer_state();
- }
-
-
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
- {
- YY_BUFFER_STATE b;
-
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
- /* They forgot to leave room for the EOB's. */
- return 0;
-
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- yy_switch_to_buffer( b );
-
- return b;
- }
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
- {
- int len;
- for ( len = 0; yy_str[len]; ++len )
- ;
-
- return yy_scan_bytes( yy_str, len );
- }
-#endif
-
-
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
- {
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
-
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = len + 2;
- buf = (char *) yy_flex_alloc( n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
- for ( i = 0; i < len; ++i )
- buf[i] = bytes[i];
-
- buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
-
- b = yy_scan_buffer( buf, n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
- /* It's okay to grow etc. this buffer, and we should throw it
- * away when we're done.
- */
- b->yy_is_our_buffer = 1;
-
- return b;
- }
-#endif
-
-
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
- {
- if ( yy_start_stack_ptr >= yy_start_stack_depth )
- {
- yy_size_t new_size;
-
- yy_start_stack_depth += YY_START_STACK_INCR;
- new_size = yy_start_stack_depth * sizeof( int );
-
- if ( ! yy_start_stack )
- yy_start_stack = (int *) yy_flex_alloc( new_size );
-
- else
- yy_start_stack = (int *) yy_flex_realloc(
- (void *) yy_start_stack, new_size );
-
- if ( ! yy_start_stack )
- YY_FATAL_ERROR(
- "out of memory expanding start-condition stack" );
- }
-
- yy_start_stack[yy_start_stack_ptr++] = YY_START;
-
- BEGIN(new_state);
- }
-#endif
-
-
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
- {
- if ( --yy_start_stack_ptr < 0 )
- YY_FATAL_ERROR( "start-condition stack underflow" );
-
- BEGIN(yy_start_stack[yy_start_stack_ptr]);
- }
-#endif
-
-
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
- {
- return yy_start_stack[yy_start_stack_ptr - 1];
- }
-#endif
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
-#else
-static void yy_fatal_error( msg )
-char msg[];
-#endif
- {
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
- }
-
-
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- yytext[yyleng] = yy_hold_char; \
- yy_c_buf_p = yytext + n; \
- yy_hold_char = *yy_c_buf_p; \
- *yy_c_buf_p = '\0'; \
- yyleng = n; \
- } \
- while ( 0 )
-
-
-/* Internal utility routines. */
-
-#ifndef filttext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
- {
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
- }
-#endif
-
-#ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
- {
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
-
- return n;
- }
-#endif
-
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
- {
- return (void *) malloc( size );
- }
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
- {
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
- }
-
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
- {
- free( ptr );
- }
-
-#if YY_MAIN
-int main()
- {
- yylex();
- return 0;
- }
-#endif
-#line 865 "filt.l"
-
-
-/*
- *
- * Private Routines
- *
- *
- */
-
-
-#ifdef YY_USE_PROTOS
-static void floatprefix(void)
-#else
-static void floatprefix()
-#endif
-{
- if( filt->method == METHOD_C )
- _FiltLexCat("(double)");
-}
-
-#ifdef YY_USE_PROTOS
-static void floatsuffix(void)
-#else
-static void floatsuffix()
-#endif
-{
- return;
-}
-
-#ifdef YY_USE_PROTOS
-static void
-bin2num(char *d, char *s, int maxlen)
-#else
-static void
-bin2num(d, s, maxlen)
- char *d;
- char *s;
- int maxlen;
-#endif
-{
- unsigned long bits;
- char *p=NULL;
-
- if( strlen(s) < 2 ){
- if( d != s ) strncpy(d, s, maxlen-1);
- }
- else{
- if( (*s=='0') && (*(s+1)=='b') ){
- bits = strtoul(s+2, &p, 2);
- if( *p != '\0' ) _filterror("invalid binary value");
- snprintf(d, maxlen, "%lx", bits);
- if( (strlen(d) <2) || (*d!='0') || ((*(d+1)!='x')&&((*(d+1)!='X'))) ){
- snprintf(d, maxlen, "0x%lx", bits);
- }
- }
- else{
- if( d != s ) strncpy(d, s, maxlen-1);
- }
- }
-}
-
-/*
- *
- * _FiltLexNew -- finish last start and set up new filter segment
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexNew(void)
-#else
-static void _FiltLexNew()
-#endif
-{
- int i;
- int last;
-
- if( nfiltseg >= maxfiltseg ){
- last = maxfiltseg;
- if( maxfiltseg == 0 ){
- maxfiltseg = SEGINC;
- filtseg = (FiltSeg *)xmalloc(maxfiltseg * sizeof(FiltSeg));
- }
- else{
- maxfiltseg += SEGINC;
- filtseg = (FiltSeg *)xrealloc(filtseg, maxfiltseg * sizeof(FiltSeg));
- }
- /* clear the unused records */
- for(i=last; i<maxfiltseg; i++){
- filtseg[i] = NULL;
- }
- }
- if( !nfiltseg || (filtseg[nfiltseg-1] && filtseg[nfiltseg-1]->s) ){
- filtseg[nfiltseg] = (FiltSeg)xcalloc(1, sizeof(FiltSegRec));
- nfiltseg++;
- }
- filtseg[nfiltseg-1]->n = nfiltseg-1;
- filtseg[nfiltseg-1]->nregion = 0;
-}
-
-/*
- *
- * _FiltLexParen -- add a paren to the filter string buffer
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexParen(char *str)
-#else
-static void _FiltLexParen(str)
- char *str;
-#endif
-{
- /* _FiltLexNew(); */
- _FiltLexCat(str);
- /* _FiltLexNew(); */
-}
-
-/*
- *
- * __FiltLexCat -- add a string to the filter string buffer
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-__FiltLexCat(char *str, char **ostr, int *olen)
-#else
-static void __FiltLexCat(str, ostr, olen)
- char *str;
- char **ostr;
- int *olen;
-#endif
-{
- int blen;
- int slen;
-
- if( (str == NULL) || (*str == '\0') )
- return;
- else
- slen = strlen(str) + 1;
-
- if( (*ostr == NULL) || (**ostr == '\0') )
- blen = 0;
- else
- blen = strlen(*ostr);
-
- while( (blen + slen) >= *olen ){
- *olen += SEGINC;
- }
- if( blen == 0 )
- *ostr = (char *)xcalloc(*olen, sizeof(char));
- else
- *ostr = (char *)xrealloc(*ostr, *olen);
- strcat(*ostr, str);
-}
-
-/*
- *
- * _FiltLexCat -- add a string to the filter string buffer
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexCat(char *str)
-#else
-static void _FiltLexCat(str)
- char *str;
-#endif
-{
- char *s;
- if( !str || !*str )
- return;
- if( nfiltseg ==0 )
- _FiltLexNew();
- s = xmalloc(strlen(str)+1);
- nowhite(str, s);
- __FiltLexCat(s, &(filtseg[nfiltseg-1]->s), &(filtseg[nfiltseg-1]->len));
- if( s ) xfree(s);
-}
-
-/*
- *
- * _FiltLexArgSave -- save a radius or angle value to the temp string:
- * this is a special hack for funcnts
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexArgSave(double dval)
-#else
-static void _FiltLexArgSave(dval)
- double dval;
-#endif
-{
- char tbuf[SZ_LINE];
-
- if( narg < 3 )
- return;
- snprintf(tbuf, SZ_LINE, DFMT1, dval);
- if( narg == 3 ){
- *lastarg = '\0';
- lastd1 = 0.0;
- lastd2 = 0.0;
- if( filtseg[nfiltseg-1]->radang ){
- xfree(filtseg[nfiltseg-1]->radang);
- filtseg[nfiltseg-1]->radang = NULL;
- filtseg[nfiltseg-1]->ralen = 0;
- }
- }
- switch(regid){
- case TY_ANNULUS:
- case TY_CIRCLE:
- if( *lastarg ){
- __FiltLexCat(lastarg, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- if( narg > 3 ){
- __FiltLexCat(",NA,NA\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- strcpy(lastarg, tbuf);
- }
- lastd1 = lastd2;
- lastd2 = dval;
- break;
-
- case TY_BOX:
- case TY_ELLIPSE:
- if( (narg%2) == 1 ){
- if( *lastarg ){
- __FiltLexCat(lastarg, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- if( narg > 3 ){
- __FiltLexCat(",NA,NA\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- strcpy(lastarg, tbuf);
- }
- lastd1 = lastd2;
- lastd2 = dval;
- }
- break;
-
- case TY_PIE:
- if( narg == 3 ){
- __FiltLexCat("NA,NA", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- else if( *lastarg ){
- __FiltLexCat("NA,NA,", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- __FiltLexCat(lastarg, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- if( narg > 3 ){
- __FiltLexCat("\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- strcpy(lastarg, tbuf);
- }
- lastd1 = lastd2;
- lastd2 = dval;
- break;
-
- case TY_POINT:
- /* we have to process this here if its is a varargs */
- /* so, for the 3rd arg, we add a line for initial x, y pair */
- if( narg == 3 ){
- __FiltLexCat("NA,NA,NA,NA\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- /* and for every even arg, add a line for the preceeding x,y pair */
- else if( (narg % 2) == 0 ){
- __FiltLexCat("NA,NA,NA,NA\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- break;
- default:
- return;
- }
-}
-
-/*
- *
- * _FiltLexAccel -- appply acceleration to a segment
- *
- */
-#ifdef YY_USE_PROTOS
-static int
-_FiltLexAccel(int n)
-#else
-static int _FiltLexAccel(n)
- int n;
-#endif
-{
- int i;
- char tbuf[SZ_LINE];
- char *s;
- double dinc;
-
- /* check region type */
- switch(regid){
- case TY_ANNULUS:
- break;
- case TY_BOX:
- narg -= 2;
- break;
- case TY_CIRCLE:
- narg -= 1;
- break;
- case TY_ELLIPSE:
- narg -= 2;
- break;
- case TY_PIE:
- break;
- default:
- _filterror("annulus, box, circle, ellipse, pie accelerators only - ");
- break;
- }
- /* add the argument */
- snprintf(tbuf, SZ_LINE, IFMT1, n);
- _FiltLexCat(tbuf);
- /* change the name of the routine we will call */
- if( filtseg[nfiltseg-1]->s0 ){
- if( (s = xstrdup(&filtseg[nfiltseg-1]->s[filtseg[nfiltseg-1]->s0])) ){
- filtseg[nfiltseg-1]->s[filtseg[nfiltseg-1]->s0] = '\0';
- _FiltLexCat("n");
- _FiltLexCat(s);
- snprintf(tbuf, SZ_LINE, "%d ", n);
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->regions),
- &(filtseg[nfiltseg-1]->nr));
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->shapes),
- &(filtseg[nfiltseg-1]->ns));
- setargs = 1;
- free (s);
- }
- if( filtseg[nfiltseg-1]->radang ){
- xfree(filtseg[nfiltseg-1]->radang);
- filtseg[nfiltseg-1]->radang = NULL;
- filtseg[nfiltseg-1]->ralen = 0;
- }
- switch(regid){
- case TY_ANNULUS:
- case TY_BOX:
- case TY_CIRCLE:
- case TY_ELLIPSE:
- dinc = (lastd2 - lastd1)/n;
- for(i=1; i<=n; i++){
- snprintf(tbuf, SZ_LINE, DFMT2, lastd1+((i-1)*dinc), lastd1+(i*dinc));
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- __FiltLexCat(",NA,NA", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- __FiltLexCat("\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- break;
- case TY_PIE:
- dinc = (lastd2 - lastd1)/n;
- for(i=1; i<=n; i++){
- snprintf(tbuf, SZ_LINE, DFMT2, lastd1+((i-1)*dinc), lastd1+(i*dinc));
- __FiltLexCat("NA,NA", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- __FiltLexCat("\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- }
- break;
- default:
- _filterror("annulus, box, circle, ellipse, pie accelerators only - ");
- break;
- }
- _FiltLexTypeSet(TOK_ACCEL);
- }
- else{
- _filterror("misplaced accelerator");
- }
- return(n);
-}
-
-/*
- *
- * _FiltLexTypeSet -- add type info to the filter segment record
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexTypeSet(int type)
-#else
-static void _FiltLexTypeSet(type)
- int type;
-#endif
-{
- if( nfiltseg ==0 )
- _FiltLexNew();
- filtseg[nfiltseg-1]->type |= type;
-}
-
-/*
- *
- * _FiltLexOp -- add an operator to the filter segment record
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexOp(char *op)
-#else
-static void _FiltLexOp(op)
- char *op;
-#endif
-{
- _FiltLexCat(op);
- filtseg[nfiltseg-1]->ops += 1;
-}
-
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexRegionStart(int docols)
-#else
-static void _FiltLexRegionStart(docols)
- int docols;
-#endif
-{
- char *s, *t;
- char tbuf[SZ_LINE];
-
- /* sanity check -- 1D images do not support regions */
- if( (filt->type == TYPE_IMAGE) && (ft_naxes(filt->fhd)==1) ){
- _filterror("2D region filters invalid for 1D images");
- }
- narg = 0;
- setargs=0;
- s = xmalloc(strlen(yytext)+1);
- nowhite(yytext, s);
- if( *s == '+' ){
- regtype = TOK_IREG;
- strcpy(regname, s+1);
- }
- else if( *s == '-' ){
- regtype = TOK_EREG;
- strcpy(regname, s+1);
- }
- else if( *s == '!' ){
- regtype = TOK_NREG;
- strcpy(regname, s+1);
- }
- else{
- regtype = TOK_IREG;
- strcpy(regname, s);
- }
- _FiltLexTypeSet(regtype);
- if( !(t=strchr(regname, '(')) ){
- nsparen=0;
- }
- /* remove the paren from the regname string -- we will explicitly add it */
- else{
- *t = '\0';
- nsparen=1;
- }
- /* convert to lower case, remove white space */
- culc(regname);
- nowhite(regname, s);
- strcpy(regname, s);
- /* convert abbrev to region */
- if( !strncmp(regname, "ann", 3) ){
- strcpy(regname, "annulus");
- regid = TY_ANNULUS;
- }
- else if( !strncmp(regname, "box", 3) ){
- strcpy(regname, "box");
- regid = TY_BOX;
- }
- else if( !strncmp(regname, "cir", 3) ){
- strcpy(regname, "circle");
- regid = TY_CIRCLE;
- }
- else if( !strncmp(regname, "ell", 3) ){
- strcpy(regname, "ellipse");
- regid = TY_ELLIPSE;
- }
- else if( !strncmp(regname, "fie", 3) ){
- strcpy(regname, "field");
- regid = TY_FIELD;
- }
- else if( !strncmp(regname, "lin", 3) ){
- strcpy(regname, "line");
- regid = TY_LINE;
- }
- else if( !strncmp(regname, "pan", 3) ){
- strcpy(regname, "panda");
- regid = TY_PANDA;
- }
- else if( !strncmp(regname, "bpa", 3) ){
- strcpy(regname, "bpanda");
- regid = TY_BPANDA;
- }
- else if( !strncmp(regname, "cpa", 3) ){
- strcpy(regname, "cpanda");
- regid = TY_CPANDA;
- }
- else if( !strncmp(regname, "epa", 3) ){
- strcpy(regname, "epanda");
- regid = TY_EPANDA;
- }
- else if( !strncmp(regname, "pie", 3) ){
- strcpy(regname, "pie");
- regid = TY_PIE;
- }
- else if( !strncmp(regname, "qtp", 3) ){
- strcpy(regname, "qtpie");
- regid = TY_PIE;
- }
- else if( !strncmp(regname, "poi", 3) ){
- strcpy(regname, "point");
- regid = TY_POINT;
- }
- else if( !strncmp(regname, "pol", 3) ){
- strcpy(regname, "polygon");
- regid = TY_POLYGON;
- }
- else if( !strcmp(regname, "imagemask") ){
- regid = TY_IMAGEMASK;
- }
- /* append filter-type prefix */
- switch( filt->type ){
- case TYPE_EVENTS:
- /* normally, we filter rows analytically using evregions.o */
- if( !filt->evsect )
- _FiltLexCat("ev");
- /* if evsect=xxx is specified, we filter by image pixels */
- else
- _FiltLexCat("im");
- break;
- case TYPE_IMAGE:
- /* image are filtered by image pixels */
- _FiltLexCat("im");
- break;
- }
- /* no region value to start */
- filtseg[nfiltseg-1]->regval = 0;
- /* save size of current string so we can get back to the region string */
- filtseg[nfiltseg-1]->s0 = strlen(filtseg[nfiltseg-1]->s);
- /* append region */
- _FiltLexCat(FilterLexRegion1(filt,regname));
- /* append standard args */
- _FiltLexCat("(g,$RS,");
- /* add include/exclude and whether we mark y lines for this region
- (we don't mark y on excludes as an optimization) */
- switch(regtype){
- case TOK_IREG:
- snprintf(tbuf, SZ_LINE, "1,%d", TOK_IREG);
- _FiltLexCat(tbuf);
- break;
- case TOK_NREG:
- snprintf(tbuf, SZ_LINE, "0,%d", TOK_NREG);
- _FiltLexCat(tbuf);
- break;
- case TOK_EREG:
- snprintf(tbuf, SZ_LINE, "0,%d", TOK_EREG);
- _FiltLexCat(tbuf);
- break;
- }
- switch(docols){
- case 0:
- /* initialize default columns for tables -- but don't enter symbols yet */
- FilterSymbolDefaults(filt, 0);
- /* initialize wcs for default image case */
- _FiltLexWcsCols(filt->fhd, filt->xbin, filt->ybin);
- _FiltLexCat(",");
- floatprefix();
- _FiltLexCat("x");
- floatsuffix();
- _FiltLexCat(",");
- floatprefix();
- _FiltLexCat("y");
- floatsuffix();
- break;
- case 1:
- if( !initbindefs ){
- /* initialize default columns for tables and enter symbols */
- FilterSymbolDefaults(filt, 1);
- /* initialize wcs for default table case */
- _FiltLexWcsCols(filt->fhd, filt->xbin, filt->ybin);
- initbindefs++;
- }
- if( !filt->xbin || !filt->ybin ){
- _filterror("two binning columns are required for regions");
- }
- _FiltLexCat(",");
- floatprefix();
- _FiltLexCat(filt->xbin);
- floatsuffix();
- _FiltLexCat(",");
- floatprefix();
- _FiltLexCat(filt->ybin);
- floatsuffix();
- break;
- case 2:
- _FiltLexCat(",");
- floatprefix();
- _FiltLexCat(colnames[0]);
- floatsuffix();
- _FiltLexCat(",");
- floatprefix();
- _FiltLexCat(colnames[1]);
- floatsuffix();
- break;
- }
- if( s ) xfree(s);
-}
-
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexRegionVal(char *s)
-#else
-static void
-_FiltLexRegionVal(s)
- char *s;
-#endif
-{
- char *t=NULL;
- if( (t=strchr(s, '{')) ){
- t++;
- }
- else{
- t = s;
- }
- filtseg[nfiltseg-1]->regval = atoi(t);
-}
-
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexRegionEnd(void)
-#else
-static void
-_FiltLexRegionEnd()
-#endif
-{
- int n;
- char *s;
- char ebuf[SZ_LINE];
- char tbuf[SZ_LINE];
-
- /* add final arguments as required */
- switch( regid ){
- case TY_BOX:
- if( (narg%2) == 0 ){
- _FiltLexCat(",0.0"); narg++;
- }
- else{
- /* if we saved an angle arg, we need to replace the last position arg */
- if( *saveang ){
- if( (s=strrchr(filtseg[nfiltseg-1]->s, ',')) ){
- *s = '\0';
- _FiltLexCat(saveang);
- }
- }
- }
- break;
- case TY_ELLIPSE:
- if( (narg%2) == 0 ){
- _FiltLexCat(",0.0"); narg++;
- }
- else{
- /* if we saved an angle arg, we need to replace the last position arg */
- if( *saveang ){
- if( (s=strrchr(filtseg[nfiltseg-1]->s, ',')) ){
- *s = '\0';
- _FiltLexCat(saveang);
- }
- }
- }
- break;
- case TY_BPANDA:
- case TY_EPANDA:
- if( (narg%2) == 0 ){
- _FiltLexCat(",0.0"); narg++;
- }
- /* drop through here to process panda */
- case TY_PANDA:
- case TY_CPANDA:
- _FiltLexRegionPanda();
- setargs = 1;
- break;
- default:
- break;
- }
-
- /* argument check */
- if( (n=_FiltLexArgCheck(regname, narg)) > 0 ){
- /* don't bother printing where we are in region */
- *yytext = '\0';
- switch( vargs[n-1] ){
- case 'n':
- snprintf(ebuf, SZ_LINE, "'%s' requires %d args (%d found)",
- rnames[n-1], rargs[n-1], narg);
- break;
- case 'e':
- snprintf(ebuf, SZ_LINE,
- "'%s' requires at least %d (even) args (%d found)",
- rnames[n-1], rargs[n-1], narg);
- break;
- case 'o':
- snprintf(ebuf, SZ_LINE,
- "'%s' requires at least %d (odd) args (%d found)",
- rnames[n-1], rargs[n-1], narg);
- break;
- case 'y':
- default:
- snprintf(ebuf, SZ_LINE, "'%s' requires %d args (%d found)",
- rnames[n-1], rargs[n-1], narg);
- break;
- }
- _filterror(ebuf);
- }
-
- /* process varargs */
- if( (n < 0) || (regid == TY_POLYGON) ){
- if( filtseg[nfiltseg-1]->type & TOK_ACCEL ){
- _filterror("n= and variable arglist cannot be combined -");
- }
- /* if its a varargs, we need to end with PSTOP values */
- snprintf(sbuf, SZ_LINE, DFMT2, PSTOP, PSTOP);
- _FiltLexCat(sbuf);
- /* change the name of the routine we will call */
- if( regid != TY_POLYGON ){
- if( filtseg[nfiltseg-1]->s0 ){
- if((s = xstrdup(&filtseg[nfiltseg-1]->s[filtseg[nfiltseg-1]->s0]))){
- filtseg[nfiltseg-1]->s[filtseg[nfiltseg-1]->s0] = '\0';
- _FiltLexCat("v");
- _FiltLexCat(s);
- switch(regid){
- case TY_ANNULUS:
- n = narg - 3;
- break;
- case TY_BOX:
- n = (narg - 5)/2;
- break;
- case TY_CIRCLE:
- n = narg - 3;
- break;
- case TY_ELLIPSE:
- n = (narg - 5)/2;
- break;
- case TY_PIE:
- n = narg - 3;
- break;
- case TY_POINT:
- n = narg/2;
- break;
- default:
- _filterror("varargs: annulus, box, circle, ellipse, pie, point;");
- break;
- }
- snprintf(tbuf, SZ_LINE, "%d ", n);
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->regions),
- &(filtseg[nfiltseg-1]->nr));
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->shapes),
- &(filtseg[nfiltseg-1]->ns));
- setargs = 1;
- free (s);
- }
- _FiltLexTypeSet(TOK_VARARGS);
- }
- else{
- _filterror("invalid varargs");
- }
- }
- }
-
-
- /* set number of regions and shapes, if not already done */
- if( !setargs ){
- snprintf(tbuf, SZ_LINE, "%d ", 1);
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->regions),
- &(filtseg[nfiltseg-1]->nr));
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->shapes),
- &(filtseg[nfiltseg-1]->ns));
- }
-
- /* finish off region string */
- _FiltLexCat(FilterLexRegion2(filt,")"));
-
- /* no column arguments */
- colargs = 0;
- /* arguments are not set */
- setargs = 0;
- /* save angle not set */
- *saveang = 0;
-}
-
-#ifdef YY_USE_PROTOS
-static int
-_FiltLexRegionPanda(void)
-#else
-static int
-_FiltLexRegionPanda()
-#endif
-{
- int i;
- int n=0;
- int got=0;
- int a, r;
- int ahi=0, rhi=0;
- int hi=0;
- double d[11];
- double ainc=0.0, rinc=0.0;
- char tbuf[SZ_LINE];
- char *s=NULL;
- char *t, *u;
-
- switch(regid){
- case TY_PANDA:
- case TY_CPANDA:
- hi = 7;
- break;
- case TY_BPANDA:
- case TY_EPANDA:
- hi = 10;
- break;
- default:
- _filterror("unknown panda type -- contact saord@cfa.harvard.edu");
- break;
- }
- s = xstrdup(filtseg[nfiltseg-1]->s);
- for(i=hi; i>=0; i--){
- /* look for last comma */
- t = strrchr(s, ',');
- if( !t ) goto done;
- /* null it out from base string */
- *t = '\0';
- /* point past comma and get double value */
- t++;
- d[i] = strtod(t, &u);
- if( t == u ) goto done;
- }
-
- switch(regid){
- case TY_PANDA:
- case TY_CPANDA:
- ainc = (d[3] - d[2])/d[4];
- ahi = (int)d[4];
- rinc = (d[6] - d[5])/d[7];
- rhi = (int)d[7];
- break;
- case TY_BPANDA:
- case TY_EPANDA:
- ainc = (d[3] - d[2])/d[4];
- ahi = (int)d[4];
- rinc = (d[7] - d[5])/d[9];
- rhi = (int)d[9];
- break;
- default:
- _filterror("unknown panda type -- contact saord@cfa.harvard.edu");
- break;
- }
- /* process limits arguments */
- for(a=1; a<=ahi; a++){
- for(r=1; r<=rhi; r++){
- snprintf(tbuf, SZ_LINE, DFMT4,
- d[5]+((r-1)*rinc), d[5]+(r*rinc),
- d[2]+((a-1)*ainc), d[2]+(a*ainc));
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- __FiltLexCat("\n", &(filtseg[nfiltseg-1]->radang),
- &(filtseg[nfiltseg-1]->ralen));
- n++;
- }
- }
-
- /* adjust region and shape count */
- snprintf(tbuf, SZ_LINE, "%d ", n);
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->regions),
- &(filtseg[nfiltseg-1]->nr));
- snprintf(tbuf, SZ_LINE, "%d ", 2*n);
- __FiltLexCat(tbuf, &(filtseg[nfiltseg-1]->shapes),
- &(filtseg[nfiltseg-1]->ns));
- _FiltLexTypeSet(TOK_ACCEL);
- /* success */
- got = 1;
-
-done:
- if( s ) xfree(s);
- return got;
-}
-
-/*
- *
- * _FiltLexRangeAdd -- add a rangelist string to the filter string buffer
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexRangeAdd(char *xname, char *str, int type, int n, int maxlen)
-#else
-static void _FiltLexRangeAdd(xname, str, type, n, maxlen)
- char *xname;
- char *str;
- int type;
- int n;
- int maxlen;
-#endif
-{
- char tbuf[SZ_LINE];
- char tbuf2[SZ_LINE];
- char *s;
- char *t;
- char *t2;
- char *name;
-
- /* get "in-expression" name for current technique */
- name = FilterLexName(filt, xname);
-
- /* initialize pointers */
- s = str;
- t = tbuf;
-
- /* clear working buffer */
- memset(t, 0, SZ_LINE);
-
- /* if this is not the beginning, we first need to OR with prev */
- if( n != 0 ) strncat(t, "||", maxlen-1);
-
- /* put in parens for safety */
- strncat(t, "(", maxlen-1);
-
- /* add the name */
- strncat(t, name, maxlen-1);
-
- /* add the rangelist */
- switch(type){
- case 1:
- strncat(t, "<=", maxlen-1);
- /* skip past : */
- s++;
- /* append value */
- t2 = tbuf2;
- while( *s ){
- *t2++ = *s++;
- }
- *t2 = '\0';
- bin2num(tbuf2, tbuf2, maxlen-1);
- strncat(t, tbuf2, maxlen-1);
- break;
- case 2:
- strncat(t, "==", maxlen-1);
- /* append upper value */
- t2 = tbuf2;
- while( *s ){
- *t2++ = *s++;
- }
- *t2 = '\0';
- bin2num(tbuf2, tbuf2, maxlen-1);
- strncat(t, tbuf2, maxlen-1);
- break;
- case 3:
- strncat(t, ">=", maxlen-1);
- /* append lower value */
- t2 = tbuf2;
- while( *s && (*s != ':') ){
- *t2++ = *s++;
- }
- *t2 = '\0';
- bin2num(tbuf2, tbuf2, maxlen-1);
- strncat(t, tbuf2, maxlen-1);
- /* skip past : */
- s++;
- strncat(t, "&&", maxlen-1);
- strncat(t, name, maxlen-1);
- strncat(t, "<=", maxlen-1);
- /* append upper value */
- t2 = tbuf2;
- while( *s ){
- *t2++ = *s++;
- }
- *t2 = '\0';
- bin2num(tbuf2, tbuf2, maxlen-1);
- strncat(t, tbuf2, maxlen-1);
- break;
- case 4:
- strncat(t, ">=", maxlen-1);
- /* append lower value */
- t2 = tbuf2;
- while( *s && (*s != ':') ){
- *t2++ = *s++;
- }
- *t2 = '\0';
- bin2num(tbuf2, tbuf2, maxlen-1);
- strncat(t, tbuf2, maxlen-1);
- break;
- }
- strncat(t, ")", maxlen-1);
- _FiltLexCat(tbuf);
-}
-
-/*
- *
- * _FiltLexTypeCmp -- compare routine for qsort
- *
- */
-#ifdef YY_USE_PROTOS
-static int
-_FiltLexTypeCmp(const void *s1, const void *s2)
-#else
-static int _FiltLexTypeCmp(s1, s2)
- const void *s1;
- const void *s2;
-#endif
-{
- FiltSeg *f1 = (FiltSeg *)s1;
- FiltSeg *f2 = (FiltSeg *)s2;
-
- /* check for broken qsort */
- if( !*f1 || !*f2 ){
- _filterror("qsort is broken -- contact saord@cfa.harvard.edu");
- /* will not happen */
- return 0;
- }
-
- /* make sure null string is at the end */
- if( !(*f1)->s && !(*f2)->s ) return 0;
- else if( !(*f1)->s ) return 1;
- else if( !(*f2)->s ) return -1;
-
- /* paint: reverse order and make excludes local */
- if( filt->paint ){
- /* if both are regions, reverse order */
- if( ((*f1)->type & TOK_REG) && ((*f2)->type & TOK_REG) ){
- if( (*f1)->n < (*f2)->n ) return 1;
- else if( (*f1)->n > (*f2)->n ) return -1;
- else return 0;
- }
- /* keep same order */
- else{
- if( (*f1)->n < (*f2)->n ) return -1;
- else if( (*f1)->n > (*f2)->n ) return 1;
- else return 0;
- }
- }
- else{
- /* if both or neither are eregions, keep them in the same order */
- if( ((*f1)->type & TOK_EREG) == ((*f2)->type & TOK_EREG) ){
- if( (*f1)->n < (*f2)->n ) return -1;
- else if( (*f1)->n > (*f2)->n ) return 1;
- else return 0;
- }
- /* exactly one is an eregion -- and we want eregions last */
- else{
- if( (*f1)->type & TOK_EREG ) return 1;
- else if( (*f2)->type & TOK_EREG ) return -1;
- /* should not happen */
- else return 0;
- }
- }
-}
-
-/*
- *
- * _FiltLexTypeMatch -- see if the type of filtering we are doing
- * matches the type of token we have
- *
- */
-#ifdef YY_USE_PROTOS
-int
-_FiltLexTypeMatch(int ftype, int ttype)
-#else
-int _FiltLexTypeMatch(ftype, ttype)
- int ftype;
- int ttype;
-#endif
-{
- switch(ftype){
- case TYPE_IMAGE:
- /* we don't allow range list and col names in image filters */
- if( (ttype & TOK_RLIST) || (ttype & TOK_NAME) )
- return 0;
- /* everything else is fine */
- else
- return 1;
- case TYPE_EVENTS:
- return 1;
- default:
- return 1;
- }
-}
-
-#ifdef YY_USE_PROTOS
-static int
-_FiltLexArgCheck(char *name, int args)
-#else
-static int _FiltLexArgCheck(name, args)
- char *name;
- int args;
-#endif
-{
- int i;
-
- for(i=0; rnames[i]; i++){
- if( !strcmp(name, rnames[i]) ){
- if( args == rargs[i] ){
- return(0);
- }
- else{
- /* less than required min */
- if( args < rargs[i] )
- return(i+1);
- /* more than min args -- could be varargs */
- else{
- /* check args allowed in varargs */
- switch(vargs[i]){
- case 'e':
- if( (args%2) == 0 )
- return(-1);
- else
- return(i+1);
- case 'o':
- if( (args%2) == 1 )
- return(-1);
- else
- return(i+1);
- case 'y':
- return(-1);
- default:
- return(i+1);
- }
- }
- }
- }
- }
- return(0);
-}
-
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexSetWcs(char *s)
-#else
-static void _FiltLexSetWcs(s)
- char *s;
-#endif
-{
- char name[SZ_LINE];
- int ip=0;
-
- newdtable(",=;");
- /* get name of global coordsys */
- if( word(s, name, &ip) ){
- if( gcoordsys ) xfree(gcoordsys);
- gcoordsys = xstrdup(name);
- culc(gcoordsys);
- }
- /* restore old delim table */
- freedtable();
-}
-
-#ifdef YY_USE_PROTOS
-static char *
-_FiltLexCB(char *name, void *client_data)
-#else
-static char *_FiltLexCB(name, client_data)
- char *name;
- void *client_data;
-#endif
-{
- FiltSeg f=(FiltSeg)client_data;
- int ip=0;
- int nr=0;
- int ns=0;
- char *s;
- char tbuf[SZ_LINE];
-
- if( !strcmp(name, "RS") ){
- /* exclude regions get no region value first time around */
- if( (macropass==0) && (f->type & TOK_EREG) ){
- return NULL;
- }
- /* get next region value and remove from string */
- if( word(f->regions, tbuf, &ip) ){
- nr = atoi(tbuf);
- s = xstrdup(&(f->regions[ip]));
- xfree(f->regions);
- f->regions = s;
- }
- else{
- _filterror("internal error: no region string specified");
- return(NULL);
- }
- if( !inexpr || (f->type & (TOK_ACCEL|TOK_VARARGS)) ){
- if( f->regval ){
- snprintf(macrobuf, SZ_LINE, "%d,", f->regval);
- }
- else{
- snprintf(macrobuf, SZ_LINE, "%d,", nregion+1);
- }
- nregion += nr;
- f->nregion += nr;
- inexpr = 1;
- }
- else{
- if( f->regval ){
- snprintf(macrobuf, SZ_LINE, "%d,", f->regval);
- }
- else{
- snprintf(macrobuf, SZ_LINE, "%d,", nregion);
- }
- }
-
- /* get next shape value and remove from string */
- ip = 0;
- if( word(f->shapes, tbuf, &ip) ){
- ns = atoi(tbuf);
- s = xstrdup(&(f->shapes[ip]));
- xfree(f->shapes);
- f->shapes = s;
- }
- else{
- _filterror("internal error: no shape string specified");
- return(NULL);
- }
- /* concat shape value */
- nshape++;
- snprintf(tbuf, SZ_LINE, "%d", nshape);
- strcat(macrobuf, tbuf);
- /* set new shape value */
- nshape += (ns-1);
-
- /* return macro value */
- return(macrobuf);
- }
- else{
- return NULL;
- }
-}
-
-/*
- *
- * _FiltLexNeedOp -- determine if we add a connecting operator for this segment
- *
- */
-#ifdef YY_USE_PROTOS
-static int
-_FiltLexNeedOp(int i, char *s)
-#else
-static int _FiltLexNeedOp(i, s)
- int i;
- char *s;
-#endif
-{
- int c;
- /* check for operator in current string */
- if( s && *s ){
- c = *s;
- switch(c){
- case '&':
- case '|':
- case '=':
- case '!':
- case '<':
- case '>':
- return 0;
- default:
- break;
- }
- }
- /* not in this string check for operator in previous */
- for(i=i-1; i>=0; i--){
- if( !filtseg[i] || !filtseg[i]->s ) continue;
- if( strcmp(filtseg[i]->s, "(") && strcmp(filtseg[i]->s, ")") )
- break;
- }
- if( i >= 0 ){
- c = filtseg[i]->s[strlen(filtseg[i]->s)-1];
- switch(c){
- case '&':
- case '|':
- case '=':
- case '!':
- case '<':
- case '>':
- return 0;
- default:
- return 1;
- }
- }
- else{
- return 0;
- }
-}
-
-/*
- *
- * _FiltLexMake -- generate filter from filter segments
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexMake(void)
-#else
-static void _FiltLexMake()
-#endif
-{
- int i, j, k, l;
- int x, xtot;
- int type=0;
- int ltype=0;
- int opar=0;
- char *s;
-
- /* debugging */
- if( filt->debug ){
- for(i=0; i<nfiltseg; i++){
- if( filtseg[i]->s )
- fprintf(stderr, "unsorted #%d %s\n", filtseg[i]->n, filtseg[i]->s);
- else
- fprintf(stderr, "unsorted #%d %d is empty\n", i, filtseg[i]->n);
- }
- }
- /* look for bad region expressions and determine how many regions we have */
- for(i=0, j=0, k=0, l=0; i<nfiltseg; i++){
- if( !filtseg[i] || !filtseg[i]->s ) continue;
- type = filtseg[i]->type;
- /* make sure we want the type being offered */
- if( !_FiltLexTypeMatch(filt->type, type) ){
- _filterror("column filters not permitted in an image filter expression");
- }
- /* look for bad combinations */
- if( (type & TOK_NREG) && !(type & TOK_IREG) )
- _filterror("!region must be combined with another region (e.g., field()&&!region)");
- if( (type & TOK_EREG) && (type & TOK_IREG) )
- _filterror("-region must not be combined with another region (use !region instead)");
- if( (type & TOK_EREG) && (type & TOK_NAME) )
- _filterror("-region must not be combined with filters (use !region instead)");
- if( (type & TOK_EREG) && (type & TOK_RLIST) )
- _filterror("-region must not be combined with range lists (use !region instead)");
- if( (type & TOK_EREG) && (type & TOK_RTINE) )
- _filterror("-region must not be combined with routines (use !region instead)");
- /* count region types */
- if( filtseg[i]->type & TOK_IREG ) j++;
- if( filtseg[i]->type & TOK_NREG ) k++;
- if( filtseg[i]->type & TOK_EREG ) l++;
- }
- /* check for fits image mask and process specially */
- if( filt->masks ){
- /* can't have fits mask and ascii regions */
- if( j || k || l ){
- _filterror("FITS image masks cannot be combined with ASCII regions");
- }
- /* image filtering of events uses a imagemask special routine */
- if( (filt->type == TYPE_EVENTS) && filt->evsect ){
- strcpy(yytext, "imagemask");
- _FiltLexRegionStart(1);
- _FiltLexRegionEnd();
- }
- else{
- __FiltLexCat("imagemask", &filter, &filtlen);
- nregion = filt->nmaskreg;
- return;
- }
- }
- /* if we have only exclude regions, add field */
- if( !j && !k && l ){
- strcpy(yytext, "field");
- if( filt->type == TYPE_EVENTS )
- _FiltLexRegionStart(1);
- else
- _FiltLexRegionStart(0);
- _FiltLexRegionEnd();
- }
-
- /* reset region and shape counts */
- nregion=0;
- nshape=0;
-
- /* expand macro before reordering, to maintain region numbers in sequence */
- for(i=0; i<nfiltseg; i++){
- if( filtseg[i] && filtseg[i]->s ){
- if( _FiltLexNeedOp(i, NULL) ) inexpr=0;
- macropass=0;
- s = ExpandMacro(filtseg[i]->s, NULL, NULL, 0, _FiltLexCB, filtseg[i]);
- xfree(filtseg[i]->s);
- filtseg[i]->s = s;
- }
- }
-
- /* we want descending order so that eregions are last in the expression */
- qsort(filtseg, nfiltseg, sizeof(FiltSeg), _FiltLexTypeCmp);
-
- if( filt->debug ){
- for(i=0; i<nfiltseg; i++){
- if( filtseg[i]->s )
- fprintf(stderr, "sorted #%d %s\n", filtseg[i]->n, filtseg[i]->s);
- else
- fprintf(stderr, "sorted #%d %d is empty\n", i, filtseg[i]->n);
- }
- }
-
- /* add open paren and mark that we did it */
- __FiltLexCat("(", &filter, &filtlen);
- opar = 1;
-
- /* run through segments, inserting proper boolean connectors */
- ltype = 0;
- for(i=0; i<nfiltseg; ){
- if( filtseg[i] && filtseg[i]->s ){
- /* no type probably means its a paren, so just add it and jump out */
- if( !filtseg[i]->type ){
- __FiltLexCat(filtseg[i]->s, &filter, &filtlen);
- /* remove empty parens, if we just make them */
- x = strlen(filter);
- if( (filter[x-2] == '(') && (filter[x-1] == ')') )
- filter[x-2] = '\0';
- i++;
- continue;
- }
- type = filtseg[i]->type;
- if( _FiltLexNeedOp(i, NULL) ) inexpr=0;
- macropass=1;
- s = ExpandMacro(filtseg[i]->s, NULL, NULL, 0, _FiltLexCB, filtseg[i]);
- if( _FiltLexNeedOp(i, s) ){
- /* remove trailing open parens from prev. segment (add back later) */
- for(xtot=0, x=strlen(filter)-1; x>=0; x--){
- if( filter[x] != '(' ) break;
- filter[x] = '\0';
- xtot++;
- }
- if( (ltype & TOK_IREG) && (type & TOK_IREG) ){
- __FiltLexCat("||", &filter, &filtlen);
- }
- else if( (ltype & TOK_IREG) && (type & TOK_EREG) ){
- if( opar > 0 ){
- __FiltLexCat(")", &filter, &filtlen);
- opar--;
- }
- if( filt->paint ){
- if( opar > 0 ){
- __FiltLexCat(")", &filter, &filtlen);
- opar --;
- }
- __FiltLexCat("||", &filter, &filtlen);
- }
- else{
- __FiltLexCat("&&", &filter, &filtlen);
- }
- __FiltLexCat("(", &filter, &filtlen);
- opar++;
- }
- else if( (ltype & TOK_EREG) && (type & TOK_EREG) ){
- __FiltLexCat("&&", &filter, &filtlen);
- }
- else if( (ltype & TOK_EREG) && (type & TOK_IREG) ){
- if( filt->paint && (opar > 0) ){
- __FiltLexCat(")", &filter, &filtlen);
- opar --;
- }
- __FiltLexCat("&&", &filter, &filtlen);
- __FiltLexCat("(", &filter, &filtlen);
- opar ++;
- if( filt->paint ){
- __FiltLexCat("(", &filter, &filtlen);
- opar++;
- }
- }
- /* otherwise implied operator is AND */
- else{
- __FiltLexCat("&&", &filter, &filtlen);
- }
- /* add back parens */
- for(x=0; x<xtot; x++){
- __FiltLexCat("(", &filter, &filtlen);
- }
- }
- else{
- if( filt->paint && (i==0) ){
- __FiltLexCat("((", &filter, &filtlen);
- opar +=2;
- }
- }
- __FiltLexCat(s, &filter, &filtlen);
- if( s ) xfree(s);
- if( filtseg[i]->radang ){
- if( *filtseg[i]->radang == ',' )
- __FiltLexCat(filtseg[i]->radang+1, &radang, &radanglen);
- else
- __FiltLexCat(filtseg[i]->radang, &radang, &radanglen);
- }
- else{
- __FiltLexCat("NA,NA,NA,NA\n", &radang, &radanglen);
- }
- i++;
- for(; (i<nfiltseg) && (filtseg[i]->type==type); ){
- if( _FiltLexNeedOp(i, NULL) ) inexpr=0;
- s = ExpandMacro(filtseg[i]->s, NULL, NULL, 0, _FiltLexCB, filtseg[i]);
- if( _FiltLexNeedOp(i, s) ){
- for(xtot=0, x=strlen(filter)-1; x>=0; x--){
- if( filter[x] != '(' ) break;
- filter[x] = '\0';
- xtot++;
- }
- /* if lhs and rhs are regions, implied operator is OR */
- if( type & TOK_IREG )
- __FiltLexCat("||", &filter, &filtlen);
- /* otherwise implied operator is AND */
- else
- __FiltLexCat("&&", &filter, &filtlen);
- for(x=0; x<xtot; x++){
- __FiltLexCat("(", &filter, &filtlen);
- }
- }
- __FiltLexCat(s, &filter, &filtlen);
- if( s ) xfree(s);
- if( filtseg[i]->radang ){
- if( *filtseg[i]->radang == ',' )
- __FiltLexCat(filtseg[i]->radang+1, &radang, &radanglen);
- else
- __FiltLexCat(filtseg[i]->radang, &radang, &radanglen);
- }
- else{
- __FiltLexCat("NA,NA,NA,NA\n", &radang, &radanglen);
- }
- i++;
- }
- }
- /* ignore invalid arguments */
- else{
- i++;
- }
- /* save last type */
- ltype = type;
- }
-
- /* if last segment was an exclude and we are in paint mode, ignore it */
- if( filt->paint && (ltype & TOK_EREG) ){
- __FiltLexCat("&&0", &filter, &filtlen);
- }
-
- /* close off open parens (lots could be needed in paint mode) */
- while( opar-- ){
- __FiltLexCat(")", &filter, &filtlen);
- }
-
- /* check for even number of parens */
- l = strlen(filter);
- for(i=0, j=0; i<l; i++){
- if( filter[i] == '(' ) j++;
- if( filter[i] == ')' ) j--;
- }
- if( j != 0 ){
- if( filt->debug ) fprintf(stderr, "paren error %d: %s\n", j, filter);
- _filterror("unbalanced parentheses");
- }
- if( filt->debug ) fprintf(stderr, "filter: %s\n", filter);
-}
-
-/*
- *
- * _FiltLexEnd -- cleanup from parsing regions
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexEnd(void)
-#else
-static void _FiltLexEnd()
-#endif
-{
- int i;
-
- /* reset state variables */
- colargs = 0;
- initbindefs = 0;
- include_stack_ptr = 0;
- nroutine = 0;
- nshape = 0;
- nmask = 0;
- nparen = 0;
- parse_error = 0;
- filtlen = 0;
- radanglen = 0;
- regid = 0;
- regtype = 0;
- inexpr = 0;
- *regname = '\0';
- *saveang = 0;
- *(wcsnames[0]) = '\0';
- *(wcsnames[1]) = '\0';
- binsiz[0] = 1;
- binsiz[1] = 1;
- /* free up previous filter */
- if( filter ){
- xfree(filter);
- filter = NULL;
- }
- /* free up previous radang string */
- if( radang ){
- xfree(radang);
- radang = NULL;
- }
- /* free up wcs */
- if( wcs ){
- wcsfree (wcs);
- wcs = NULL;
- }
- /* no segments */
- if( filtseg ){
- for(i=0; i<nfiltseg; i++){
- if( filtseg[i] ){
- if( filtseg[i]->s ) xfree(filtseg[i]->s);
- if( filtseg[i]->regions ) xfree(filtseg[i]->regions);
- if( filtseg[i]->shapes ) xfree(filtseg[i]->shapes);
- if( filtseg[i]->radang ) xfree(filtseg[i]->radang);
- xfree(filtseg[i]);
- }
- }
- xfree(filtseg);
- filtseg = NULL;
- }
- maxfiltseg = 0;
- nfiltseg = 0;
- if( gcoordsys ){
- xfree(gcoordsys);
- gcoordsys = NULL;
- }
- if( fcoordsys ){
- xfree(fcoordsys);
- fcoordsys = NULL;
- }
- cdelt1 = 0.0;
- cdelt2 = 0.0;
- crot = 0.0;
-}
-
-/*
- *
- * _FiltLexGetWcs -- determine the WCS coord system to use for wcsc translation
- *
- */
-#ifdef YY_USE_PROTOS
-static char *
-_FiltLexGetWcs(void)
-#else
-static char *_FiltLexGetWcs()
-#endif
-{
- if( gcoordsys &&
- strcmp(gcoordsys, "image") && strcmp(gcoordsys, "physical") )
- return gcoordsys;
- if( fcoordsys &&
- strcmp(fcoordsys, "image") && strcmp(fcoordsys, "physical") )
- return fcoordsys;
- return NULL;
-}
-
-/*
- *
- * _FiltLexWcsCols -- reset WCS for these columns
- *
- */
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexWcsCols(FITSHead iheader, char *name0, char *name1)
-#else
-static void _FiltLexWcsCols(iheader, name0, name1)
- FITSHead iheader;
- char *name0;
- char *name1;
-#endif
-{
- int i, which, ival;
- int simple=1;
- double dval, dval2;
- char *s;
- FITSHead oheader;
- FITSCard card;
-
- /* make sure we have something to process */
- if( !iheader )
- return;
-
- if( filt->fhd->image ){
- /* free up old wcs */
- if( wcs ) wcsfree (wcs);
- /* init new wcs */
- hlength(ft_cards(filt->fhd),0);
- wcs = wcsinit(ft_cards(filt->fhd));
- tltyp[0] = 0;
- tltyp[1] = 0;
- }
- /* for tables, we can init wcs only the specified columns */
- else if( name0 && *name0 && name1 && *name1 ){
- /* see if these are the same as the last set of columns */
- if( (*(wcsnames[0]) && !strcasecmp(name0,wcsnames[0])) &&
- (*(wcsnames[1]) && !strcasecmp(name1,wcsnames[1])) && wcs ){
- return;
- }
-
- /* gather up important tl info about the binning columns */
- for(i=1; i<=iheader->table->tfields; i++){
- /* determine which bincol we are processing */
- if( !strcasecmp(iheader->table->col[i-1].name, name0) )
- which = 0;
- else if( !strcasecmp(iheader->table->col[i-1].name, name1) )
- which = 1;
- else
- continue;
- /* set tlinfo values for this column */
- tlmin[which] = ft_headgetr(iheader, "TLMIN", i, 1.0, &card);
- tlmax[which] = ft_headgetr(iheader, "TLMAX", i, 1.0, &card);
- binsiz[which] = ft_headgetr(iheader, "TDBIN", i, 1.0, &card);
- tltyp[which] = iheader->table->col[i-1].type;
- }
-
- /* free up old wcs */
- if( wcs ) wcsfree (wcs);
- /* make a copy of the header */
- oheader = ft_headcopy(iheader);
-
- /* make sure this is a primary FITS file */
- ft_cardfmt((FITSCard)oheader->cards,
- "SIMPLE", 0, FT_LOGICAL, &simple, 0, "Standard FITS");
- /* set dimension info, used by wcs code */
- ft_headseti(oheader, "NAXIS", 0, 2, "number of axes", 1);
- /* set dimension info */
- for(i=0; i<=1; i++){
- ival = (int)tldim(tlmin[i], tlmax[i], binsiz[i], tltyp[i]);
- ft_headseti(oheader, "NAXIS", i+1, ival, "axis dimension", 1);
- }
- /* set bitpix */
- ft_headseti(oheader, "BITPIX", 0, 32, "bits/pixel", 1);
- /* synchronize the header and the cards after any changes */
- ft_syncdata(oheader);
-
- /* transform WCS cards for the specified columns, if we have such */
- for(i=1; i<=iheader->table->tfields; i++){
- /* determine which bincol we are processing */
- if( !strcasecmp(iheader->table->col[i-1].name, name0) )
- which = 0;
- else if( !strcasecmp(iheader->table->col[i-1].name, name1) )
- which = 1;
- else
- continue;
- /* convert event wcs header info image wcs info */
- if( (s=ft_headgets(iheader, "TCTYP", i, NULL, &card)) && card ){
- ft_headapps(oheader, "CTYPE", which+1, s, NULL);
- xfree(s);
- }
- if( (s=ft_headgets(iheader, "TCRVL", i, NULL, &card)) && card ){
- ft_headappv(oheader, "CRVAL", which+1, s, NULL);
- xfree(s);
- }
- if( (s=ft_headgets(iheader, "TCDLT", i, NULL, &card)) && card ){
- ft_headappv(oheader, "CDELT", which+1, s, NULL);
- xfree(s);
- }
- if( (s=ft_headgets(iheader, "TCROT", i, NULL, &card)) && card ){
- ft_headappv(oheader, "CROTA", which+1, s, NULL);
- xfree(s);
- }
- /* this value gets converted from physical to image */
- if( (dval=ft_headgetr(iheader, "TCRPX", i, 0.0, &card)) && card ){
- dval2 = tlp2i(dval, tlmin[which], binsiz[which], tltyp[which]);
- ft_headsetr(oheader, "CRPIX", which+1, dval2, 7, NULL, 1);
- }
- }
-
- /* init new wcs */
- hlength(ft_cards(oheader),0);
- wcs = wcsinit(ft_cards(oheader));
- ft_headfree(oheader, 1);
- /* save names for next time */
- strcpy(wcsnames[0], name0);
- strcpy(wcsnames[1], name1);
- }
-
- /* set some extra wcs parameters */
- if( wcs && iswcs(wcs) ){
- if( fcoordsys ) xfree(fcoordsys);
- fcoordsys = xstrdup(wcs->radecin);
- culc(fcoordsys);
- if( !wcs->coorflip ){
- cdelt1 = wcs->cdelt[0];
- cdelt2 = wcs->cdelt[1];
- }
- else{
- cdelt1 = wcs->cdelt[1];
- cdelt2 = wcs->cdelt[0];
- }
- if ( wcs->imflip ) {
- crot = -wcs->rot;
- } else {
- crot = wcs->rot;
- }
- }
- else{
- cdelt1 = 0.0;
- cdelt2 = 0.0;
- crot = 0.0;
- }
- /* set global coord system first time through */
- if( !gcoordsys ){
- if( (gcoordsys=xstrdup(getenv("COORDSYS"))) == NULL )
- gcoordsys = xstrdup(DEFAULT_COORDSYS);
- }
-}
-
-/*
- *
- * _FiltLexLcx -- determine if we have a linear-type WCS
- *
- */
-#ifdef YY_USE_PROTOS
-static int
-_FiltLexLcx(void)
-#else
-static int _FiltLexLcx()
-#endif
-{
- char *coordsys;
- coordsys = gcoordsys;
- if( !coordsys || !*coordsys )
- return 0;
- if( !strcasecmp(coordsys, "image") ) return LCX_IMAGE;
- if( !strcasecmp(coordsys, "physical") ) return LCX_PHYS;
- if( !strcasecmp(coordsys, "amplifier") ) return LCX_AMP;
- if( !strcasecmp(coordsys, "detector") ) return LCX_DET;
- return 0;
-}
-
-#ifdef YY_USE_PROTOS
-static void
-_FiltLexNum(int lcx)
-#else
-static void _FiltLexNum(lcx)
- int lcx;
-#endif
-{
- char tbuf[SZ_LINE];
-
- /* process binary number, if necessary */
- bin2num(tbuf, yytext, SZ_LINE);
-
- /* for linear coordinate systems (physical, amps, etc.),
- we have to convert to image coords or physical coords,
- depending on the type of data and type of filtering */
- if( lcx ){
- /* data is in a table: we can use image or physical coords */
- if( filt->fhd->table ){
- /* if we want to use physical coordinates ... */
- if( USEPHYS ){
- /* convert image positions to physical coords */
- if( lcx == LCX_IMAGE ){
- if( POSARG ){
- dval = tli2p(strtod(tbuf,NULL),
- tlmin[(narg+1)%2], binsiz[(narg+1)%2], tltyp[(narg+1)%2]);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- /* angle arguments are just passed along */
- else if( ANGARG ){
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- /* panda numeric args are just passed along */
- else if( NUMARG ){
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* size arguments have to be converted using the binsize */
- else{
- if( SAVEANG ){
- dval = strtod(tbuf,NULL);
- snprintf(saveang, SZ_LINE, DFMT1, dval);
- }
- dval = strtod(tbuf,NULL) * binsiz[(narg+1)%2];
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- }
- /* already in physical -- just pass along args */
- else{
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- }
- /* we are using image coords (image-style filtering) */
- else{
- /* convert non-image positions to image coords */
- if( lcx != LCX_IMAGE ){
- if( POSARG ){
- dval = tlp2i(strtod(tbuf,NULL),
- tlmin[(narg+1)%2], binsiz[(narg+1)%2], tltyp[(narg+1)%2]);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- /* angle arguments are just passed along */
- else if( ANGARG ){
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- /* panda numeric args are just passed along */
- else if( NUMARG ){
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* size arguments have to be converted using the binsize */
- else{
- if( SAVEANG ){
- dval = strtod(tbuf,NULL);
- snprintf(saveang, SZ_LINE, DFMT1, dval);
- }
- dval = strtod(tbuf,NULL) / binsiz[(narg+1)%2];
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- }
- /* already in image -- just pass along args */
- else{
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- _FiltLexArgSave(dval);
- }
- }
- }
- /* data is in an image: we use image coords */
- else{
- /* convert positional arguments to image */
- if( POSARG ){
- /* save x value for processing with y next time */
- if( XARG ){
- xpos = SAOstrtod(tbuf,NULL);
- }
- else{
- ypos = SAOstrtod(tbuf,NULL);
- switch(lcx){
- case LCX_IMAGE:
- xpix = xpos;
- ypix = ypos;
- break;
- case LCX_PHYS:
- ft_phy2img(filt->fhd, xpos, ypos, &xpix, &ypix);
- break;
- case LCX_AMP:
- ft_amp2phy(filt->fhd, xpos, ypos, &dval, &dval2);
- ft_phy2img(filt->fhd, dval, dval2, &xpix, &ypix);
- break;
- case LCX_DET:
- ft_det2phy(filt->fhd, xpos, ypos, &dval, &dval2);
- ft_phy2img(filt->fhd, dval, dval2, &xpix, &ypix);
- break;
- }
- snprintf(sbuf, SZ_LINE, DFMT2, xpix, ypix);
- _FiltLexCat(sbuf);
- }
- }
- /* angle arguments are just passed along, with updated crot */
- else if( ANGARG ){
- dval = strtod(tbuf,NULL);
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* panda numeric args are just passed along */
- else if( NUMARG ){
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* convert size args, which may or may not be in pairs */
- else{
- if( SAVEANG ){
- dval = strtod(tbuf,NULL);
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(saveang, SZ_LINE, DFMT1, dval);
- }
- /* arg 1 is associated with ra, arg2 with dec */
- if( XARG ){
- xpos = ABS(strtod(tbuf,NULL));
- ypos = 0.0;
- switch(lcx){
- case LCX_IMAGE:
- xpix = xpos;
- break;
- case LCX_PHYS:
- ft_phy2img_size(filt->fhd, xpos, ypos, &xpix, &ypix);
- break;
- case LCX_AMP:
- ft_amp2phy_size(filt->fhd, xpos,ypos, &dval,&dval2);
- ft_phy2img_size(filt->fhd, dval,dval2, &xpix,&ypix);
- break;
- case LCX_DET:
- ft_det2phy_size(filt->fhd, xpos,ypos, &dval,&dval2);
- ft_phy2img_size(filt->fhd, dval,dval2, &xpix,&ypix);
- break;
- }
- snprintf(sbuf, SZ_LINE, DFMT1, xpix);
- _FiltLexArgSave(xpix);
- }
- else{
- xpos = 0.0;
- ypos = ABS(strtod(tbuf,NULL));
- switch(lcx){
- case LCX_IMAGE:
- ypix = ypos;
- break;
- case LCX_PHYS:
- ft_phy2img_size(filt->fhd, xpos, ypos, &xpix, &ypix);
- break;
- case LCX_AMP:
- ft_amp2phy_size(filt->fhd, xpos,ypos, &dval,&dval2);
- ft_phy2img_size(filt->fhd, dval,dval2, &xpix,&ypix);
- break;
- case LCX_DET:
- ft_det2phy_size(filt->fhd, xpos,ypos, &dval,&dval2);
- ft_phy2img_size(filt->fhd, dval,dval2, &xpix,&ypix);
- break;
- }
- snprintf(sbuf, SZ_LINE, DFMT1, ypix);
- _FiltLexArgSave(ypix);
- }
- _FiltLexCat(sbuf);
- }
- }
- }
- /* not lcx -- angle arguments are just passed along with updated crot */
- else if( ANGARG ){
- dval = strtod(tbuf,NULL);
- if( USEWCS ) dval += crot;
- if( IMFLIP ) dval = -dval;
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* panda numeric args are just passed along */
- else if( NUMARG ){
- dval = strtod(tbuf,NULL);
- snprintf(sbuf, SZ_LINE, DFMT1, dval);
- _FiltLexCat(sbuf);
- }
- /* not lcx -- everything else is assumed to be in units of "degrees"
- in the default system. add 'd' and put back for reparsing */
- else{
- int i;
- char *yycopy = xstrdup(tbuf);
- unput('d');
- for(i=yyleng-1; i>=0; --i)
- unput(yycopy[i]);
- xfree(yycopy);
- narg--;
- }
-}
-
-#ifdef YY_USE_PROTOS
-static int
-_FiltIncMask(FilterMask masks, int maxmask, int nmask)
-#else
-static int _FiltIncMask(masks, maxmask, nmask)
- FilterMask masks;
- int maxmask;
- int nmask;
-#endif
-{
- int omax;
- nmask++;
- if( nmask >= maxmask ){
- omax = maxmask;
- maxmask += MASKINC;
- masks = (FilterMask)xrealloc(masks, maxmask*sizeof(FilterMaskRec));
- memset(masks+omax, 0, (maxmask-omax)*sizeof(FilterMaskRec));
- }
- return nmask;
-}
-
-#ifdef YY_USE_PROTOS
-static int
-_FiltFitsMask(char *filename, FilterMask *rmasks, FITSHead *rhead, int *nreg)
-#else
-static int _FiltFitsMask(filename, rmasks, rhead, nreg)
- char *filename;
- FilterMask *rmasks;
- FITSHead *rhead;
- int *nreg;
-#endif
-{
- short *dptr;
- short *data=NULL;
- int x, y;
- int maxreg=-1;
- int maxmask; /* max masks allocated thus far */
- int nmask=0; /* number of mask segments */
- FilterMask masks=NULL; /* array valid region masks for one row */
- FITSHead head=NULL;
-
- /* read fits image */
- if( !ft_simpleimageread(filename, &head, (void *)&data, NULL, 16) ){
- return(-1);
- }
- if( !head->image ){
- if( data ) xfree(data);
- if( head ) ft_headfree(head, 1);
- return(-2);
- }
- if( !ft_naxes(head) || !ft_naxis(head, 1) || !ft_naxis(head, 2) ){
- if( data ) xfree(data);
- if( head ) ft_headfree(head, 1);
- return(-3);
- }
-
- /* allocate an array of masks, which will be returned to caller */
- maxmask = MASKINC;
- masks = (FilterMask)xcalloc(maxmask, sizeof(FilterMaskRec));
- /* seed the first region mask value */
- masks[nmask].region = 0;
- /* loop through y rows */
- for(y=1; y<=ft_naxis(head, 2); y++){
- dptr = data + ((y-1) * ft_naxis(head, 1));
- /* to start this line, we make a seed mask with no region */
- if( masks[nmask].region ){
- nmask = _FiltIncMask(masks, maxmask, nmask);
- masks[nmask].region = 0;
- }
- /* process each pixel in the row */
- for(x=1; x<=ft_naxis(head, 1); x++, dptr++){
- /* we do not allow negative values */
- if( *dptr < 0 ){
- if( data ) xfree(data);
- if( head ) ft_headfree(head, 1);
- if( masks ) xfree(masks);
- return(-4);
- }
- /* set max region as needed */
- if( *dptr > maxreg )
- maxreg = *dptr;
- /* look for a change in the mask */
- if( *dptr != masks[nmask].region ){
- /* if previous was non-zero region, finish it and bump to next */
- if( masks[nmask].region ){
- masks[nmask].xstop = x - 1;
- nmask = _FiltIncMask(masks, maxmask, nmask);
- }
- masks[nmask].y = y;
- masks[nmask].region = *dptr;
- masks[nmask].xstart = x;
- }
- }
- /* finish last non-zero segment, inc number of mask segs */
- if( masks[nmask].region ){
- masks[nmask].xstop = x;
- nmask = _FiltIncMask(masks, maxmask, nmask);
- }
- }
-
- /* free up data space */
- if( data ) xfree(data);
- /* allocate just enough mask space */
- masks = (FilterMask)xrealloc(masks, nmask*sizeof(FilterMaskRec));
- if( rmasks )
- *rmasks = masks;
- else
- xfree(masks);
- if( rhead )
- *rhead = head;
- else
- ft_headfree(head, 1);
- if( nreg )
- *nreg = maxreg;
-
- return(nmask);
-}
-
-/*
- *
- * Semi-public Routines
- *
- *
- */
-
-/*
- *
- * _FilterString -- return output filter from lexer
- *
- */
-#ifdef YY_USE_PROTOS
-char *
-_FilterString(void)
-#else
-char *_FilterString()
-#endif
-{
- if( filtlen <= 0 )
- _FiltLexMake();
- return(filter);
-}
-
-#ifdef YY_USE_PROTOS
-int
-FilterRoutineCount(void)
-#else
-int FilterRoutineCount()
-#endif
-{
- return(nroutine);
-}
-
-#ifdef YY_USE_PROTOS
-int
-FilterShapeCount(void)
-#else
-int FilterShapeCount()
-#endif
-{
- return(nshape);
-}
-
-#ifdef YY_USE_PROTOS
-int
-FilterRegionCount(int type)
-#else
-int FilterRegionCount(type)
- int type;
-#endif
-{
- int i, j;
-
- /* handle fits image masks specially */
- if( nmask ){
- if( type & TOK_IREG )
- return(nregion);
- else
- return(0);
- }
-
- /* normal regions */
- for(i=0, j=0; i<nfiltseg; i++){
- if( filtseg[i]->type & type ){
- j += filtseg[i]->nregion;
- }
- }
- return(j);
-}
-
-#ifdef YY_USE_PROTOS
-char *
-FilterRadAng(void)
-#else
-char *FilterRadAng()
-#endif
-{
- return(radang);
-}
-
-#ifdef YY_USE_PROTOS
-int
-FilterParseError(void)
-#else
-int FilterParseError()
-#endif
-{
- return(parse_error);
-}
-
-#ifdef YY_USE_PROTOS
-int
-FilterTlInfo(double *tlmins, double *binsizs, int *tltyps)
-#else
-int FilterTlInfo(tlmins, binsizs, tltyps)
- double *tlmins;
- double *binsizs;
- int *tltyps;
-#endif
-{
- tlmins[0] = tlmin[0];
- tlmins[1] = tlmin[1];
- binsizs[0] = binsiz[0];
- binsizs[1] = binsiz[1];
- tltyps[0] = tltyp[0];
- tltyps[1] = tltyp[1];
- return 1;
-}
-
-#ifdef YY_USE_PROTOS
-void
-FiltInitParser(void)
-#else
-void FiltInitParser()
-#endif
-{
- static int parser = 0;
- /* make sure we free'd up all space from last time */
- _FiltLexEnd();
- /* set up some convenience variables */
- filt = FilterDefault();
-/*
- if( parser )
- yyrestart(NULL);
-*/
- BEGIN INITIAL;
- parser++;
- laststart=INITIAL;
-}
-
-#ifdef YY_USE_PROTOS
-void
-FiltScanString(char *s)
-#else
-void FiltScanString(s)
- char *s;
-#endif
-{
- int i;
- char *t;
- /* make sure there is an explicit delim at end so we are done before
- lex finds EOF -- otherwise panda shapes don't get processed */
- i = strlen(s);
- t = xmalloc(i+2);
- strcpy(t, s);
- if( (t[i-1] != ';') && (t[i-1] != '\n') )
- strcat(t, "\n");
- yy_scan_string(t);
- if( t ) xfree(t);
-}
-
-/* yyerror -- renamed to _filterror because flex -P does not change this */
-#ifdef YY_USE_PROTOS
-int
-_filterror(char *msg)
-#else
-int _filterror(msg)
- char *msg;
-#endif
-{
- if( *yytext )
- gerror(stderr, "%s while parsing filter at: %s\n",
- msg ? msg : "filterr", yytext);
- else
- gerror(stderr, "%s\n", msg ? msg : "filterr");
- YY_FLUSH_BUFFER;
- parse_error = 1;
- yyterminate();
-}
-
-#ifdef YY_USE_PROTOS
-int yywrap(void)
-#else
-int yywrap()
-#endif
-{
- return 1;
-}
diff --git a/funtools/filter/lex.idx.c b/funtools/filter/lex.idx.c
deleted file mode 100644
index cfceac7..0000000
--- a/funtools/filter/lex.idx.c
+++ /dev/null
@@ -1,2829 +0,0 @@
-#define yy_create_buffer idx_create_buffer
-#define yy_delete_buffer idx_delete_buffer
-#define yy_scan_buffer idx_scan_buffer
-#define yy_scan_string idx_scan_string
-#define yy_scan_bytes idx_scan_bytes
-#define yy_flex_debug idx_flex_debug
-#define yy_init_buffer idx_init_buffer
-#define yy_flush_buffer idx_flush_buffer
-#define yy_load_buffer_state idx_load_buffer_state
-#define yy_switch_to_buffer idx_switch_to_buffer
-#define yyin idxin
-#define yyleng idxleng
-#define yylex idxlex
-#define yyout idxout
-#define yyrestart idxrestart
-#define yytext idxtext
-#define yywrap idxwrap
-
-/* A lexical scanner generated by flex */
-
-/* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
- */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-
-#include <stdio.h>
-
-
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
-#endif
-
-
-#ifdef __cplusplus
-
-#include <stdlib.h>
-#include <unistd.h>
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-#if __STDC__
-
-#define YY_USE_PROTOS
-#define YY_USE_CONST
-
-#endif /* __STDC__ */
-#endif /* ! __cplusplus */
-
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition. This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yy_start = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state. The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yy_start - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#define YY_BUF_SIZE 16384
-
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
-extern int yyleng;
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator). This
- * avoids problems with code like:
- *
- * if ( condition_holds )
- * yyless( 5 );
- * else
- * do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- *yy_cp = yy_hold_char; \
- YY_RESTORE_YY_MORE_OFFSET \
- yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
- } \
- while ( 0 )
-
-#define unput(c) yyunput( c, idxtext_ptr )
-
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-typedef unsigned int yy_size_t;
-
-
-struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
-
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
-
- int yy_buffer_status;
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
- /* When an EOF's been seen but there's still some text to process
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
- * shouldn't try reading from the input source any more. We might
- * still have a bunch of tokens to match, though, because of
- * possible backing-up.
- *
- * When we actually see the EOF, we change the status to "new"
- * (via yyrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
- */
-#define YY_BUFFER_EOF_PENDING 2
- };
-
-static YY_BUFFER_STATE yy_current_buffer = 0;
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- */
-#define YY_CURRENT_BUFFER yy_current_buffer
-
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
-
-
-int yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1; /* whether we need to initialize */
-static int yy_start = 0; /* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin. A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart YY_PROTO(( FILE *input_file ));
-
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
- { \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_is_interactive = is_interactive; \
- }
-
-#define yy_set_bol(at_bol) \
- { \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_at_bol = at_bol; \
- }
-
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
-
-typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-typedef int yy_state_type;
-extern char yytext[];
-
-
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
- idxtext_ptr = yy_bp; \
- yyleng = (int) (yy_cp - yy_bp); \
- yy_hold_char = *yy_cp; \
- *yy_cp = '\0'; \
- if ( yyleng >= YYLMAX ) \
- YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \
- yy_flex_strncpy( yytext, idxtext_ptr, yyleng + 1 ); \
- yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 15
-#define YY_END_OF_BUFFER 16
-static yyconst short int yy_accept[570] =
- { 0,
- 0, 0, 16, 14, 13, 15, 14, 14, 14, 14,
- 1, 1, 14, 14, 14, 6, 6, 6, 14, 10,
- 8, 0, 2, 2, 1, 0, 1, 0, 11, 9,
- 12, 0, 6, 0, 6, 6, 7, 0, 0, 0,
- 2, 1, 0, 0, 5, 0, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 0, 0, 2,
- 1, 0, 0, 0, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 0, 0,
- 0, 5, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 0, 0, 0,
-
- 6, 0, 6, 0, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 0, 0, 5, 0, 6,
- 6, 0, 6, 6, 6, 6, 6, 6, 6, 0,
- 5, 6, 0, 6, 0, 6, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
- 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,
- 0, 0, 0, 0, 0, 4, 0, 0, 3, 0,
- 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
- 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 4, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 4, 0,
- 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
- 0, 0, 0, 0, 4, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0
- } ;
-
-static yyconst int yy_ec[256] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 4, 1, 1, 1, 1, 5, 1, 6,
- 7, 1, 8, 9, 10, 11, 1, 12, 13, 14,
- 15, 16, 17, 15, 18, 19, 15, 1, 1, 20,
- 21, 22, 1, 1, 26, 27, 28, 29, 30, 31,
- 32, 25, 33, 25, 25, 34, 35, 36, 37, 38,
- 39, 40, 41, 42, 43, 44, 25, 45, 46, 25,
- 23, 1, 24, 1, 25, 1, 26, 27, 28, 29,
-
- 30, 31, 32, 25, 33, 25, 25, 34, 35, 36,
- 37, 38, 39, 40, 41, 42, 43, 44, 25, 45,
- 46, 25, 1, 47, 1, 48, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1
- } ;
-
-static yyconst int yy_meta[49] =
- { 0,
- 1, 1, 2, 1, 1, 3, 4, 5, 6, 5,
- 7, 8, 8, 8, 8, 8, 8, 8, 8, 1,
- 1, 1, 9, 1, 10, 11, 11, 11, 11, 12,
- 11, 10, 10, 13, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 13, 10, 1, 14
- } ;
-
-static yyconst short int yy_base[607] =
- { 0,
- 0, 0, 2154, 2377, 2377, 2377, 2132, 2119, 2056, 0,
- 38, 39, 2040, 2015, 2014, 47, 48, 51, 1979, 2377,
- 2377, 2009, 1994, 1993, 0, 48, 2377, 0, 2377, 2377,
- 2377, 45, 53, 1995, 87, 1987, 2377, 2003, 52, 53,
- 0, 1979, 58, 2005, 2377, 1987, 61, 71, 74, 96,
- 82, 73, 75, 51, 116, 118, 121, 1991, 81, 0,
- 2377, 2002, 93, 139, 129, 124, 132, 127, 145, 150,
- 151, 153, 155, 158, 166, 164, 169, 176, 1991, 179,
- 194, 1983, 198, 187, 189, 202, 203, 205, 209, 210,
- 213, 214, 228, 217, 229, 233, 237, 1988, 255, 243,
-
- 257, 262, 242, 252, 264, 249, 267, 268, 271, 276,
- 286, 291, 292, 295, 297, 0, 304, 310, 97, 315,
- 307, 334, 323, 325, 330, 296, 336, 329, 338, 1992,
- 130, 341, 377, 348, 366, 345, 1987, 354, 367, 351,
- 1983, 390, 404, 402, 422, 1977, 433, 1922, 179, 470,
- 1915, 1942, 504, 416, 512, 447, 532, 451, 540, 1939,
- 563, 1910, 220, 600, 1899, 298, 2377, 634, 455, 642,
- 459, 662, 463, 670, 467, 693, 1898, 336, 730, 1896,
- 378, 173, 484, 764, 488, 784, 492, 792, 496, 448,
- 462, 815, 1895, 466, 360, 500, 282, 504, 849, 526,
-
- 420, 452, 503, 48, 527, 554, 94, 437, 102, 358,
- 1926, 555, 567, 136, 377, 1925, 1924, 575, 1904, 579,
- 1858, 1862, 299, 578, 1847, 221, 1864, 579, 1836, 1815,
- 345, 1828, 1829, 581, 1813, 559, 1799, 586, 1795, 400,
- 1784, 570, 1790, 353, 1785, 567, 1796, 190, 1758, 579,
- 0, 484, 1760, 596, 584, 604, 1781, 597, 616, 616,
- 1752, 857, 0, 576, 622, 1762, 0, 633, 1750, 694,
- 903, 706, 697, 1748, 1744, 684, 2377, 1717, 627, 943,
- 960, 984, 2377, 710, 1722, 1008, 1729, 1723, 628, 654,
- 658, 682, 712, 1043, 743, 716, 722, 1056, 758, 1699,
-
- 748, 1080, 1708, 1699, 726, 749, 746, 828, 1121, 1682,
- 1652, 1144, 747, 843, 1162, 1645, 1637, 1185, 1631, 1202,
- 1630, 1219, 1243, 1622, 1622, 124, 908, 1283, 753, 777,
- 707, 922, 1295, 804, 833, 805, 861, 1303, 933, 837,
- 956, 1316, 989, 1609, 1590, 802, 1086, 838, 938, 925,
- 1099, 847, 973, 988, 1262, 1334, 1581, 1551, 1357, 989,
- 1352, 1376, 1556, 1548, 1399, 1534, 1417, 990, 1114, 991,
- 1251, 801, 1430, 1453, 862, 1013, 904, 1443, 1466, 927,
- 1017, 0, 1528, 1527, 1104, 998, 1500, 1133, 1075, 1276,
- 1096, 1479, 1052, 1484, 1008, 1140, 1118, 1491, 1055, 1157,
-
- 1495, 1480, 1461, 1442, 1164, 1519, 1165, 1547, 1166, 1565,
- 1172, 1576, 1432, 1429, 1413, 1411, 1184, 1102, 1160, 1390,
- 1140, 1581, 1215, 1389, 1252, 1181, 1198, 1342, 1142, 1589,
- 1395, 1325, 1265, 1497, 1320, 1537, 1258, 1238, 1237, 1222,
- 1095, 1509, 1224, 1370, 1264, 1605, 1082, 1389, 1318, 1633,
- 1321, 1661, 1061, 1047, 1013, 1012, 1342, 1623, 1003, 1615,
- 1396, 1651, 989, 1679, 1301, 1432, 1435, 952, 1193, 1687,
- 1544, 921, 1398, 1451, 1499, 908, 1212, 1694, 1594, 843,
- 771, 756, 744, 723, 1255, 1701, 709, 1706, 1505, 1719,
- 697, 1725, 1585, 1732, 679, 1743, 1604, 1747, 678, 1757,
-
- 1070, 0, 0, 0, 1425, 1761, 649, 1772, 1438, 1776,
- 624, 1787, 1555, 1791, 615, 1800, 1603, 1808, 581, 1816,
- 1586, 1824, 547, 1837, 1819, 1841, 518, 1854, 1619, 1858,
- 473, 1866, 1647, 1871, 407, 1884, 1712, 1888, 0, 1897,
- 1804, 1901, 0, 1906, 1666, 1912, 287, 1917, 1675, 1928,
- 278, 1939, 1865, 1943, 172, 1956, 1944, 1968, 72, 1962,
- 1832, 1974, 0, 1980, 1893, 1984, 0, 1992, 2377, 70,
- 2008, 2019, 732, 2026, 2038, 2052, 1318, 2066, 2080, 2094,
- 2108, 2122, 2136, 2148, 2156, 2170, 2182, 2190, 2204, 2209,
- 2217, 2227, 2235, 2240, 58, 2253, 2264, 1349, 2278, 1379,
-
- 2292, 2306, 2320, 2334, 2348, 2362
- } ;
-
-static yyconst short int yy_def[607] =
- { 0,
- 569, 1, 569, 569, 569, 569, 569, 569, 569, 570,
- 571, 571, 569, 569, 569, 572, 572, 572, 569, 569,
- 569, 569, 570, 570, 12, 573, 569, 574, 569, 569,
- 569, 575, 572, 576, 572, 35, 569, 569, 577, 573,
- 40, 574, 575, 578, 569, 576, 576, 572, 572, 572,
- 572, 572, 572, 35, 572, 572, 572, 569, 577, 59,
- 569, 578, 569, 579, 572, 572, 572, 572, 572, 572,
- 572, 572, 572, 572, 572, 572, 572, 572, 569, 579,
- 580, 576, 579, 572, 572, 572, 572, 572, 572, 572,
- 572, 572, 572, 572, 572, 572, 572, 569, 580, 576,
-
- 580, 581, 572, 575, 572, 572, 572, 572, 572, 572,
- 572, 572, 572, 572, 572, 582, 581, 576, 583, 581,
- 572, 575, 572, 572, 572, 572, 572, 572, 572, 569,
- 569, 572, 575, 572, 575, 572, 569, 133, 133, 575,
- 569, 133, 575, 133, 133, 569, 133, 147, 144, 147,
- 150, 569, 133, 575, 133, 575, 133, 575, 133, 569,
- 133, 161, 155, 161, 164, 159, 569, 133, 575, 133,
- 575, 133, 575, 133, 575, 133, 176, 170, 176, 179,
- 174, 575, 575, 174, 575, 133, 575, 133, 575, 578,
- 184, 133, 192, 188, 578, 575, 575, 575, 188, 575,
-
- 578, 578, 199, 578, 578, 575, 578, 578, 578, 578,
- 578, 578, 584, 578, 585, 578, 569, 585, 586, 587,
- 569, 586, 586, 588, 569, 586, 569, 588, 589, 569,
- 586, 569, 589, 589, 569, 586, 569, 589, 569, 586,
- 569, 589, 569, 586, 569, 589, 569, 586, 569, 589,
- 590, 586, 569, 589, 591, 586, 569, 589, 592, 591,
- 593, 586, 594, 589, 592, 265, 595, 265, 593, 593,
- 596, 597, 589, 569, 268, 595, 569, 276, 598, 593,
- 586, 596, 569, 597, 599, 589, 569, 268, 600, 598,
- 290, 280, 280, 593, 280, 281, 281, 586, 281, 599,
-
- 599, 601, 569, 268, 600, 305, 593, 280, 593, 593,
- 309, 593, 586, 281, 586, 586, 315, 586, 599, 599,
- 589, 589, 601, 569, 268, 593, 280, 312, 312, 312,
- 586, 281, 318, 318, 318, 320, 320, 599, 320, 322,
- 322, 589, 322, 569, 268, 593, 280, 328, 328, 586,
- 281, 333, 333, 599, 320, 599, 599, 356, 599, 589,
- 322, 589, 589, 362, 589, 569, 602, 593, 280, 586,
- 281, 599, 320, 359, 359, 359, 589, 322, 365, 365,
- 365, 602, 569, 569, 265, 276, 268, 290, 593, 280,
- 586, 281, 599, 320, 374, 374, 589, 322, 379, 379,
-
- 569, 268, 276, 291, 593, 603, 586, 604, 599, 320,
- 589, 322, 569, 268, 276, 291, 603, 593, 593, 280,
- 309, 280, 593, 312, 604, 586, 586, 281, 315, 281,
- 586, 318, 599, 320, 589, 322, 569, 268, 276, 291,
- 593, 280, 309, 312, 586, 281, 315, 318, 599, 605,
- 589, 606, 569, 268, 276, 291, 593, 280, 309, 312,
- 586, 281, 315, 318, 605, 599, 599, 320, 356, 320,
- 599, 359, 606, 589, 589, 322, 362, 322, 589, 365,
- 569, 268, 276, 291, 593, 280, 309, 312, 586, 281,
- 315, 318, 599, 320, 356, 359, 589, 322, 362, 365,
-
- 569, 268, 276, 291, 593, 280, 309, 312, 586, 281,
- 315, 318, 599, 320, 356, 359, 589, 322, 362, 365,
- 593, 280, 309, 312, 586, 281, 315, 318, 599, 320,
- 356, 359, 589, 322, 362, 365, 593, 280, 309, 312,
- 586, 281, 315, 318, 599, 320, 356, 359, 589, 322,
- 362, 365, 599, 320, 356, 359, 589, 322, 362, 365,
- 599, 320, 356, 359, 589, 322, 362, 365, 0, 569,
- 569, 569, 569, 569, 569, 569, 569, 569, 569, 569,
- 569, 569, 569, 569, 569, 569, 569, 569, 569, 569,
- 569, 569, 569, 569, 569, 569, 569, 569, 569, 569,
-
- 569, 569, 569, 569, 569, 569
- } ;
-
-static yyconst short int yy_nxt[2426] =
- { 0,
- 4, 5, 6, 7, 8, 4, 4, 4, 4, 9,
- 10, 11, 12, 12, 12, 12, 12, 12, 12, 13,
- 14, 15, 4, 4, 16, 16, 16, 16, 16, 17,
- 16, 16, 18, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 19, 4, 24, 24,
- 44, 45, 32, 32, 63, 40, 32, 40, 32, 59,
- 569, 59, 569, 44, 45, 276, 64, 26, 26, 34,
- 34, 27, 27, 34, 207, 34, 32, 23, 32, 32,
- 32, 57, 28, 569, 47, 36, 33, 32, 569, 567,
- 569, 35, 32, 34, 33, 34, 34, 34, 44, 45,
-
- 63, 32, 44, 131, 34, 72, 65, 73, 63, 34,
- 66, 67, 48, 49, 50, 70, 51, 52, 34, 71,
- 53, 32, 54, 32, 55, 56, 32, 209, 68, 32,
- 54, 211, 32, 69, 32, 44, 45, 32, 34, 346,
- 34, 74, 63, 34, 81, 82, 34, 270, 75, 34,
- 32, 34, 76, 78, 34, 32, 32, 86, 32, 77,
- 32, 43, 83, 32, 84, 216, 87, 34, 85, 32,
- 88, 32, 34, 34, 32, 34, 90, 34, 190, 45,
- 34, 32, 91, 89, 81, 82, 34, 142, 34, 563,
- 92, 34, 32, 93, 104, 85, 94, 95, 34, 46,
-
- 100, 43, 83, 102, 82, 97, 96, 32, 32, 34,
- 32, 34, 156, 223, 32, 32, 62, 101, 32, 32,
- 43, 83, 32, 252, 34, 34, 231, 34, 153, 103,
- 106, 34, 34, 32, 32, 34, 34, 105, 32, 34,
- 107, 108, 32, 85, 223, 109, 110, 32, 81, 82,
- 34, 34, 112, 171, 32, 34, 111, 44, 45, 34,
- 46, 100, 64, 100, 34, 114, 47, 81, 118, 32,
- 115, 34, 32, 32, 113, 121, 32, 62, 101, 62,
- 101, 32, 124, 122, 119, 120, 34, 202, 45, 34,
- 34, 32, 123, 34, 559, 125, 32, 32, 34, 127,
-
- 32, 32, 32, 555, 128, 126, 157, 226, 34, 81,
- 118, 85, 32, 34, 34, 81, 82, 34, 34, 34,
- 102, 118, 223, 129, 85, 85, 119, 120, 32, 34,
- 32, 175, 85, 47, 135, 32, 134, 119, 120, 44,
- 45, 32, 133, 32, 168, 34, 32, 34, 85, 132,
- 32, 34, 34, 32, 85, 85, 44, 45, 34, 145,
- 34, 85, 142, 34, 63, 139, 63, 34, 223, 185,
- 34, 44, 45, 236, 136, 142, 223, 85, 139, 248,
- 85, 85, 44, 45, 212, 217, 172, 143, 138, 139,
- 139, 139, 139, 139, 139, 139, 201, 140, 144, 219,
-
- 143, 147, 148, 148, 148, 148, 148, 148, 148, 44,
- 45, 189, 142, 149, 149, 149, 149, 149, 149, 149,
- 149, 44, 45, 223, 153, 551, 63, 149, 149, 149,
- 149, 149, 149, 150, 151, 151, 151, 151, 151, 151,
- 151, 153, 244, 63, 148, 148, 148, 148, 148, 148,
- 148, 148, 44, 45, 63, 142, 44, 45, 63, 157,
- 44, 45, 204, 168, 44, 45, 154, 153, 44, 45,
- 182, 172, 44, 45, 186, 157, 195, 155, 157, 210,
- 205, 151, 151, 151, 151, 151, 151, 151, 151, 44,
- 45, 547, 182, 44, 45, 196, 168, 44, 45, 200,
-
- 186, 44, 45, 158, 172, 44, 45, 223, 182, 44,
- 45, 197, 197, 256, 159, 161, 162, 162, 162, 162,
- 162, 162, 162, 163, 163, 163, 163, 163, 163, 163,
- 163, 44, 45, 63, 186, 543, 206, 163, 163, 163,
- 163, 163, 163, 164, 165, 165, 165, 165, 165, 165,
- 165, 166, 166, 166, 166, 166, 166, 166, 166, 44,
- 45, 63, 197, 208, 539, 166, 166, 166, 166, 166,
- 166, 168, 44, 45, 162, 162, 162, 162, 162, 162,
- 162, 162, 223, 217, 44, 45, 227, 227, 214, 238,
- 234, 242, 259, 234, 535, 240, 169, 219, 246, 234,
-
- 229, 229, 234, 250, 234, 273, 261, 170, 172, 234,
- 262, 165, 165, 165, 165, 165, 165, 165, 165, 234,
- 234, 254, 258, 265, 259, 266, 267, 223, 531, 569,
- 264, 274, 267, 173, 290, 305, 290, 305, 261, 277,
- 527, 259, 569, 278, 174, 176, 177, 177, 177, 177,
- 177, 177, 177, 178, 178, 178, 178, 178, 178, 178,
- 178, 569, 279, 569, 277, 523, 259, 178, 178, 178,
- 178, 178, 178, 179, 180, 180, 180, 180, 180, 180,
- 180, 181, 181, 181, 181, 181, 181, 181, 181, 269,
- 277, 307, 259, 519, 515, 181, 181, 181, 181, 181,
-
- 181, 182, 280, 286, 177, 177, 177, 177, 177, 177,
- 177, 177, 283, 289, 259, 511, 283, 270, 259, 269,
- 234, 307, 350, 222, 308, 313, 183, 507, 285, 222,
- 223, 313, 285, 569, 314, 569, 41, 184, 186, 41,
- 504, 180, 180, 180, 180, 180, 180, 180, 180, 310,
- 269, 280, 269, 311, 319, 277, 320, 259, 326, 331,
- 269, 503, 269, 187, 316, 222, 281, 222, 317, 270,
- 223, 301, 312, 502, 188, 191, 191, 191, 191, 191,
- 191, 191, 191, 310, 269, 280, 269, 318, 501, 191,
- 191, 191, 191, 191, 191, 192, 193, 193, 193, 193,
-
- 193, 193, 193, 194, 194, 194, 194, 194, 194, 194,
- 194, 222, 300, 222, 354, 368, 393, 194, 194, 194,
- 194, 194, 194, 197, 301, 270, 193, 193, 193, 193,
- 193, 193, 193, 193, 310, 269, 280, 269, 311, 316,
- 222, 281, 222, 327, 233, 269, 360, 269, 198, 316,
- 222, 281, 222, 317, 222, 500, 222, 312, 332, 199,
- 203, 203, 203, 203, 203, 203, 203, 203, 300, 300,
- 354, 300, 318, 355, 203, 203, 203, 203, 203, 203,
- 223, 271, 271, 271, 271, 271, 271, 271, 271, 271,
- 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
-
- 271, 271, 271, 222, 222, 222, 222, 222, 222, 222,
- 222, 281, 222, 222, 310, 269, 280, 269, 311, 397,
- 498, 347, 222, 222, 222, 261, 223, 234, 316, 222,
- 281, 222, 317, 496, 233, 351, 233, 312, 370, 357,
- 300, 320, 300, 358, 310, 269, 280, 269, 223, 222,
- 292, 318, 293, 294, 295, 295, 295, 295, 295, 295,
- 295, 295, 359, 233, 494, 360, 270, 296, 361, 297,
- 298, 299, 299, 299, 299, 299, 299, 299, 299, 316,
- 222, 281, 222, 223, 222, 222, 222, 222, 222, 222,
- 222, 222, 281, 222, 222, 363, 233, 322, 233, 364,
-
- 372, 377, 491, 222, 222, 222, 261, 223, 389, 391,
- 403, 301, 234, 270, 223, 300, 487, 300, 365, 357,
- 300, 320, 300, 363, 233, 322, 233, 279, 484, 483,
- 222, 234, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 309, 309, 309, 309, 309, 309,
- 309, 309, 233, 482, 233, 409, 270, 315, 315, 315,
- 315, 315, 315, 315, 315, 301, 277, 481, 259, 223,
- 233, 233, 233, 233, 233, 233, 321, 233, 322, 233,
- 233, 405, 310, 269, 280, 269, 311, 463, 270, 233,
-
- 233, 233, 285, 234, 369, 316, 222, 281, 222, 317,
- 457, 265, 407, 266, 441, 312, 402, 371, 270, 223,
- 310, 269, 280, 269, 311, 270, 233, 310, 318, 280,
- 390, 411, 309, 309, 309, 309, 309, 309, 309, 309,
- 290, 234, 290, 312, 270, 404, 357, 300, 320, 300,
- 328, 329, 443, 329, 447, 330, 330, 330, 330, 330,
- 330, 330, 330, 363, 233, 322, 233, 270, 316, 312,
- 281, 318, 441, 315, 315, 315, 315, 315, 315, 315,
- 315, 417, 425, 270, 433, 223, 269, 270, 223, 301,
- 435, 333, 334, 445, 334, 234, 335, 335, 335, 335,
-
- 335, 335, 335, 335, 223, 495, 383, 423, 223, 336,
- 445, 337, 338, 339, 339, 339, 339, 339, 339, 339,
- 339, 223, 359, 280, 499, 301, 340, 441, 341, 342,
- 343, 343, 343, 343, 343, 343, 343, 343, 270, 459,
- 456, 365, 234, 233, 233, 233, 233, 233, 233, 321,
- 233, 322, 233, 233, 222, 455, 454, 316, 222, 281,
- 222, 317, 233, 233, 233, 285, 234, 392, 357, 300,
- 320, 300, 358, 505, 383, 431, 453, 373, 270, 461,
- 318, 449, 310, 269, 280, 269, 311, 223, 301, 233,
- 348, 359, 348, 406, 349, 349, 349, 349, 349, 349,
-
- 349, 349, 352, 300, 352, 312, 353, 353, 353, 353,
- 353, 353, 353, 353, 356, 356, 356, 356, 356, 356,
- 356, 356, 60, 383, 471, 60, 301, 362, 362, 362,
- 362, 362, 362, 362, 362, 465, 451, 448, 473, 234,
- 357, 301, 320, 234, 234, 356, 356, 356, 356, 356,
- 356, 356, 356, 291, 446, 485, 291, 301, 363, 233,
- 322, 233, 364, 374, 375, 270, 375, 378, 376, 376,
- 376, 376, 376, 376, 376, 376, 310, 269, 280, 269,
- 301, 365, 363, 306, 322, 460, 306, 362, 362, 362,
- 362, 362, 362, 362, 362, 316, 222, 281, 222, 234,
-
- 233, 444, 442, 226, 464, 379, 380, 445, 380, 489,
- 381, 381, 381, 381, 381, 381, 381, 381, 223, 223,
- 383, 479, 234, 384, 440, 385, 439, 386, 387, 387,
- 387, 387, 387, 387, 387, 387, 357, 300, 320, 300,
- 358, 521, 438, 394, 493, 437, 388, 493, 270, 363,
- 233, 322, 233, 364, 525, 301, 398, 416, 301, 359,
- 395, 223, 395, 497, 396, 396, 396, 396, 396, 396,
- 396, 396, 365, 399, 234, 399, 415, 400, 400, 400,
- 400, 400, 400, 400, 400, 316, 222, 281, 222, 317,
- 357, 300, 320, 300, 358, 414, 408, 363, 233, 322,
-
- 233, 364, 410, 357, 300, 320, 300, 358, 318, 412,
- 413, 497, 402, 359, 450, 310, 269, 280, 269, 311,
- 365, 269, 234, 509, 458, 419, 359, 420, 223, 421,
- 422, 422, 422, 422, 422, 422, 422, 422, 312, 401,
- 401, 383, 423, 363, 233, 322, 233, 364, 424, 222,
- 319, 382, 320, 427, 452, 428, 493, 429, 430, 430,
- 430, 430, 430, 430, 430, 430, 365, 301, 529, 383,
- 431, 357, 300, 320, 300, 358, 432, 365, 301, 234,
- 359, 434, 363, 233, 322, 233, 364, 310, 269, 280,
- 269, 311, 436, 442, 359, 316, 222, 281, 222, 317,
-
- 513, 446, 238, 537, 301, 365, 497, 367, 301, 270,
- 312, 316, 222, 281, 222, 317, 533, 234, 318, 517,
- 462, 310, 269, 280, 269, 366, 234, 234, 488, 310,
- 269, 280, 269, 311, 318, 300, 486, 545, 345, 467,
- 344, 468, 301, 469, 470, 470, 470, 470, 470, 470,
- 470, 470, 312, 234, 301, 383, 471, 316, 222, 281,
- 222, 317, 472, 233, 490, 549, 318, 475, 223, 476,
- 234, 477, 478, 478, 478, 478, 478, 478, 478, 478,
- 318, 312, 553, 383, 479, 316, 222, 281, 222, 301,
- 480, 557, 492, 357, 300, 320, 300, 358, 234, 494,
-
- 363, 233, 322, 233, 364, 270, 498, 310, 269, 280,
- 269, 311, 310, 269, 280, 269, 359, 325, 310, 506,
- 280, 324, 301, 365, 508, 316, 222, 281, 222, 317,
- 312, 316, 222, 281, 222, 270, 304, 510, 357, 300,
- 320, 300, 358, 512, 303, 301, 279, 514, 318, 357,
- 300, 320, 300, 363, 233, 322, 233, 364, 516, 288,
- 287, 359, 518, 363, 233, 322, 233, 310, 269, 280,
- 269, 311, 520, 270, 275, 270, 365, 522, 310, 269,
- 280, 269, 316, 222, 281, 222, 317, 263, 524, 257,
- 312, 253, 526, 316, 222, 281, 222, 357, 300, 320,
-
- 300, 358, 251, 528, 530, 318, 357, 300, 320, 300,
- 316, 249, 281, 532, 363, 233, 322, 233, 364, 247,
- 359, 534, 363, 233, 322, 233, 245, 223, 243, 536,
- 310, 269, 280, 269, 311, 241, 541, 365, 357, 239,
- 320, 538, 223, 310, 269, 280, 269, 316, 222, 281,
- 222, 317, 234, 312, 540, 301, 237, 235, 542, 234,
- 316, 222, 281, 222, 357, 300, 320, 300, 358, 232,
- 318, 544, 357, 300, 320, 300, 546, 363, 233, 322,
- 233, 364, 561, 230, 548, 223, 225, 359, 301, 550,
- 363, 233, 322, 233, 310, 269, 280, 269, 311, 363,
-
- 365, 322, 552, 310, 269, 280, 269, 316, 222, 281,
- 222, 317, 316, 222, 281, 222, 234, 312, 357, 300,
- 320, 300, 358, 357, 300, 320, 300, 223, 554, 221,
- 318, 220, 213, 556, 363, 233, 322, 233, 364, 43,
- 43, 359, 43, 43, 558, 363, 233, 322, 233, 357,
- 300, 320, 300, 358, 43, 560, 167, 365, 160, 43,
- 562, 565, 357, 300, 320, 300, 43, 234, 363, 233,
- 322, 233, 359, 564, 363, 233, 322, 233, 364, 568,
- 357, 300, 320, 300, 358, 566, 357, 300, 320, 300,
- 363, 233, 322, 233, 364, 152, 146, 365, 363, 233,
-
- 322, 233, 141, 359, 137, 116, 47, 98, 63, 79,
- 47, 63, 61, 365, 25, 25, 58, 57, 47, 25,
- 25, 33, 26, 39, 38, 37, 33, 33, 33, 33,
- 33, 33, 33, 42, 31, 30, 42, 42, 43, 43,
- 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
- 43, 43, 46, 46, 46, 46, 46, 46, 46, 46,
- 29, 46, 46, 46, 46, 46, 62, 62, 22, 62,
- 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 99, 99, 99, 99, 99, 99,
-
- 99, 99, 99, 99, 99, 99, 99, 99, 117, 117,
- 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
- 117, 117, 130, 21, 130, 130, 130, 130, 130, 130,
- 130, 130, 130, 130, 130, 130, 119, 119, 119, 119,
- 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
- 215, 215, 20, 569, 569, 569, 569, 215, 215, 215,
- 215, 218, 569, 218, 218, 218, 218, 218, 218, 218,
- 222, 222, 222, 222, 222, 222, 222, 222, 569, 222,
- 222, 222, 222, 222, 224, 224, 569, 569, 569, 569,
- 569, 224, 224, 224, 224, 228, 569, 228, 228, 228,
-
- 228, 228, 228, 228, 233, 233, 233, 233, 233, 233,
- 233, 233, 569, 233, 233, 233, 233, 233, 255, 255,
- 255, 255, 260, 569, 260, 260, 260, 260, 260, 260,
- 260, 268, 569, 268, 268, 269, 269, 269, 269, 269,
- 269, 269, 269, 569, 269, 269, 269, 269, 269, 272,
- 272, 272, 272, 282, 282, 282, 282, 282, 282, 282,
- 282, 282, 282, 282, 282, 282, 282, 284, 569, 284,
- 569, 284, 284, 284, 284, 284, 284, 284, 300, 300,
- 300, 300, 300, 300, 300, 300, 569, 300, 300, 300,
- 300, 300, 323, 323, 323, 323, 323, 323, 323, 323,
-
- 323, 323, 323, 323, 323, 323, 383, 569, 383, 383,
- 383, 383, 383, 383, 383, 383, 383, 383, 383, 383,
- 418, 418, 418, 418, 418, 418, 418, 418, 418, 418,
- 418, 418, 418, 418, 426, 426, 426, 426, 426, 426,
- 426, 426, 426, 426, 426, 426, 426, 426, 466, 466,
- 466, 466, 466, 466, 466, 466, 466, 466, 466, 466,
- 466, 466, 474, 474, 474, 474, 474, 474, 474, 474,
- 474, 474, 474, 474, 474, 474, 3, 569, 569, 569,
- 569, 569, 569, 569, 569, 569, 569, 569, 569, 569,
- 569, 569, 569, 569, 569, 569, 569, 569, 569, 569,
-
- 569, 569, 569, 569, 569, 569, 569, 569, 569, 569,
- 569, 569, 569, 569, 569, 569, 569, 569, 569, 569,
- 569, 569, 569, 569, 569
- } ;
-
-static yyconst short int yy_chk[2426] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 11, 12,
- 32, 32, 16, 17, 204, 26, 18, 26, 33, 39,
- 40, 39, 40, 43, 43, 595, 47, 11, 12, 16,
- 17, 11, 12, 18, 204, 33, 48, 570, 52, 49,
- 53, 54, 11, 12, 47, 18, 54, 51, 59, 559,
- 59, 17, 35, 48, 54, 52, 49, 53, 63, 63,
-
- 207, 50, 119, 119, 51, 52, 48, 53, 209, 35,
- 49, 49, 35, 35, 35, 51, 35, 35, 50, 51,
- 35, 55, 35, 56, 35, 35, 57, 207, 50, 66,
- 35, 209, 68, 50, 65, 131, 131, 67, 55, 326,
- 56, 55, 214, 57, 64, 64, 66, 326, 55, 68,
- 69, 65, 55, 57, 67, 70, 71, 67, 72, 56,
- 73, 64, 64, 74, 65, 214, 68, 69, 66, 76,
- 69, 75, 70, 71, 77, 72, 71, 73, 182, 182,
- 74, 78, 72, 70, 80, 80, 76, 149, 75, 555,
- 73, 77, 84, 74, 85, 75, 76, 76, 78, 81,
-
- 81, 80, 80, 83, 83, 78, 77, 86, 87, 84,
- 88, 85, 149, 248, 89, 90, 81, 81, 91, 92,
- 83, 83, 94, 248, 86, 87, 226, 88, 163, 84,
- 87, 89, 90, 93, 95, 91, 92, 86, 96, 94,
- 88, 89, 97, 92, 226, 90, 91, 103, 100, 100,
- 93, 95, 94, 163, 106, 96, 93, 104, 104, 97,
- 99, 99, 101, 101, 103, 96, 100, 102, 102, 105,
- 97, 106, 107, 108, 95, 103, 109, 99, 99, 101,
- 101, 110, 106, 104, 102, 102, 105, 197, 197, 107,
- 108, 111, 105, 109, 551, 107, 112, 113, 110, 109,
-
- 114, 126, 115, 547, 110, 108, 166, 223, 111, 117,
- 117, 111, 121, 112, 113, 118, 118, 114, 126, 115,
- 120, 120, 223, 113, 114, 115, 117, 117, 123, 121,
- 124, 166, 112, 118, 128, 125, 126, 120, 120, 122,
- 122, 127, 122, 129, 178, 123, 132, 124, 123, 121,
- 136, 128, 125, 134, 124, 125, 140, 140, 127, 140,
- 129, 127, 138, 132, 210, 138, 195, 136, 231, 178,
- 134, 135, 135, 231, 129, 139, 244, 134, 139, 244,
- 136, 132, 133, 133, 210, 215, 181, 138, 133, 133,
- 133, 133, 133, 133, 133, 133, 195, 135, 138, 215,
-
- 139, 142, 142, 142, 142, 142, 142, 142, 142, 143,
- 143, 181, 143, 144, 144, 144, 144, 144, 144, 144,
- 144, 154, 154, 240, 154, 535, 201, 144, 144, 144,
- 144, 144, 144, 145, 145, 145, 145, 145, 145, 145,
- 145, 147, 240, 208, 147, 147, 147, 147, 147, 147,
- 147, 147, 156, 156, 190, 156, 158, 158, 202, 158,
- 169, 169, 201, 169, 171, 171, 147, 171, 173, 173,
- 191, 173, 175, 175, 194, 175, 190, 147, 150, 208,
- 202, 150, 150, 150, 150, 150, 150, 150, 150, 183,
- 183, 531, 183, 185, 185, 191, 185, 187, 187, 194,
-
- 187, 189, 189, 150, 189, 196, 196, 252, 196, 198,
- 198, 203, 198, 252, 150, 153, 153, 153, 153, 153,
- 153, 153, 153, 155, 155, 155, 155, 155, 155, 155,
- 155, 200, 200, 205, 200, 527, 203, 155, 155, 155,
- 155, 155, 155, 157, 157, 157, 157, 157, 157, 157,
- 157, 159, 159, 159, 159, 159, 159, 159, 159, 206,
- 206, 212, 206, 205, 523, 159, 159, 159, 159, 159,
- 159, 161, 213, 213, 161, 161, 161, 161, 161, 161,
- 161, 161, 236, 218, 220, 220, 224, 228, 212, 234,
- 246, 238, 255, 242, 519, 236, 161, 218, 242, 264,
-
- 224, 228, 250, 246, 234, 264, 255, 161, 164, 238,
- 256, 164, 164, 164, 164, 164, 164, 164, 164, 254,
- 258, 250, 254, 259, 260, 259, 259, 256, 515, 265,
- 258, 265, 265, 164, 279, 289, 279, 289, 260, 268,
- 511, 268, 268, 268, 164, 168, 168, 168, 168, 168,
- 168, 168, 168, 170, 170, 170, 170, 170, 170, 170,
- 170, 290, 268, 290, 291, 507, 291, 170, 170, 170,
- 170, 170, 170, 172, 172, 172, 172, 172, 172, 172,
- 172, 174, 174, 174, 174, 174, 174, 174, 174, 292,
- 276, 292, 276, 499, 495, 174, 174, 174, 174, 174,
-
- 174, 176, 270, 273, 176, 176, 176, 176, 176, 176,
- 176, 176, 272, 276, 272, 491, 284, 270, 284, 293,
- 273, 293, 331, 296, 293, 296, 176, 487, 272, 297,
- 331, 297, 284, 305, 297, 305, 573, 176, 179, 573,
- 484, 179, 179, 179, 179, 179, 179, 179, 179, 295,
- 295, 295, 295, 295, 301, 306, 301, 306, 307, 313,
- 329, 483, 329, 179, 299, 299, 299, 299, 299, 307,
- 313, 301, 295, 482, 179, 184, 184, 184, 184, 184,
- 184, 184, 184, 330, 330, 330, 330, 299, 481, 184,
- 184, 184, 184, 184, 184, 186, 186, 186, 186, 186,
-
- 186, 186, 186, 188, 188, 188, 188, 188, 188, 188,
- 188, 334, 336, 334, 336, 346, 372, 188, 188, 188,
- 188, 188, 188, 192, 372, 346, 192, 192, 192, 192,
- 192, 192, 192, 192, 308, 308, 308, 308, 308, 335,
- 335, 335, 335, 308, 340, 348, 340, 348, 192, 314,
- 314, 314, 314, 314, 352, 480, 352, 308, 314, 192,
- 199, 199, 199, 199, 199, 199, 199, 199, 337, 375,
- 337, 375, 314, 337, 199, 199, 199, 199, 199, 199,
- 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
- 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
-
- 262, 262, 262, 271, 271, 271, 271, 271, 271, 271,
- 271, 271, 271, 271, 327, 327, 327, 327, 327, 377,
- 476, 327, 271, 271, 271, 271, 271, 377, 332, 332,
- 332, 332, 332, 472, 380, 332, 380, 327, 350, 339,
- 339, 339, 339, 339, 349, 349, 349, 349, 350, 271,
- 280, 332, 280, 280, 280, 280, 280, 280, 280, 280,
- 280, 280, 339, 341, 468, 341, 280, 281, 341, 281,
- 281, 281, 281, 281, 281, 281, 281, 281, 281, 353,
- 353, 353, 353, 281, 282, 282, 282, 282, 282, 282,
- 282, 282, 282, 282, 282, 343, 343, 343, 343, 343,
-
- 354, 360, 463, 282, 282, 282, 282, 282, 368, 370,
- 386, 354, 360, 368, 370, 395, 459, 395, 343, 376,
- 376, 376, 376, 381, 381, 381, 381, 386, 456, 455,
- 282, 286, 286, 286, 286, 286, 286, 286, 286, 286,
- 286, 286, 286, 286, 286, 286, 286, 286, 286, 286,
- 286, 286, 286, 286, 294, 294, 294, 294, 294, 294,
- 294, 294, 399, 454, 399, 393, 294, 298, 298, 298,
- 298, 298, 298, 298, 298, 393, 501, 453, 501, 298,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 389, 347, 347, 347, 347, 347, 447, 389, 302,
-
- 302, 302, 302, 302, 347, 351, 351, 351, 351, 351,
- 441, 385, 391, 385, 418, 347, 385, 351, 441, 391,
- 369, 369, 369, 369, 369, 418, 302, 309, 351, 309,
- 369, 397, 309, 309, 309, 309, 309, 309, 309, 309,
- 388, 397, 388, 369, 309, 388, 396, 396, 396, 396,
- 309, 312, 421, 312, 429, 312, 312, 312, 312, 312,
- 312, 312, 312, 400, 400, 400, 400, 312, 315, 421,
- 315, 429, 419, 315, 315, 315, 315, 315, 315, 315,
- 315, 405, 407, 419, 409, 315, 417, 405, 407, 409,
- 411, 315, 318, 426, 318, 411, 318, 318, 318, 318,
-
- 318, 318, 318, 318, 426, 469, 417, 417, 318, 320,
- 427, 320, 320, 320, 320, 320, 320, 320, 320, 320,
- 320, 427, 469, 423, 477, 320, 322, 423, 322, 322,
- 322, 322, 322, 322, 322, 322, 322, 322, 423, 443,
- 440, 477, 322, 323, 323, 323, 323, 323, 323, 323,
- 323, 323, 323, 323, 425, 439, 438, 371, 371, 371,
- 371, 371, 323, 323, 323, 323, 323, 371, 355, 355,
- 355, 355, 355, 485, 425, 425, 437, 355, 485, 445,
- 371, 433, 390, 390, 390, 390, 390, 445, 433, 323,
- 328, 355, 328, 390, 328, 328, 328, 328, 328, 328,
-
- 328, 328, 333, 465, 333, 390, 333, 333, 333, 333,
- 333, 333, 333, 333, 338, 338, 338, 338, 338, 338,
- 338, 338, 577, 465, 465, 577, 338, 342, 342, 342,
- 342, 342, 342, 342, 342, 449, 435, 432, 451, 342,
- 356, 449, 356, 435, 451, 356, 356, 356, 356, 356,
- 356, 356, 356, 598, 428, 457, 598, 356, 361, 361,
- 361, 361, 361, 356, 359, 457, 359, 361, 359, 359,
- 359, 359, 359, 359, 359, 359, 444, 444, 444, 444,
- 359, 361, 362, 600, 362, 444, 600, 362, 362, 362,
- 362, 362, 362, 362, 362, 448, 448, 448, 448, 362,
-
- 473, 424, 420, 431, 448, 362, 365, 431, 365, 461,
- 365, 365, 365, 365, 365, 365, 365, 365, 431, 461,
- 473, 473, 365, 367, 416, 367, 415, 367, 367, 367,
- 367, 367, 367, 367, 367, 367, 373, 373, 373, 373,
- 373, 505, 414, 373, 466, 413, 367, 467, 505, 378,
- 378, 378, 378, 378, 509, 466, 378, 404, 467, 373,
- 374, 509, 374, 474, 374, 374, 374, 374, 374, 374,
- 374, 374, 378, 379, 474, 379, 403, 379, 379, 379,
- 379, 379, 379, 379, 379, 392, 392, 392, 392, 392,
- 394, 394, 394, 394, 394, 402, 392, 398, 398, 398,
-
- 398, 398, 394, 434, 434, 434, 434, 434, 392, 398,
- 401, 475, 387, 394, 434, 442, 442, 442, 442, 442,
- 398, 406, 475, 489, 442, 406, 434, 406, 489, 406,
- 406, 406, 406, 406, 406, 406, 406, 406, 442, 384,
- 383, 406, 406, 436, 436, 436, 436, 436, 406, 408,
- 471, 366, 471, 408, 436, 408, 471, 408, 408, 408,
- 408, 408, 408, 408, 408, 408, 436, 471, 513, 408,
- 408, 410, 410, 410, 410, 410, 408, 364, 513, 363,
- 358, 410, 412, 412, 412, 412, 412, 422, 422, 422,
- 422, 422, 412, 422, 410, 430, 430, 430, 430, 430,
-
- 493, 430, 479, 521, 357, 412, 479, 345, 493, 521,
- 422, 446, 446, 446, 446, 446, 517, 479, 430, 497,
- 446, 460, 460, 460, 460, 344, 517, 497, 460, 458,
- 458, 458, 458, 458, 446, 450, 458, 529, 325, 450,
- 324, 450, 529, 450, 450, 450, 450, 450, 450, 450,
- 450, 450, 458, 321, 319, 450, 450, 462, 462, 462,
- 462, 462, 450, 452, 462, 533, 317, 452, 316, 452,
- 533, 452, 452, 452, 452, 452, 452, 452, 452, 452,
- 462, 311, 545, 452, 452, 464, 464, 464, 464, 545,
- 452, 549, 464, 470, 470, 470, 470, 470, 549, 470,
-
- 478, 478, 478, 478, 478, 310, 478, 486, 486, 486,
- 486, 486, 488, 488, 488, 488, 470, 304, 537, 486,
- 537, 303, 300, 478, 488, 490, 490, 490, 490, 490,
- 486, 492, 492, 492, 492, 537, 288, 490, 494, 494,
- 494, 494, 494, 492, 287, 285, 278, 494, 490, 496,
- 496, 496, 496, 498, 498, 498, 498, 498, 496, 275,
- 274, 494, 498, 500, 500, 500, 500, 506, 506, 506,
- 506, 506, 500, 269, 266, 261, 498, 506, 508, 508,
- 508, 508, 510, 510, 510, 510, 510, 257, 508, 253,
- 506, 249, 510, 512, 512, 512, 512, 514, 514, 514,
-
- 514, 514, 247, 512, 514, 510, 516, 516, 516, 516,
- 541, 245, 541, 516, 518, 518, 518, 518, 518, 243,
- 514, 518, 520, 520, 520, 520, 241, 541, 239, 520,
- 522, 522, 522, 522, 522, 237, 525, 518, 561, 235,
- 561, 522, 525, 524, 524, 524, 524, 526, 526, 526,
- 526, 526, 233, 522, 524, 561, 232, 230, 526, 229,
- 528, 528, 528, 528, 530, 530, 530, 530, 530, 227,
- 526, 528, 532, 532, 532, 532, 530, 534, 534, 534,
- 534, 534, 553, 225, 532, 222, 221, 530, 553, 534,
- 536, 536, 536, 536, 538, 538, 538, 538, 538, 565,
-
- 534, 565, 536, 540, 540, 540, 540, 542, 542, 542,
- 542, 542, 544, 544, 544, 544, 565, 538, 546, 546,
- 546, 546, 546, 548, 548, 548, 548, 219, 546, 217,
- 542, 216, 211, 548, 550, 550, 550, 550, 550, 193,
- 180, 546, 177, 165, 550, 552, 552, 552, 552, 554,
- 554, 554, 554, 554, 162, 552, 160, 550, 152, 151,
- 554, 557, 556, 556, 556, 556, 148, 557, 560, 560,
- 560, 560, 554, 556, 558, 558, 558, 558, 558, 560,
- 562, 562, 562, 562, 562, 558, 564, 564, 564, 564,
- 566, 566, 566, 566, 566, 146, 141, 558, 568, 568,
-
- 568, 568, 137, 562, 130, 98, 82, 79, 62, 58,
- 46, 44, 42, 566, 571, 571, 38, 36, 34, 571,
- 571, 572, 24, 23, 22, 19, 572, 572, 572, 572,
- 572, 572, 572, 574, 15, 14, 574, 574, 575, 575,
- 575, 575, 575, 575, 575, 575, 575, 575, 575, 575,
- 575, 575, 576, 576, 576, 576, 576, 576, 576, 576,
- 13, 576, 576, 576, 576, 576, 578, 578, 9, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- 579, 579, 579, 579, 579, 579, 579, 579, 579, 579,
- 579, 579, 579, 579, 580, 580, 580, 580, 580, 580,
-
- 580, 580, 580, 580, 580, 580, 580, 580, 581, 581,
- 581, 581, 581, 581, 581, 581, 581, 581, 581, 581,
- 581, 581, 582, 8, 582, 582, 582, 582, 582, 582,
- 582, 582, 582, 582, 582, 582, 583, 583, 583, 583,
- 583, 583, 583, 583, 583, 583, 583, 583, 583, 583,
- 584, 584, 7, 3, 0, 0, 0, 584, 584, 584,
- 584, 585, 0, 585, 585, 585, 585, 585, 585, 585,
- 586, 586, 586, 586, 586, 586, 586, 586, 0, 586,
- 586, 586, 586, 586, 587, 587, 0, 0, 0, 0,
- 0, 587, 587, 587, 587, 588, 0, 588, 588, 588,
-
- 588, 588, 588, 588, 589, 589, 589, 589, 589, 589,
- 589, 589, 0, 589, 589, 589, 589, 589, 590, 590,
- 590, 590, 591, 0, 591, 591, 591, 591, 591, 591,
- 591, 592, 0, 592, 592, 593, 593, 593, 593, 593,
- 593, 593, 593, 0, 593, 593, 593, 593, 593, 594,
- 594, 594, 594, 596, 596, 596, 596, 596, 596, 596,
- 596, 596, 596, 596, 596, 596, 596, 597, 0, 597,
- 0, 597, 597, 597, 597, 597, 597, 597, 599, 599,
- 599, 599, 599, 599, 599, 599, 0, 599, 599, 599,
- 599, 599, 601, 601, 601, 601, 601, 601, 601, 601,
-
- 601, 601, 601, 601, 601, 601, 602, 0, 602, 602,
- 602, 602, 602, 602, 602, 602, 602, 602, 602, 602,
- 603, 603, 603, 603, 603, 603, 603, 603, 603, 603,
- 603, 603, 603, 603, 604, 604, 604, 604, 604, 604,
- 604, 604, 604, 604, 604, 604, 604, 604, 605, 605,
- 605, 605, 605, 605, 605, 605, 605, 605, 605, 605,
- 605, 605, 606, 606, 606, 606, 606, 606, 606, 606,
- 606, 606, 606, 606, 606, 606, 569, 569, 569, 569,
- 569, 569, 569, 569, 569, 569, 569, 569, 569, 569,
- 569, 569, 569, 569, 569, 569, 569, 569, 569, 569,
-
- 569, 569, 569, 569, 569, 569, 569, 569, 569, 569,
- 569, 569, 569, 569, 569, 569, 569, 569, 569, 569,
- 569, 569, 569, 569, 569
- } ;
-
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-#ifndef YYLMAX
-#define YYLMAX 8192
-#endif
-
-char yytext[YYLMAX];
-char *idxtext_ptr;
-#line 1 "idx.l"
-#define INITIAL 0
-#line 5 "idx.l"
-#include <math.h>
-#include <filter.h>
-#include <idx.h>
-#include <idx.tab.h>
-
-extern int idx_debug;
-
-static int _valint(char *s, idxvalrec **v);
-static int _valfloat(char *s, idxvalrec **v);
-static int _valname(char *s, idxvalrec **v);
-static int _valreg(char *s, idxvalrec **v);
-static int _valfunc(char *s, idxvalrec **v);
-/* note that negative numbers are not defined here, but in the grammar */
-/* must match regions in filt.l */
-#line 1133 "lex.idx.c"
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
-#else
-extern int yywrap YY_PROTO(( void ));
-#endif
-#endif
-
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
-#endif
-
-#ifndef idxtext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
-#endif
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
-
-#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
-#endif
-
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines. This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
- if ( yy_current_buffer->yy_is_interactive ) \
- { \
- int c = '*', n; \
- for ( n = 0; n < max_size && \
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
- && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" );
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
- YY_USER_ACTION
-
-YY_DECL
- {
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
-
-#line 35 "idx.l"
-
-
-#line 1287 "lex.idx.c"
-
- if ( yy_init )
- {
- yy_init = 0;
-
-#ifdef YY_USER_INIT
- YY_USER_INIT;
-#endif
-
- if ( ! yy_start )
- yy_start = 1; /* first start state */
-
- if ( ! yyin )
- yyin = stdin;
-
- if ( ! yyout )
- yyout = stdout;
-
- if ( ! yy_current_buffer )
- yy_current_buffer =
- yy_create_buffer( yyin, YY_BUF_SIZE );
-
- yy_load_buffer_state();
- }
-
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = yy_c_buf_p;
-
- /* Support of yytext. */
- *yy_cp = yy_hold_char;
-
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
-
- yy_current_state = yy_start;
-yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
- if ( yy_accept[yy_current_state] )
- {
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 570 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- ++yy_cp;
- }
- while ( yy_base[yy_current_state] != 2377 );
-
-yy_find_action:
- yy_act = yy_accept[yy_current_state];
- if ( yy_act == 0 )
- { /* have to back up */
- yy_cp = yy_last_accepting_cpos;
- yy_current_state = yy_last_accepting_state;
- yy_act = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
-
-
-do_action: /* This label is used only to access EOF actions. */
-
-
- switch ( yy_act )
- { /* beginning of action switch */
- case 0: /* must back up */
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = yy_hold_char;
- yy_cp = yy_last_accepting_cpos;
- yy_current_state = yy_last_accepting_state;
- goto yy_find_action;
-
-case 1:
-YY_RULE_SETUP
-#line 37 "idx.l"
-{return _valint(yytext, &(idxlval.val));}
- YY_BREAK
-case 2:
-YY_RULE_SETUP
-#line 39 "idx.l"
-{return _valfloat(yytext, &(idxlval.val));}
- YY_BREAK
-case 3:
-YY_RULE_SETUP
-#line 42 "idx.l"
-{
- return _valreg(yytext, &(idxlval.val));
-}
- YY_BREAK
-case 4:
-YY_RULE_SETUP
-#line 46 "idx.l"
-{
- return _valreg(yytext, &(idxlval.val));
-}
- YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 50 "idx.l"
-{
- /* support functions with one level of nested parens */
- return _valfunc(yytext, &(idxlval.val));
-}
- YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 55 "idx.l"
-{return _valname(yytext, &(idxlval.val));}
- YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 57 "idx.l"
-{return OR;}
- YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 58 "idx.l"
-{return AND;}
- YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 59 "idx.l"
-{return EQ;}
- YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 60 "idx.l"
-{return NE;}
- YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 61 "idx.l"
-{return LE;}
- YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 62 "idx.l"
-{return GE;}
- YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 64 "idx.l"
-{;}
- YY_BREAK
-case YY_STATE_EOF(INITIAL):
-#line 66 "idx.l"
-{
- yy_delete_buffer( YY_CURRENT_BUFFER );
- yyterminate();
- }
- YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 71 "idx.l"
-{return yytext[0];}
- YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 73 "idx.l"
-ECHO;
- YY_BREAK
-#line 1459 "lex.idx.c"
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - idxtext_ptr) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = yy_hold_char;
- YY_RESTORE_YY_MORE_OFFSET
-
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
- {
- /* We're scanning a new file or input source. It's
- * possible that this happened because the user
- * just pointed yyin at a new source and called
- * yylex(). If so, then we have to assure
- * consistency between yy_current_buffer and our
- * globals. Here is the right place to do so, because
- * this is the first action (other than possibly a
- * back-up) that will match for the new input source.
- */
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yy_current_buffer->yy_input_file = yyin;
- yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- /* Note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the
- * end-of-buffer state). Contrast this with the test
- * in input().
- */
- if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- yy_c_buf_p = idxtext_ptr + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state();
-
- /* Okay, we're now positioned to make the NUL
- * transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we don't
- * want to build jamming into it because then it
- * will run more slowly).
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
-
- yy_bp = idxtext_ptr + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++yy_c_buf_p;
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- yy_cp = yy_c_buf_p;
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_END_OF_FILE:
- {
- yy_did_buffer_switch_on_eof = 0;
-
- if ( yywrap() )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * yytext, we can now set up
- * yy_c_buf_p so that if some total
- * hoser (like flex itself) wants to
- * call the scanner after we return the
- * YY_NULL, it'll still work - another
- * YY_NULL will get returned.
- */
- yy_c_buf_p = idxtext_ptr + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p =
- idxtext_ptr + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state();
-
- yy_cp = yy_c_buf_p;
- yy_bp = idxtext_ptr + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- yy_c_buf_p =
- &yy_current_buffer->yy_ch_buf[yy_n_chars];
-
- yy_current_state = yy_get_previous_state();
-
- yy_cp = yy_c_buf_p;
- yy_bp = idxtext_ptr + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- } /* end of action switch */
- } /* end of scanning one token */
- } /* end of yylex */
-
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
- */
-
-static int yy_get_next_buffer()
- {
- register char *dest = yy_current_buffer->yy_ch_buf;
- register char *source = idxtext_ptr;
- register int number_to_move, i;
- int ret_val;
-
- if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- if ( yy_current_buffer->yy_fill_buffer == 0 )
- { /* Don't try to fill the buffer, so this is an EOF. */
- if ( yy_c_buf_p - idxtext_ptr - YY_MORE_ADJ == 1 )
- {
- /* We matched a single character, the EOB, so
- * treat this as a final EOF.
- */
- return EOB_ACT_END_OF_FILE;
- }
-
- else
- {
- /* We matched some text prior to the EOB, first
- * process it.
- */
- return EOB_ACT_LAST_MATCH;
- }
- }
-
- /* Try to read more data. */
-
- /* First move last chars to start of buffer. */
- number_to_move = (int) (yy_c_buf_p - idxtext_ptr) - 1;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- yy_current_buffer->yy_n_chars = yy_n_chars = 0;
-
- else
- {
- int num_to_read =
- yy_current_buffer->yy_buf_size - number_to_move - 1;
-
- while ( num_to_read <= 0 )
- { /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
- YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
-
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = yy_current_buffer;
-
- int yy_c_buf_p_offset =
- (int) (yy_c_buf_p - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
-
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
-
- b->yy_ch_buf = (char *)
- /* Include room in for 2 EOB chars. */
- yy_flex_realloc( (void *) b->yy_ch_buf,
- b->yy_buf_size + 2 );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
- num_to_read = yy_current_buffer->yy_buf_size -
- number_to_move - 1;
-#endif
- }
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* Read in more data. */
- YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
- yy_n_chars, num_to_read );
-
- yy_current_buffer->yy_n_chars = yy_n_chars;
- }
-
- if ( yy_n_chars == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- yyrestart( yyin );
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- yy_current_buffer->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- yy_n_chars += number_to_move;
- yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
- idxtext_ptr = &yy_current_buffer->yy_ch_buf[0];
-
- return ret_val;
- }
-
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-static yy_state_type yy_get_previous_state()
- {
- register yy_state_type yy_current_state;
- register char *yy_cp;
-
- yy_current_state = yy_start;
-
- for ( yy_cp = idxtext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
- if ( yy_accept[yy_current_state] )
- {
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 570 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- }
-
- return yy_current_state;
- }
-
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- * next_state = yy_try_NUL_trans( current_state );
- */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
- {
- register int yy_is_jam;
- register char *yy_cp = yy_c_buf_p;
-
- register YY_CHAR yy_c = 1;
- if ( yy_accept[yy_current_state] )
- {
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
- }
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 570 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 569);
-
- return yy_is_jam ? 0 : yy_current_state;
- }
-
-
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
- {
- register char *yy_cp = yy_c_buf_p;
-
- /* undo effects of setting up yytext */
- *yy_cp = yy_hold_char;
-
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- /* +2 for EOB chars. */
- register int number_to_move = yy_n_chars + 2;
- register char *dest = &yy_current_buffer->yy_ch_buf[
- yy_current_buffer->yy_buf_size + 2];
- register char *source =
- &yy_current_buffer->yy_ch_buf[number_to_move];
-
- while ( source > yy_current_buffer->yy_ch_buf )
- *--dest = *--source;
-
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- yy_current_buffer->yy_n_chars =
- yy_n_chars = yy_current_buffer->yy_buf_size;
-
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
-
- *--yy_cp = (char) c;
-
-
- idxtext_ptr = yy_bp;
- yy_hold_char = *yy_cp;
- yy_c_buf_p = yy_cp;
- }
-#endif /* ifndef YY_NO_UNPUT */
-
-
-#ifdef __cplusplus
-static int yyinput()
-#else
-static int input()
-#endif
- {
- int c;
-
- *yy_c_buf_p = yy_hold_char;
-
- if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
- /* This was really a NUL. */
- *yy_c_buf_p = '\0';
-
- else
- { /* need more input */
- int offset = yy_c_buf_p - idxtext_ptr;
- ++yy_c_buf_p;
-
- switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_LAST_MATCH:
- /* This happens because yy_g_n_b()
- * sees that we've accumulated a
- * token and flags that we need to
- * try matching the token before
- * proceeding. But for input(),
- * there's no matching to consider.
- * So convert the EOB_ACT_LAST_MATCH
- * to EOB_ACT_END_OF_FILE.
- */
-
- /* Reset buffer status. */
- yyrestart( yyin );
-
- /* fall through */
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( yywrap() )
- return EOF;
-
- if ( ! yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
-#ifdef __cplusplus
- return yyinput();
-#else
- return input();
-#endif
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p = idxtext_ptr + offset;
- break;
- }
- }
- }
-
- c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
- *yy_c_buf_p = '\0'; /* preserve yytext */
- yy_hold_char = *++yy_c_buf_p;
-
-
- return c;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
- {
- if ( ! yy_current_buffer )
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
-
- yy_init_buffer( yy_current_buffer, input_file );
- yy_load_buffer_state();
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
- {
- if ( yy_current_buffer == new_buffer )
- return;
-
- if ( yy_current_buffer )
- {
- /* Flush out information for old buffer. */
- *yy_c_buf_p = yy_hold_char;
- yy_current_buffer->yy_buf_pos = yy_c_buf_p;
- yy_current_buffer->yy_n_chars = yy_n_chars;
- }
-
- yy_current_buffer = new_buffer;
- yy_load_buffer_state();
-
- /* We don't actually know whether we did this switch during
- * EOF (yywrap()) processing, but the only time this flag
- * is looked at is after yywrap() is called, so it's safe
- * to go ahead and always set it.
- */
- yy_did_buffer_switch_on_eof = 1;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
- {
- yy_n_chars = yy_current_buffer->yy_n_chars;
- idxtext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
- yyin = yy_current_buffer->yy_input_file;
- yy_hold_char = *yy_c_buf_p;
- }
-
-
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
- {
- YY_BUFFER_STATE b;
-
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_buf_size = size;
-
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_is_our_buffer = 1;
-
- yy_init_buffer( b, file );
-
- return b;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
- {
- if ( ! b )
- return;
-
- if ( b == yy_current_buffer )
- yy_current_buffer = (YY_BUFFER_STATE) 0;
-
- if ( b->yy_is_our_buffer )
- yy_flex_free( (void *) b->yy_ch_buf );
-
- yy_flex_free( (void *) b );
- }
-
-
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
-
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
- {
- yy_flush_buffer( b );
-
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
-
-#if YY_ALWAYS_INTERACTIVE
- b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
- b->yy_is_interactive = 0;
-#else
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-
- {
- if ( ! b )
- return;
-
- b->yy_n_chars = 0;
-
- /* We always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
- b->yy_buf_pos = &b->yy_ch_buf[0];
-
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- if ( b == yy_current_buffer )
- yy_load_buffer_state();
- }
-
-
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
- {
- YY_BUFFER_STATE b;
-
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
- /* They forgot to leave room for the EOB's. */
- return 0;
-
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- yy_switch_to_buffer( b );
-
- return b;
- }
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
- {
- int len;
- for ( len = 0; yy_str[len]; ++len )
- ;
-
- return yy_scan_bytes( yy_str, len );
- }
-#endif
-
-
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
- {
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
-
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = len + 2;
- buf = (char *) yy_flex_alloc( n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
- for ( i = 0; i < len; ++i )
- buf[i] = bytes[i];
-
- buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
-
- b = yy_scan_buffer( buf, n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
- /* It's okay to grow etc. this buffer, and we should throw it
- * away when we're done.
- */
- b->yy_is_our_buffer = 1;
-
- return b;
- }
-#endif
-
-
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
- {
- if ( yy_start_stack_ptr >= yy_start_stack_depth )
- {
- yy_size_t new_size;
-
- yy_start_stack_depth += YY_START_STACK_INCR;
- new_size = yy_start_stack_depth * sizeof( int );
-
- if ( ! yy_start_stack )
- yy_start_stack = (int *) yy_flex_alloc( new_size );
-
- else
- yy_start_stack = (int *) yy_flex_realloc(
- (void *) yy_start_stack, new_size );
-
- if ( ! yy_start_stack )
- YY_FATAL_ERROR(
- "out of memory expanding start-condition stack" );
- }
-
- yy_start_stack[yy_start_stack_ptr++] = YY_START;
-
- BEGIN(new_state);
- }
-#endif
-
-
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
- {
- if ( --yy_start_stack_ptr < 0 )
- YY_FATAL_ERROR( "start-condition stack underflow" );
-
- BEGIN(yy_start_stack[yy_start_stack_ptr]);
- }
-#endif
-
-
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
- {
- return yy_start_stack[yy_start_stack_ptr - 1];
- }
-#endif
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
-#else
-static void yy_fatal_error( msg )
-char msg[];
-#endif
- {
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
- }
-
-
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- yytext[yyleng] = yy_hold_char; \
- yy_c_buf_p = yytext + n; \
- yy_hold_char = *yy_c_buf_p; \
- *yy_c_buf_p = '\0'; \
- yyleng = n; \
- } \
- while ( 0 )
-
-
-/* Internal utility routines. */
-
-#ifndef idxtext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
- {
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
- }
-#endif
-
-#ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
- {
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
-
- return n;
- }
-#endif
-
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
- {
- return (void *) malloc( size );
- }
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
- {
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
- }
-
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
- {
- free( ptr );
- }
-
-#if YY_MAIN
-int main()
- {
- yylex();
- return 0;
- }
-#endif
-#line 73 "idx.l"
-
-
-#ifdef YY_USE_PROTOS
-static int _valint(char *s, idxvalrec **v)
-#else
-static int _valint(s, v)
- char *s;
- idxvalrec **v;
-#endif
-{
- char *t;
- *v = idxvalnew(s);
- (*v)->ival = strtoll(s, &t, 0);
- if( *t )
- idxerror("bad integer value");
- (*v)->type = NUM;
- (*v)->ntype = PARSE_INTEGER;
- (*v)->dval = (double)(*v)->ival;
- return NUM;
-}
-
-#ifdef YY_USE_PROTOS
-static int _valfloat(char *s, idxvalrec **v)
-#else
-static int _valfloat(s, v)
- char *s;
- idxvalrec **v;
-#endif
-{
- char *t;
- *v = idxvalnew(s);
- (*v)->dval = strtod(s, &t);
- if( *t )
- idxerror("bad float value");
- (*v)->type = NUM;
- (*v)->ntype = PARSE_FLOAT;
- return NUM;
-}
-
-#ifdef YY_USE_PROTOS
-static int _valname(char *s, idxvalrec **v)
-#else
-static int _valname(s, v)
- char *s;
- idxvalrec **v;
-#endif
-{
- int i;
- int got;
- int oflag;
- int isize=0;
- char *iname;
- char *colname;
- char tail[SZ_LINE];
- FilterSymbols sp=NULL;
- idxvalrec *vv;
-
- *v = idxvalnew(s);
- /* lookup the string */
- if( !(sp=FilterSymbolLookup(FilterDefault(), s)) ){
- idxerror("column name not found in data file");
- (*v)->type = INDEF;
- return INDEF;
- }
- colname = idxinfo(IDX_COLNAME);
- /* see what sort of symbol it is */
- switch(sp->type){
- case SYM_COL:
- if( !(iname=idxindexfilename(s, &isize)) ){
- (*v)->type = INDEF;
- return INDEF;
- }
- /* if we already have opened this index, just use the existing handle */
- if( (vv=idxlookupfilename(iname)) ){
- (*v)->igio = vv->igio;
- (*v)->ifits = vv->ifits;
- }
- /* open index for first time and mark iname */
- else{
- oflag = setgerror(0);
- (*v)->igio = ft_fitsheadopen(iname, &((*v)->ifits), tail, SZ_LINE, "r");
- setgerror(oflag);
- if( !((*v)->igio) ){
- idxerror("existing index file can't be opened");
- (*v)->type = INDEF;
- return INDEF;
- }
- else{
- (*v)->iname = xstrdup(iname);
- }
- }
- xfree(iname);
- if( (*v)->ifits ){
- for(got=0, i=0; i<(*v)->ifits->table->tfields; i++){
- if( !strcasecmp(s, (*v)->ifits->table->col[i].name) ){
- (*v)->vtype = (*v)->ifits->table->col[i].type;
- (*v)->voffset = (*v)->ifits->table->col[i].offset;
- (*v)->vn = (*v)->ifits->table->col[i].n;
- got++;
- }
- if( !strcasecmp(colname, (*v)->ifits->table->col[i].name) ){
- (*v)->itype = (*v)->ifits->table->col[i].type;
- (*v)->ioffset = (*v)->ifits->table->col[i].offset;
- (*v)->in = (*v)->ifits->table->col[i].n;
- got++;
- }
- }
- if( got == 2 ){
-#ifdef HAVE_SYS_MMAN_H
- if( !(*v)->igio->gz ){
- if(!((*v)->idata = mmap(NULL, isize, PROT_READ, MAP_PRIVATE,
- fileno((*v)->igio->fp), 0)) ){
- idxerror("index file can't be mmap'ed");
- (*v)->type = INDEF;
- return INDEF;
- }
- (*v)->ilen = isize;
- }
-#endif
- (*v)->nrow = ft_naxis((*v)->ifits,2);
- (*v)->type = COL;
- return COL;
- }
- else{
- idxerror("column name and/or index not found in index file");
- }
- }
- else{
- (*v)->type = INDEF;
- return INDEF;
- }
- case SYM_PAR:
- (*v)->ntype=ParseDataType(sp->value, &(*v)->dval, &(*v)->ival);
- (*v)->type = NUM;
- switch((*v)->ntype){
- case PARSE_INTEGER:
- case PARSE_HEXINT:
- (*v)->dval = (double)(*v)->ival;
- return NUM;
- case PARSE_FLOAT:
- return NUM;
- default:
- idxerror("invalid parameter type in index");
- return 0;
- }
- default:
- idxerror("unknown symbol type in index");
- return 0;
- }
-}
-
-#ifdef YY_USE_PROTOS
-static int _valreglims(idxvalrec *v, char *s)
-#else
-static int _valreglims(v, s)
- idxvalrec *v;
- char *s;
-#endif
-{
- int i;
- int ip=0;
- int nd=0, maxd=0;
- double xcen, ycen;
- double dval;
- double *dvals;
- double pts[8];
- char tbuf[SZ_LINE];
- char tbuf2[SZ_LINE];
- double angle;
- double xwidth, yheight;
- double angl; /* l: Cartesian angle in radians */
- double half_width, half_height;/* l: radii (1/2 width and height) */
- double cosangl, sinangl; /* l: sine, cosine of the Cartesian angle */
- double hw_cos, hw_sin; /* l: products of half_width with sin, cos */
- double hh_cos, hh_sin; /* l: products of half_height with sin, cos */
-
- if( !strcmp(v->s, "circle") || !strcmp(v->s, "ncircle") ||
- !strcmp(v->s, "annulus") || !strcmp(v->s, "nannulus") ){
- if( !word(s, tbuf, &ip)||!word(s, tbuf2, &ip) ) return 0;
- xcen = atof(tbuf);
- ycen = atof(tbuf2);
- dval = -1;
- if( *v->s == 'n' ){
- if( !word(s, tbuf, &ip) || !word(s, tbuf, &ip) ) return 0;
- dval = MAX(atof(tbuf),dval);
- }
- else{
- while( word(s, tbuf, &ip) && strcmp(tbuf, "-142857.142857") ){
- dval = MAX(atof(tbuf),dval);
- }
- }
- v->rlo[0] = xcen - dval - 1;
- v->rhi[0] = xcen + dval + 1;
- v->rlo[1] = ycen - dval - 1;
- v->rhi[1] = ycen + dval + 1;
- return 1;
- }
- else if( !strcmp(v->s, "box") || !strcmp(v->s, "nbox") ||
- !strcmp(v->s, "ellipse") || !strcmp(v->s, "nellipse") ){
- if( !word(s, tbuf, &ip)||!word(s, tbuf2, &ip) ) return 0;
- xcen = atof(tbuf);
- ycen = atof(tbuf2);
- maxd = SZ_LINE;
- if( !(dvals=(double *)malloc(maxd*sizeof(double))) ) return 0;
- if( *v->s == 'n' ){
- if( !word(s, tbuf, &ip) || !word(s, tbuf, &ip) ) return 0;
- if( !word(s, tbuf, &ip) || !word(s, tbuf2, &ip) ) return 0;
- dvals[nd++] = atof(tbuf);
- dvals[nd++] = atof(tbuf2);
- if( word(s, tbuf, &ip) && word(s, tbuf, &ip) )
- dvals[nd++] = atof(tbuf);
- }
- else{
- while( word(s, tbuf, &ip) && strcmp(tbuf, "-142857.142857") ){
- dvals[nd++] = atof(tbuf);
- if( nd == maxd ){
- maxd += SZ_LINE;
- if( !(dvals=(double *)realloc(dvals, maxd*sizeof(double))) ) return 0;
- }
- }
- }
-ellcom:
- if( nd == 2 ){
- angle = 0.0;
- xwidth = dvals[0];
- yheight = dvals[1];
- }
- else{
- angle = dvals[nd-1];
- xwidth = dvals[nd-3];
- yheight = dvals[nd-2];
- }
- if( dvals ) xfree(dvals);
-
- /* Why is this done in evfilter.c??? Doesn't seem necessary */
- /* angl = angle + 90.0; */
- angl = angle;
- while (angl >= 360.0) angl = angl - 360.0;
- /* convert to radians */
- angl = (angl / 180.0) * M_PI;
- sinangl = sin (angl);
- cosangl = cos (angl);
- /* Why is this done in evfilter.c??? Doesn't seem necessary */
- /* since we rotate by 90.0 degrees to get from astro angle to cartesian, */
- /* we also need to switch the width and height. we do this secretly so */
- /* that the display will turn out right, by doing it in the half terms */
- if( !strcmp(v->s, "box") ){
- /*
- half_width = yheight / 2.0;
- half_height = xwidth / 2.0;
- */
- half_width = xwidth / 2.0;
- half_height = yheight / 2.0;
- }
- else{
- /*
- half_width = yheight;
- half_height = xwidth;
- */
- half_width = xwidth;
- half_height = yheight;
- }
- hw_cos = half_width * cosangl;
- hw_sin = half_width * sinangl;
- hh_cos = half_height * cosangl;
- hh_sin = half_height * sinangl;
-
- pts[0] = xcen - hw_cos - hh_sin;
- pts[1] = ycen - hw_sin + hh_cos;
- pts[2] = xcen + hw_cos - hh_sin;
- pts[3] = ycen + hw_sin + hh_cos;
- pts[4] = xcen + hw_cos + hh_sin;
- pts[5] = ycen + hw_sin - hh_cos;
- pts[6] = xcen - hw_cos + hh_sin;
- pts[7] = ycen - hw_sin - hh_cos;
-
- v->rlo[0] = pts[0];
- v->rhi[0] = pts[0];
- v->rlo[1] = pts[1];
- v->rhi[1] = pts[1];
- for(i=2; i<8; i+=2){
- v->rlo[0] = MIN(pts[i],v->rlo[0]);
- v->rhi[0] = MAX(pts[i],v->rhi[0]);
- v->rlo[1] = MIN(pts[i+1],v->rlo[1]);
- v->rhi[1] = MAX(pts[i+1],v->rhi[1]);
- }
- return 1;
- }
- else if( !strcmp(v->s, "line") ){
- for(i=0; i<4; i++){
- if( word(s, tbuf, &ip) ){
- pts[i] = atof(tbuf);
- }
- }
- v->rlo[0] = MIN(pts[0],pts[2]);
- v->rhi[0] = MAX(pts[0],pts[2]);
- v->rlo[1] = MIN(pts[1],pts[3]);
- v->rhi[1] = MAX(pts[1],pts[3]);
- return 1;
- }
- else if( !strcmp(v->s, "point") || !strcmp(v->s, "polygon") ){
- if( !word(s, tbuf, &ip)||!word(s, tbuf2, &ip) ) return 0;
- xcen = atof(tbuf);
- ycen = atof(tbuf2);
- v->rlo[0] = xcen-1;
- v->rhi[0] = xcen+1;
- v->rlo[1] = ycen-1;
- v->rhi[1] = ycen+1;
- while( word(s, tbuf, &ip) && strcmp(tbuf, "-142857.142857") &&
- word(s, tbuf2, &ip) ){
- dval = atof(tbuf);
- v->rlo[0] = MIN(dval-1,v->rlo[0]);
- v->rhi[0] = MAX(dval+1,v->rhi[0]);
- dval = atof(tbuf2);
- v->rlo[1] = MIN(dval-1,v->rlo[1]);
- v->rhi[1] = MAX(dval+1,v->rhi[1]);
- }
- return 1;
- }
- else if( !strcmp(v->s, "pie") || !strcmp(v->s, "qtpie") ){
- return 0;
- }
- else if( !strcmp(v->s, "panda") || !strcmp(v->s, "cpanda") ){
- maxd = SZ_LINE;
- if( !(dvals=(double *)malloc(maxd*sizeof(double))) ) return 0;
- while( word(s, tbuf, &ip) && strcmp(tbuf, "-142857.142857") ){
- dvals[nd++] = atof(tbuf);
- if( nd == maxd ){
- maxd += SZ_LINE;
- if( !(dvals=(double *)realloc(dvals, maxd*sizeof(double))) ) return 0;
- }
- }
- v->rlo[0] = dvals[0] - dvals[6] - 1;
- v->rhi[0] = dvals[0] + dvals[6] + 1;
- v->rlo[1] = dvals[1] - dvals[6] - 1;
- v->rhi[1] = dvals[1] + dvals[6] + 1;
- if( dvals ) xfree(dvals);
- return 1;
- }
- else if( !strcmp(v->s, "bpanda") || !strcmp(v->s, "epanda") ){
- maxd = 3;
- if( !(dvals=(double *)malloc(maxd*sizeof(double))) ) return 0;
- /* grab: xcen ycen */
- if( !word(s, tbuf, &ip)||!word(s, tbuf2, &ip) ) return 0;
- xcen = atof(tbuf);
- ycen = atof(tbuf2);
- /* skip: ang1 ang2 nang xwlo yhlo */
- for(i=0; i<5; i++){
- if( !word(s, tbuf, &ip) ) return 0;
- }
- /* grab: xwhi yhhi */
- for(i=0; i<2; i++){
- if( !word(s, tbuf, &ip) ) return 0;
- dvals[nd++] = atof(tbuf);
- }
- /* skip: nrad */
- if( !word(s, tbuf, &ip) ) return 0;
- /* grab: ang */
- if( !word(s, tbuf, &ip) ) return 0;
- dvals[nd++] = atof(tbuf);
- /* we can now handle this with box/ellipse code */
- goto ellcom;
- }
- else if( !strcmp(v->s, "field") ){
- return 0;
- }
- else{
- return 0;
- }
-}
-
-#ifdef YY_USE_PROTOS
-static int _valreg(char *s, idxvalrec **v)
-#else
-static int _valreg(s, v)
- char *s;
- idxvalrec **v;
-#endif
-{
- int ip=0;
- char *t;
- char tbuf[SZ_LINE];
- *v = idxvalnew(NULL);
- newdtable("(),");
- while( *s == '(' ) s++;
- if( !word(s, tbuf, &ip) ){
- (*v)->type = INDEF;
- return REG;
- }
- if( strstr(tbuf, "field") ){
- (*v)->type = INDEF;
- return REG;
- }
- t = tbuf+2;
- if( *t == 'v' ) t++;
- (*v)->s = xstrdup(t);
- if( !word(s, tbuf, &ip) || !word(s, tbuf, &ip) ||
- !word(s, tbuf, &ip) || !word(s, tbuf, &ip) ){
- (*v)->type = INDEF;
- return REG;
- }
- /* include/exclude */
- if( !atoi(tbuf) ){
- (*v)->type = INDEF;
- return REG;
- }
- if( !word(s, tbuf, &ip) || !word(s, tbuf, &ip) || !word(s, tbuf, &ip) ){
- (*v)->type = INDEF;
- return REG;
- }
- culc(tbuf);
- _valname(tbuf, &(*v)->rv[0]);
- if( !word(s, tbuf, &ip) || !word(s, tbuf, &ip) ){
- (*v)->type = INDEF;
- return REG;
- }
- culc(tbuf);
- _valname(tbuf, &(*v)->rv[1]);
- if( !_valreglims(*v, &s[ip]) ){
- (*v)->type = INDEF;
- return REG;
- }
- freedtable();
- (*v)->type = REG;
- return REG;
-}
-
-#ifdef YY_USE_PROTOS
-static int _valfunc(char *s, idxvalrec **v)
-#else
-static int _valfunc(s, v)
- char *s;
- idxvalrec **v;
-#endif
-{
- *v = idxvalnew(s);
- (*v)->type = FUNC;
- return FUNC;
-}
-
-
-#ifdef YY_USE_PROTOS
-void
-idxstring(char *s)
-#else
-void idxstring(s)
- char *s;
-#endif
-{
- idx_scan_string(s);
-}
-
-#ifdef YY_USE_PROTOS
-int
-idxerror(char *msg)
-#else
-int idxerror(msg)
- char *msg;
-#endif
-{
- Filter filter;
-
- YY_FLUSH_BUFFER;
- /* turn indexing off */
- if( (filter=FilterDefault()) ){
- filter->doidx = -1;
- }
- /* output message, if necessary */
- if( idx_debug ){
- fprintf(stderr, "ERROR: %s", msg);
- if( !strcmp(msg, "syntax error") ){
- fprintf(stderr, " (terminating index processing)");
- }
- fprintf(stderr, "\n");
- }
- yyterminate();
-}
-
-#ifdef YY_USE_PROTOS
-int yywrap(void)
-#else
-int yywrap()
-#endif
-{
- return 1;
-}
-
diff --git a/funtools/filter/regions.h b/funtools/filter/regions.h
deleted file mode 100644
index 984323d..0000000
--- a/funtools/filter/regions.h
+++ /dev/null
@@ -1,408 +0,0 @@
-#if MINIMIZE_INCLUDES
-#include <stdarg.h>
-int sscanf(const char *s, const char *format, ...);
-typedef unsigned long size_t;
-size_t strlen();
-char *strcpy(), *strdup(), *strstr(), *getenv();
-void *calloc(), *malloc(), *memset(), *memmove();
-void exit();
-#else
-#include <stdio.h>
-#include <unistd.h>
-#include <math.h>
-#include <string.h>
-#include <sys/types.h>
-#ifdef __STDC__
-#include <stdlib.h>
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#endif
-
-#if MINIMIZE_INCLUDES
-/* lots of math functions from math.h */
-extern double acos(double);
-extern double asin(double);
-extern double atan(double);
-extern double atan2(double, double);
-extern double cos(double);
-extern double sin(double);
-extern double tan(double);
-extern double acosh(double);
-extern double asinh(double);
-extern double atanh(double);
-extern double cosh(double);
-extern double sinh(double);
-extern double tanh(double);
-extern double exp (double);
-extern double exp2 (double);
-extern double expm1 (double);
-extern double log (double);
-extern double log10 (double);
-extern double log2 (double);
-extern double log1p (double);
-extern double logb (double);
-extern double modf (double, double *);
-extern double ldexp (double, int);
-extern double frexp (double, int *);
-extern int ilogb (double);
-extern double scalbn (double, int);
-extern double scalbln (double, long int);
-extern double fabs(double);
-extern double cbrt(double);
-extern double hypot (double, double);
-extern double pow (double, double);
-extern double sqrt(double);
-extern double erf(double);
-extern double erfc(double);
-extern double lgamma(double);
-extern double tgamma(double);
-extern double ceil (double);
-extern double floor (double);
-extern double nearbyint (double);
-extern double rint (double);
-extern long int lrint (double);
-extern double round (double);
-extern long int lround (double);
-extern double trunc (double);
-extern double fmod (double, double);
-extern double remainder (double, double);
-extern double remquo (double, double, int *);
-extern double copysign (double, double);
-extern double nan(const char *);
-extern double nextafter (double, double);
-extern double fdim (double, double);
-extern double fmax (double, double);
-extern double fmin (double, double);
-extern double fma (double, double, double);
-/* and math constants */
-#define M_E 2.71828182845904523536028747135266250 /* e */
-#define M_LOG2E 1.44269504088896340735992468100189214 /* log 2e */
-#define M_LOG10E 0.434294481903251827651128918916605082 /* log 10e */
-#define M_LN2 0.693147180559945309417232121458176568 /* log e2 */
-#define M_LN10 2.30258509299404568401799145468436421 /* log e10 */
-#define M_PI 3.14159265358979323846264338327950288 /* pi */
-#define M_PI_2 1.57079632679489661923132169163975144 /* pi/2 */
-#define M_PI_4 0.785398163397448309615660845819875721 /* pi/4 */
-#define M_1_PI 0.318309886183790671537767526745028724 /* 1/pi */
-#define M_2_PI 0.636619772367581343075535053490057448 /* 2/pi */
-#define M_2_SQRTPI 1.12837916709551257389615890312154517 /* 2/sqrt(pi) */
-#define M_SQRT2 1.41421356237309504880168872420969808 /* sqrt(2) */
-#define M_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */
-#endif
-
-#define MASKINC 10000
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-#define SMALL_NUMBER 1.0E-24
-#define LARGE_NUMBER 65535
-#define PSTOP -142857.142857
-
-#ifndef SZ_LINE
-#define SZ_LINE 4096
-#endif
-#ifndef min
-#define min(x,y) (((x)<(y))?(x):(y))
-#endif
-#ifndef max
-#define max(x,y) (((x)>(y))?(x):(y))
-#endif
-#ifndef abs
-#define abs(x) ((x)<0?(-x):(x))
-#endif
-#ifndef feq
-#define feq(x,y) (fabs((double)x-(double)y)<=(double)1.0E-15)
-#endif
-#ifndef NULL
-#define NULL (void *)0
-#endif
-
-#ifndef TOK_EREG
-#define TOK_EREG 1
-#endif
-#ifndef TOK_NREG
-#define TOK_NREG 2
-#endif
-#ifndef TOK_IREG
-#define TOK_IREG 4
-#endif
-
-#define PIXCEN(a) (double)(a)
-#define PIXNUM(a) (int)((a)+0.5)
-#define PIXSTART(a) ((int)(a)+1)
-#define PIXSTOP(a) (((int)(a))==(a)?((int)(a)-1):((int)(a)))
-/* to assure that geometrically adjoining regions touch but don't overlap */
-/* when edge is exactly on a pixel center it goes to right or upper region. */
-/* used for non-radially symetric regions instead of PIXSTART, PIXSTOP */
-#define PIXINCL(a) (int)((a)+1.0)
-
-/* this is the filter string for field only */
-#define EVFIELDONLY "(evfield(g,1,1,1,(double)x,(double)y))"
-
-#define XSNO 3
-
-/* NB: these MUST match the definition in filter.h */
-#ifndef __filter_h
-typedef struct filtmaskrec {
- int region;
- int y;
- int xstart, xstop;
-} *FilterMask, FilterMaskRec;
-
-/* parameter structure for a scan entry */
-typedef struct scanrec{
- struct scanrec *next;
- int x;
-} *Scan, ScanRec;
-
-typedef struct shaperec {
- int init;
- double ystart, ystop;
- Scan *scanlist;
- /* varargs */
- int nv;
- double *xv;
- /* circle, annulus */
- double r1sq, r2sq;
- /* ellipse */
- double angl, sinangl, cosangl;
- double cossq, sinsq;
- double xradsq, yradsq;
- double a;
- /* polygon-style shapes */
- int npt;
- double *pts;
- /* line */
- int xonly;
- double x1, x2, y1;
- double invslope;
-} *Shape, ShapeRec;
-
-/* these are global for use with special region routines */
-typedef struct gfiltrec {
- int nshapes; /* number of shapes */
- int maxshapes; /* number of shape records we allocate */
- Shape shapes; /* array holding range limits for one shape */
- int rid; /* first valid region for current pixel */
- int usebinsiz; /* whether bindizx,binsizy are used */
- char *evsect; /* value of event section */
- double tlminx, tlminy; /* tlmin for event section */
- double binsizx, binsizy; /* bin sizes for event section */
- double tloff; /* offset for quick p2i conversion */
- int xmin, xmax, ymin, ymax; /* section limits in original image coords */
- int block; /* block factor */
- int x0, x1, y0, y1; /* section limits in section coords */
- int *ybuf; /* valid y row flags */
- int *x0s; /* valid x start values */
- int *x1s; /* valid x stop values */
- int nmask; /* number of image mask record */
- int maskdim; /* size of mask image */
- FilterMask masks; /* mask records */
-} *GFilt, GFiltRec;
-#endif
-
-/* declare image init routines */
-void imannulusi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double iradius, double oradius);
-void imboxi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double xwidth, double yheight,
- double angle);
-void imcirclei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double radius);
-void imellipsei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double xrad, double yrad,
- double angle);
-void imfieldi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y);
-void imlinei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double x0, double y0, double x1, double y1);
-void impiei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2);
-void imqtpiei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2);
-void impointi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen);
-void impandai(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double radlo, double radhi, double radn);
-void imnannulusi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lo, double hi, int n);
-void imnboxi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double angle);
-void imnellipsei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double angle);
-void imnpiei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lo, double hi, int n);
-
-#ifdef __STDC__
-void impolygoni(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, ...);
-void imvannulusi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...);
-void imvboxi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...);
-void imvellipsei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...);
-void imvpiei(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...);
-void imvpointi(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, ...);
-#endif
-
-
-/* declare image region routines */
-int imannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double iradius, double oradius);
-int imbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double xwidth, double yheight,
- double angle);
-int imcircle(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double radius);
-int imellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double xrad, double yrad,
- double angle);
-int imfield(GFilt g, int rno, int sno, int flag, int type,
- double x, double y);
-int imline(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double x1, double y1, double x2, double y2);
-int impie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2);
-int imqtpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2);
-int impoint(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen);
-int impanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double radlo, double radhi, double radn);
-int imnannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lo, double hi, int n);
-int imnbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double angle);
-int imnellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double angle);
-int imnpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lo, double hi, int n);
-#ifdef __STDC__
-int impolygon(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, ...);
-int imvannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...);
-int imvbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...);
-int imvellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...);
-int imvpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...);
-int imvpoint(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, ...);
-#endif
-
-/* declare event region routines */
-int evannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double iradius, double oradius);
-int evbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double xwidth, double yheight,
- double angle);
-int evcircle(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double radius);
-int evellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double xrad, double yrad,
- double angle);
-int evfield(GFilt g, int rno, int sno, int flag, int type,
- double x, double y);
-int evline(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double x1, double y1, double x2, double y2);
-int evpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2);
-int evqtpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen, double angle1, double angle2);
-int evpoint(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen);
-int evnannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lo, double hi, int n);
-int evnbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double angle);
-int evnellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lox, double loy, double hix, double hiy, int n,
- double angle);
-int evnpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double lo, double hi, int n);
-int evpanda(GFilt g, int rno, int sno, int flag, int type,
- double x, double y,
- double xcen, double ycen,
- double anglo, double anghi, double angn,
- double radlo, double radhi, double radn);
-#ifdef __STDC__
-int evpolygon(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, ...);
-int evvannulus(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...);
-int evvbox(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...);
-int evvellipse(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...);
-int evvpie(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, double xcen, double ycen, ...);
-int evvpoint(GFilt g, int rno, int sno, int flag, int type,
- double x, double y, ...);
-#endif
-
diff --git a/funtools/filter/regions_h.h b/funtools/filter/regions_h.h
deleted file mode 100644
index bfb0d57..0000000
--- a/funtools/filter/regions_h.h
+++ /dev/null
@@ -1 +0,0 @@
-static char *REGIONS_H="\n#if MINIMIZE_INCLUDES\n#include <stdarg.h>\nint sscanf(const char *s, const char *format, ...);\ntypedef unsigned long size_t;\nsize_t strlen();\nchar *strcpy(), *strdup(), *strstr(), *getenv();\nvoid *calloc(), *malloc(), *memset(), *memmove();\nvoid exit();\n#else\n#include <stdio.h>\n#include <unistd.h>\n#include <math.h>\n#include <string.h>\n#include <sys/types.h>\n#ifdef __STDC__\n#include <stdlib.h>\n#include <stdarg.h>\n#else\n#include <varargs.h>\n#endif\n#endif\n\n#if MINIMIZE_INCLUDES\n\nextern double acos(double);\nextern double asin(double);\nextern double atan(double);\nextern double atan2(double, double);\nextern double cos(double);\nextern double sin(double);\nextern double tan(double);\nextern double acosh(double);\nextern double asinh(double);\nextern double atanh(double);\nextern double cosh(double);\nextern double sinh(double);\nextern double tanh(double);\nextern double exp (double);\nextern double exp2 (double); \nextern double expm1 (double); \nextern double log (double);\nextern double log10 (double);\nextern double log2 (double);\nextern double log1p (double);\nextern double logb (double);\nextern double modf (double, double *);\nextern double ldexp (double, int);\nextern double frexp (double, int *);\nextern int ilogb (double);\nextern double scalbn (double, int);\nextern double scalbln (double, long int);\nextern double fabs(double);\nextern double cbrt(double);\nextern double hypot (double, double);\nextern double pow (double, double);\nextern double sqrt(double);\nextern double erf(double);\nextern double erfc(double);\nextern double lgamma(double);\nextern double tgamma(double);\nextern double ceil (double);\nextern double floor (double);\nextern double nearbyint (double);\nextern double rint (double);\nextern long int lrint (double);\nextern double round (double);\nextern long int lround (double);\nextern double trunc (double);\nextern double fmod (double, double);\nextern double remainder (double, double);\nextern double remquo (double, double, int *);\nextern double copysign (double, double);\nextern double nan(const char *);\nextern double nextafter (double, double);\nextern double fdim (double, double);\nextern double fmax (double, double);\nextern double fmin (double, double);\nextern double fma (double, double, double);\n\n#define M_E 2.71828182845904523536028747135266250 \n#define M_LOG2E 1.44269504088896340735992468100189214 \n#define M_LOG10E 0.434294481903251827651128918916605082 \n#define M_LN2 0.693147180559945309417232121458176568 \n#define M_LN10 2.30258509299404568401799145468436421 \n#define M_PI 3.14159265358979323846264338327950288 \n#define M_PI_2 1.57079632679489661923132169163975144 \n#define M_PI_4 0.785398163397448309615660845819875721 \n#define M_1_PI 0.318309886183790671537767526745028724 \n#define M_2_PI 0.636619772367581343075535053490057448 \n#define M_2_SQRTPI 1.12837916709551257389615890312154517 \n#define M_SQRT2 1.41421356237309504880168872420969808 \n#define M_SQRT1_2 0.707106781186547524400844362104849039 \n#endif\n\n#define MASKINC 10000\n#ifndef M_PI\n#define M_PI 3.14159265358979323846\n#endif\n#define SMALL_NUMBER 1.0E-24\n#define LARGE_NUMBER 65535\n#define PSTOP -142857.142857\n\n#ifndef SZ_LINE\n#define SZ_LINE 4096\n#endif\n#ifndef min\n#define min(x,y) (((x)<(y))?(x):(y))\n#endif\n#ifndef max\n#define max(x,y) (((x)>(y))?(x):(y))\n#endif\n#ifndef abs\n#define abs(x) ((x)<0?(-x):(x))\n#endif\n#ifndef feq\n#define feq(x,y) (fabs((double)x-(double)y)<=(double)1.0E-15)\n#endif\n#ifndef NULL\n#define NULL (void *)0\n#endif\n\n#ifndef TOK_EREG\n#define TOK_EREG 1\n#endif\n#ifndef TOK_NREG\n#define TOK_NREG 2\n#endif\n#ifndef TOK_IREG\n#define TOK_IREG 4\n#endif\n\n#define PIXCEN(a) (double)(a)\n#define PIXNUM(a) (int)((a)+0.5) \n#define PIXSTART(a) ((int)(a)+1)\n#define PIXSTOP(a) (((int)(a))==(a)?((int)(a)-1):((int)(a)))\n\n\n\n#define PIXINCL(a) (int)((a)+1.0) \n\n\n#define EVFIELDONLY \"(evfield(g,1,1,1,(double)x,(double)y))\"\n\n#define XSNO 3\n\n\n#ifndef __filter_h\ntypedef struct filtmaskrec {\n int region;\n int y;\n int xstart, xstop;\n} *FilterMask, FilterMaskRec;\n\n\ntypedef struct scanrec{\n struct scanrec *next;\n int x;\n} *Scan, ScanRec;\n\ntypedef struct shaperec {\n int init;\n double ystart, ystop;\n Scan *scanlist;\n \n int nv;\n double *xv;\n \n double r1sq, r2sq;\n \n double angl, sinangl, cosangl;\n double cossq, sinsq;\n double xradsq, yradsq;\n double a;\n \n int npt;\n double *pts;\n \n int xonly;\n double x1, x2, y1;\n double invslope;\n} *Shape, ShapeRec;\n\n\ntypedef struct gfiltrec {\n int nshapes; \n int maxshapes; \n Shape shapes; \n int rid; \n int usebinsiz; \n char *evsect; \n double tlminx, tlminy; \n double binsizx, binsizy; \n double tloff; \n int xmin, xmax, ymin, ymax; \n int block; \n int x0, x1, y0, y1; \n int *ybuf; \n int *x0s; \n int *x1s; \n int nmask; \n int maskdim; \n FilterMask masks; \n} *GFilt, GFiltRec;\n#endif\n\n\nvoid imannulusi(GFilt g, int rno, int sno, int flag, int type, \n double x, double y,\n double xcen, double ycen, double iradius, double oradius);\nvoid imboxi(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double xwidth, double yheight,\n double angle);\nvoid imcirclei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double radius);\nvoid imellipsei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double xrad, double yrad,\n double angle);\nvoid imfieldi(GFilt g, int rno, int sno, int flag, int type,\n double x, double y);\nvoid imlinei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double x0, double y0, double x1, double y1);\nvoid impiei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double angle1, double angle2);\nvoid imqtpiei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double angle1, double angle2);\nvoid impointi(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen);\nvoid impandai(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double anglo, double anghi, double angn,\n double radlo, double radhi, double radn);\nvoid imnannulusi(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lo, double hi, int n);\nvoid imnboxi(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lox, double loy, double hix, double hiy, int n,\n double angle);\nvoid imnellipsei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lox, double loy, double hix, double hiy, int n,\n double angle);\nvoid imnpiei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lo, double hi, int n);\n\n#ifdef __STDC__\nvoid impolygoni(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, ...);\nvoid imvannulusi(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...);\nvoid imvboxi(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...);\nvoid imvellipsei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...);\nvoid imvpiei(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...);\nvoid imvpointi(GFilt g, int rno, int sno, int flag, int type, \n double x, double y, ...);\n#endif\n\n\n\nint imannulus(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double iradius, double oradius);\nint imbox(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double xwidth, double yheight,\n double angle);\nint imcircle(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double radius);\nint imellipse(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double xrad, double yrad,\n double angle);\nint imfield(GFilt g, int rno, int sno, int flag, int type,\n double x, double y);\nint imline(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double x1, double y1, double x2, double y2);\nint impie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double angle1, double angle2);\nint imqtpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double angle1, double angle2);\nint impoint(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen);\nint impanda(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double anglo, double anghi, double angn,\n double radlo, double radhi, double radn);\nint imnannulus(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lo, double hi, int n);\nint imnbox(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lox, double loy, double hix, double hiy, int n,\n double angle);\nint imnellipse(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lox, double loy, double hix, double hiy, int n,\n double angle);\nint imnpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lo, double hi, int n);\n#ifdef __STDC__\nint impolygon(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, ...);\nint imvannulus(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...);\nint imvbox(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...);\nint imvellipse(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...);\nint imvpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...);\nint imvpoint(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, ...);\n#endif\n\n\nint evannulus(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double iradius, double oradius);\nint evbox(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double xwidth, double yheight,\n double angle);\nint evcircle(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double radius);\nint evellipse(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double xrad, double yrad,\n double angle);\nint evfield(GFilt g, int rno, int sno, int flag, int type,\n double x, double y);\nint evline(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double x1, double y1, double x2, double y2);\nint evpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double angle1, double angle2);\nint evqtpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen, double angle1, double angle2);\nint evpoint(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen);\nint evnannulus(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lo, double hi, int n);\nint evnbox(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lox, double loy, double hix, double hiy, int n,\n double angle);\nint evnellipse(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lox, double loy, double hix, double hiy, int n,\n double angle);\nint evnpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double lo, double hi, int n);\nint evpanda(GFilt g, int rno, int sno, int flag, int type,\n double x, double y,\n double xcen, double ycen,\n double anglo, double anghi, double angn,\n double radlo, double radhi, double radn);\n#ifdef __STDC__\nint evpolygon(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, ...);\nint evvannulus(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...);\nint evvbox(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...);\nint evvellipse(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...);\nint evvpie(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, double xcen, double ycen, ...);\nint evvpoint(GFilt g, int rno, int sno, int flag, int type,\n double x, double y, ...);\n#endif\n\n";
diff --git a/funtools/filter/sample.c b/funtools/filter/sample.c
deleted file mode 100644
index 4cacfca..0000000
--- a/funtools/filter/sample.c
+++ /dev/null
@@ -1,83 +0,0 @@
-
-#define min(x,y) (((x)<(y))?(x):(y))
-#define max(x,y) (((x)>(y))?(x):(y))
-
-
-#define CONVERT 0
-#define FILTER (pha==1&&pi>3)
-#define ESIZE 20
-#define GET_pha LoadColumn(eptr+4,2,1,CONVERT,&pha)
-#define GET_pi LoadColumn(eptr+6,2,1,CONVERT,&pi)
-#define GET GET_pha;GET_pi;
-short pha;
-short pi;
-
-#define RADIAN 57.295779513082320877
-#define RADTODEG(r) ((r)*RADIAN)
-#define DEGTORAD(d) ((d)/RADIAN)
-#define INSIDE(a,r1,r2) (((a)>(r1))&&((a)<=((r2)<(r1)?(r2+360.0):(r2))))
-
-static double d;
-
-#define Annulus(X,Y,x,y,ri,ro) ((((X-x)*(X-x))+((Y-y)*(Y-y))<=(ro*ro))&& (((X-x)*(X-x))+((Y-y)*(Y-y))>(ri*ri)))
-#define annulus(x,y,ri,ro) Annulus(_X_,_Y_,x,y,ri,ro)
-
-#define Circle(X,Y,x,y,r) (((X-x)*(X-x))+((Y-y)*(Y-y))<=(r*r))
-#define circle(x,y,r) Circle(_X_,_Y_,x,y,r)
-
-#define Ellipse(X,Y,x,y,a,b) (((X-x)*(X-x))/(double)(a*a))+(((Y-y)*(Y-y))/(double)(b*b))<=1.0)
-#define ellipse(x,y,a,b) Ellipse(_X_,_Y_,x,y,a,b)
-
-#define Pie(X,Y,x,y,r1,r2) ((X==x)&&(Y==y)?1:(INSIDE(((d=RADTODEG(atan2(Y-y,X-x)))<90?d+270.0:d-90.0),r1,r2)))
-#define pie(x,y,r1,r2) Pie(_X_,_Y_,x,y,r1,r2)
-
-#define Point(X,Y,x,y) ((X==x)&&(Y==y))
-#define point(x,y) Point(_X_,_Y_,x,y)
-
-#define Box(X,Y,x,y,w,h) ((X>(x-(double)(w/2)))&&(X<=(x+(double)(w/2)))&&(Y>(y-(double)(h/2)))&&(Y<=(y+(double)(h/2))))
-#define box(x,y,w,h) Box(_X_,_Y_,x,y,w,h)
-
-LoadColumn(eptr, bytes, iter, convert, obuf)
- char *eptr;
- int bytes, iter, convert;
- char *obuf;
-{
- char *optr=obuf;
- int i, j;
- for(i=0; i<iter; i++){
- optr = obuf + (i*bytes);
- if( convert ){
- for(j=0; j<bytes; j++)
- optr[j] = *(eptr+bytes-1-j);
- }
- else{
- for(j=0; j<bytes; j++)
- optr[j] = *(eptr+j);
- }
- }
-}
-
-main(argc, argv)
- int argc;
- char **argv;
-{
- char *ebuf=(char *)0, *eptr, *etop, *rptr;
- int get, got;
- while( read(0, &get, 4) >0 ){
- ebuf = (char *)malloc(get);
- for(etop=ebuf; get>0; etop += got, get -= got){
- if( (got=read(0, etop, get)) <=0 )
- break;
- }
- for(rptr=ebuf, eptr=ebuf; eptr<etop; rptr++, eptr += ESIZE){
- GET;
- *rptr = FILTER;
- }
- got = ((etop - ebuf)/ESIZE);
- write(1, &got, 4);
- write(1, ebuf, got);
- free(ebuf);
- }
- unlink(argv[0]);
-}
-
diff --git a/funtools/filter/swap.c b/funtools/filter/swap.c
deleted file mode 100644
index e7c9bfd..0000000
--- a/funtools/filter/swap.c
+++ /dev/null
@@ -1,92 +0,0 @@
-#if __DARWIN_BYTE_ORDER
-#define XBYTE_ORDER __DARWIN_BYTE_ORDER
-#else
-#define XBYTE_ORDER 0
-#endif
-
-#ifndef MYBYTE_ORDER
-#define MYBYTE_ORDER XBYTE_ORDER
-#endif
-
-#ifndef DO_FILTER_SWAP
-#if (XBYTE_ORDER !=0) && (XBYTE_ORDER != MYBYTE_ORDER)
-#define DO_FILTER_SWAP 1
-#endif
-#endif
-
-#if DO_FILTER_SWAP
-char *_sw2(char *s, int n, char *_swf, int off)
-{
- char c;
- char *t=s;
- size_t i;
- if( !_swf || !_swf[off]++ ){
- for (i=0; i<n; i += 2, s += 2) {
- c = *s;
- *(s) = *(s+1);
- *(s+1) = c;
- }
- }
- return t;
-}
-
-char *_sw4(char *s, int n, char *_swf, int off)
-{
- char c;
- char *t=s;
- size_t i;
- if( !_swf || !_swf[off]++ ){
- for (i=0; i<n; i += 4, s += 4) {
- c = *s;
- *s = *(s+3);
- *(s+3) = c;
- c = *(s+1);
- *(s+1) = *(s+2);
- *(s+2) = c;
- }
- }
- return t;
-}
-
-char *_sw8(char *s, int n, char *_swf, int off)
-{
- char c;
- char *t=s;
- size_t i;
- if( !_swf || !_swf[off]++ ){
- for (i=0; i<n; i += 8, s += 8) {
- c = *(s+0);
- *(s+0) = *(s+7);
- *(s+7) = c;
- c = *(s+1);
- *(s+1) = *(s+6);
- *(s+6) = c;
- c = *(s+2);
- *(s+2) = *(s+5);
- *(s+5) = c;
- c = *(s+3);
- *(s+3) = *(s+4);
- *(s+4) = c;
- }
- }
- return t;
-}
-
-#define SW1(a,n,b,i) a
-#define SW2(a,n,b,i) _sw2(a,n,b,i)
-#define SW4(a,n,b,i) _sw4(a,n,b,i)
-#define SW8(a,n,b,i) _sw8(a,n,b,i)
-
-#if defined(FILTER_PTYPE) && (FILTER_PTYPE != c)
-#error "FILTER_PTYPE environment variable must be 'c' when running with Rosetta"
-#endif
-
-#else
-
-#define SW1(a,n,b,i) a
-#define SW2(a,n,b,i) a
-#define SW4(a,n,b,i) a
-#define SW8(a,n,b,i) a
-
-#endif
-
diff --git a/funtools/filter/swap_c.h b/funtools/filter/swap_c.h
deleted file mode 100644
index f58fe26..0000000
--- a/funtools/filter/swap_c.h
+++ /dev/null
@@ -1 +0,0 @@
-static char *SWAP_C="\n#if __DARWIN_BYTE_ORDER\n#define XBYTE_ORDER __DARWIN_BYTE_ORDER\n#else\n#define XBYTE_ORDER 0\n#endif\n\n#ifndef MYBYTE_ORDER\n#define MYBYTE_ORDER XBYTE_ORDER\n#endif\n\n#ifndef DO_FILTER_SWAP\n#if (XBYTE_ORDER !=0) && (XBYTE_ORDER != MYBYTE_ORDER)\n#define DO_FILTER_SWAP 1\n#endif\n#endif\n\n#if DO_FILTER_SWAP\nchar *_sw2(char *s, int n, char *_swf, int off)\n{\n char c;\n char *t=s;\n size_t i;\n if( !_swf || !_swf[off]++ ){\n for (i=0; i<n; i += 2, s += 2) {\n c = *s;\n *(s) = *(s+1);\n *(s+1) = c;\n }\n }\n return t;\n}\n\nchar *_sw4(char *s, int n, char *_swf, int off)\n{\n char c;\n char *t=s;\n size_t i;\n if( !_swf || !_swf[off]++ ){\n for (i=0; i<n; i += 4, s += 4) {\n c = *s;\n *s = *(s+3);\n *(s+3) = c;\n c = *(s+1);\n *(s+1) = *(s+2);\n *(s+2) = c;\n }\n }\n return t;\n}\n\nchar *_sw8(char *s, int n, char *_swf, int off)\n{\n char c;\n char *t=s;\n size_t i;\n if( !_swf || !_swf[off]++ ){\n for (i=0; i<n; i += 8, s += 8) {\n c = *(s+0);\n *(s+0) = *(s+7);\n *(s+7) = c;\n c = *(s+1);\n *(s+1) = *(s+6);\n *(s+6) = c;\n c = *(s+2);\n *(s+2) = *(s+5);\n *(s+5) = c;\n c = *(s+3);\n *(s+3) = *(s+4);\n *(s+4) = c;\n }\n }\n return t;\n}\n\n#define SW1(a,n,b,i) a\n#define SW2(a,n,b,i) _sw2(a,n,b,i)\n#define SW4(a,n,b,i) _sw4(a,n,b,i)\n#define SW8(a,n,b,i) _sw8(a,n,b,i)\n\n#if defined(FILTER_PTYPE) && (FILTER_PTYPE != c)\n#error \"FILTER_PTYPE environment variable must be 'c' when running with Rosetta\"\n#endif\n\n#else\n\n#define SW1(a,n,b,i) a\n#define SW2(a,n,b,i) a\n#define SW4(a,n,b,i) a\n#define SW8(a,n,b,i) a\n\n#endif\n\n";
diff --git a/funtools/filter/symbols.c b/funtools/filter/symbols.c
deleted file mode 100644
index e6bb899..0000000
--- a/funtools/filter/symbols.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory
- */
-
-/*
- *
- * symbols.c -- management of filter symbols
- *
- */
-
-#include <filter.h>
-
-#define SYMINC 100 /* increment for allocating symbols */
-
-static char *bincols=NULL;
-static char xbin[SZ_LINE];
-static char ybin[SZ_LINE];
-
-extern char *filtinchar;
-
-/*
- *
- * Public Routines
- *
- */
-
-/*
- *
- * FilterSymbolInit -- init the symbol table
- *
- */
-#ifdef ANSI_FUNC
-int
-FilterSymbolInit(Filter filter)
-#else
-int FilterSymbolInit(filter)
- Filter filter;
-#endif
-{
- /* make sure we are init'ed */
- if( filter == NULL ){
- gerror(stderr, "symbol table not initialized\n");
- return(0);
- }
- filter->symtab = (FilterSymbols)xcalloc(SYMINC, sizeof(FilterSymRec));
- filter->nsyms = 0;
- filter->maxsyms = SYMINC;
- return(SYMINC);
-}
-
-/*
- *
- * FilterSymbolEnter -- enter a new symbol in the symbol table
- * The symbol will either be a column name, or
- * a parameter in the table header, or
- * a parameter in the primary header
- *
- */
-#ifdef ANSI_FUNC
-char *
-FilterSymbolEnter(Filter filter, char *s, int *got)
-#else
-char *FilterSymbolEnter(filter, s, got)
- Filter filter;
- char *s;
- int *got;
-#endif
-{
- int brack=0;
- int i, j;
- char *t;
- FilterSymbols sp;
- char name[SZ_LINE];
- FITSCard card;
- FITSHead fhd;
-
- /* see return value */
- if( got ) *got =-3;
-
- /* make sure we are init'ed */
- if( filter == NULL ){
- gerror(stderr, "symbol table not initialized\n");
- return(NULL);
- }
-
- /* make sure we are init'ed */
- if( filter->fhd == NULL ){
- gerror(stderr, "symbol table not initialized\n");
- return(NULL);
- }
- fhd = filter->fhd;
-
- /* make sure we have something */
- if( !s || !*s )
- return(NULL);
-
- /* this is the name of the variable in the filter program */
- nowhite(s, name);
- /* but strip off brackets */
- if( (t=strchr(name, '[')) != NULL ){
- brack=1;
- *t = '\0';
- }
-
- /* loop through the symbol table and look for existing symbol */
- for(i=0; i<filter->nsyms; i++){
- sp = &(filter->symtab[i]);
- /* skip accidentally empty ones */
- if( (sp->name == NULL) || (*sp->name == '\0') )
- continue;
- /* is this name already entered? */
- if( !strcasecmp(sp->name, name) ){
- if( got ) *got = 1;
- return (char *)sp->name;
- }
- }
-
- /* make sure there is room for a new symbol */
- if( i >= filter->maxsyms ){
- filter->maxsyms += SYMINC;
- filter->symtab = (FilterSymbols)xrealloc(filter->symtab,
- filter->maxsyms*sizeof(FilterSymRec));
- }
-
- /* this is where the next symbol will be entered */
- sp = &(filter->symtab[i]);
-
- /* look for name in the list of columns */
- if( fhd->table ){
- for(j=0; j<fhd->table->tfields; j++){
- if( !strcasecmp(name, fhd->table->col[j].name) ){
- if( brack && (fhd->table->col[j].n==1) ){
- if( got ) *got = -2;
- return(NULL);
- }
- sp->type = SYM_COL;
- sp->name = (char *)xstrdup(name);
- sp->idx = j;
- filter->size += fhd->table->col[j].size;
- filter->nsyms++;
- if( got ) *got = 1;
- return (char *)sp->name;
- }
- }
- }
- /* look for name in the table header */
- if( (t=ft_headgets(fhd, name, 0, NULL, &card)) ){
- sp->type = SYM_PAR;
- sp->name = xstrdup(name);
- sp->value = t;
- sp->idx = -1;
- filter->nsyms++;
- if( got ) *got = 2;
- return (char *)sp->name;
- }
- /* look for name in the primary header */
- else if( fhd->primary &&
- (t=ft_headgets(fhd->primary, name, 0, NULL, &card)) ){
- sp->type = SYM_PAR;
- sp->name = xstrdup(name);
- sp->value = t;
- sp->idx = -1;
- filter->nsyms++;
- if( got ) *got = 2;
- return (char *)sp->name;
- }
- /* did not find the symbol anywhere */
- else{
- gerror(stderr, "can't find '%s' in table\n", s);
- if( got ) *got = -1;
- return(NULL);
- }
-} /* EnterSymbol */
-
-
-/*
- *
- * FilterSymbolLookup -- lookup a symbol in the symbol table
- *
- */
-#ifdef ANSI_FUNC
-FilterSymbols
-FilterSymbolLookup(Filter filter, char *name)
-#else
-FilterSymbols FilterSymbolLookup(filter, name)
- Filter filter;
- char *s;
-#endif
-{
- int i;
-
- /* sanity check */
- if( !name || !*name ) return NULL;
-
- /* loop through the symbol table and look for existing symbol */
- for(i=0; i<filter->nsyms; i++){
- /* skip accidentally empty ones */
- if( (filter->symtab[i].name == NULL) || (*filter->symtab[i].name == '\0') )
- continue;
- /* look for name */
- if( !strcasecmp(filter->symtab[i].name, name) ){
- /* return symbol table record if found */
- return &filter->symtab[i];
- }
- }
- return NULL;
-}
-
-/*
- *
- * FilterSymbolDefaults -- enter default symbols for X and Y columns
- *
- */
-#ifdef ANSI_FUNC
-int
-FilterSymbolDefaults(Filter filter, int enter)
-#else
-int FilterSymbolDefaults(filter, enter)
- Filter filter;
- int enter;
-#endif
-{
- int ip=0;
- char tbuf[SZ_LINE];
- char *mbuf;
- char *k;
- char *s;
-
- /* this is only for events */
- if( !filter || !filter->fhd || !filter->fhd->table )
- return 0;
-
- /* parse bincols variable */
- if( !bincols ){
- mbuf = xstrdup(filter->mode);
- if( !keyword(mbuf, "bincols", tbuf, SZ_LINE) )
- return 0;
- if( mbuf ) xfree(mbuf);
- s = tbuf;
- /* parse the bincols string and add the symbols */
- newdtable(",:)");
- bincols = xstrdup(s);
- k = bincols;
- /* point past first paren */
- if( *bincols == '(' )
- k++;
- if( !word(k, xbin, &ip) || !word(k, ybin, &ip) ){
- freedtable();
- return 0;
- }
- freedtable();
- /* set the filter bin strings */
- if( filter->xbin ) xfree(filter->xbin);
- filter->xbin = xstrdup(xbin);
- if( filter->ybin ) xfree(filter->ybin);
- filter->ybin = xstrdup(ybin);
- }
- else if( !filter->xbin || !filter->ybin ){
- /* set the filter bin strings */
- if( filter->xbin ) xfree(filter->xbin);
- filter->xbin = xstrdup(xbin);
- if( filter->ybin ) xfree(filter->ybin);
- filter->ybin = xstrdup(ybin);
- }
-
- /* enter symbols if necessary */
- if( enter ){
- if( !FilterSymbolEnter(filter, xbin, NULL) ||
- !FilterSymbolEnter(filter, ybin, NULL) )
- return 0;
- }
- return 1;
-}
-
-/*
- *
- * FilterSymbolFree -- free space from symbol table
- *
- */
-#ifdef ANSI_FUNC
-void
-FilterSymbolFree(Filter filter)
-#else
-void FilterSymbolFree(filter)
- Filter filter;
-#endif
-{
- int i;
- FilterSymbols sp;
-
- /* if we have no symbols, just return */
- if( !filter || !filter->nsyms )
- return;
-
- /* loop through the symbol table and free up records */
- for(i=0; i<filter->nsyms; i++){
- sp = &(filter->symtab[i]);
- /* skip accidentally empty ones */
- if( (sp->name == NULL) || (*sp->name == '\0') )
- continue;
- /* process this type of symbol */
- switch(sp->type){
- case SYM_COL:
- xfree(sp->name);
- sp->name = NULL;
- break;
- case SYM_PAR:
- xfree(sp->name);
- xfree(sp->value);
- sp->name = NULL;
- break;
- }
- }
- /* no symbols */
- filter->nsyms = 0;
- if( bincols != NULL ){
- xfree(bincols);
- bincols = NULL;
- *xbin = '\0';
- *ybin = '\0';
- }
-}
-
diff --git a/funtools/filter/tfilt.c b/funtools/filter/tfilt.c
deleted file mode 100644
index 0eba0b1..0000000
--- a/funtools/filter/tfilt.c
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory
- */
-
-/*
- *
- * tfilt.c -- test program for filtering tables
- *
- */
-
-#if HAVE_CONFIG_H
-#include <conf.h>
-#endif
-
-#include <stdio.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#include <sys/types.h>
-#include <prsetup.h>
-#include <filter.h>
-#include <idx.h>
-#include <word.h>
-
-extern char *optarg;
-extern int optind;
-
-char bincols[SZ_LINE];
-int debug=0;
-
-#define NEVENTS 10240
-
-/* from Harbison&Steele by way of GNU cinfigure ...
- returns 1 for bigendian, 0 for littleendian */
-#ifdef ANSI_FUNC
-int
-is_bigendian(void)
-#else
-int is_bigendian()
-#endif
-{
- union
- {
- long l;
- char c[sizeof (long)];
- } u;
- u.l = 1;
- return(u.c[sizeof (long) - 1] == 1);
-}
-
-/*
- *
- * ListEvents -- list events in a binary table
- *
- */
-#ifdef ANSI_FUNC
-static int
-ListEvents(GIO gio, FILE *ofd, FITSHead header, char *s, int iformat,
- char *mode)
-#else
-static int ListEvents(gio, ofd, header, s, iformat, mode)
- GIO gio; /* input FITS file handle */
- FILE *ofd; /* output file handle */
- FITSHead header; /* fitsy header */
- char *s; /* filter for events */
- int iformat; /* input format of data: 0=native, 1=fits */
- char *mode /* filteropen mode */
-#endif
-{
- int i, j; /* loop counters */
- int get; /* number of events to read */
- int got; /* number of events read */
- int left; /* number of events left to read */
- int total; /* total number of events in file */
- int convert; /* whether we have to convert to native */
- int nev; /* max number of events to read at once */
- int evsize; /* size of an event record */
- int ototal; /* output total events */
- int *vbuf; /* valid event flags */
- char *ebuf; /* event buffer */
- char *eptr; /* current pointer into ebuf */
- char tbuf[SZ_LINE]; /* ever-present temp buf */
- unsigned char bval; /* byte value */
- short sval; /* short value */
- unsigned short usval; /* short value */
- int ival; /* int value */
- long long lval; /* 64-bit int value */
- unsigned int uival; /* unsigned int value */
- float fval; /* float value */
- double dval; /* double value */
- int dofilt=0; /* true if we can filter */
- Filter filter=NULL;
-
- /* we have to convert to native if the data is not the
- same as the big-endian-ness of the machine */
- convert = (iformat != is_bigendian());
- /* create the mode string */
- if( convert )
- strcpy(tbuf, "convert=true");
- else
- strcpy(tbuf, "convert=false");
- strcat(tbuf, bincols);
- if( debug )
- strcat(tbuf, ",debug=2");
-
- /* now add the input mode */
- if( mode && *mode ){
- strcat(tbuf, ",");
- strcat(tbuf, mode);
- }
-
- /* init some convenience variables */
- evsize = header->basic->naxis[0];
- total = header->basic->naxis[1];
- ototal = 0;
-
- /* open the filter */
- if( (filter = FilterOpen(header, s, tbuf)) == NULL ){
- fprintf(stderr, "ERROR: tfilt could not open filter: %s\n",
- s ? s : "no filter");
- return(0);
- }
- else if( filter == NOFILTER ){
- fprintf(stderr, "no valid filter specified\n");
- return(0);
- }
-
- /* allocate space for a pile of event records */
- for(nev=NEVENTS; nev>0; nev /=2){
- if( ((ebuf = (char *)xmalloc(evsize*nev))!= NULL) &&
- ((vbuf = (int *)xmalloc(sizeof(int)*nev))!= NULL) )
- break;
- }
-
- /* print out header */
- for(j=0; j<header->table->tfields; j++){
- switch(header->table->col[j].type){
- case 'B':
- case 'L':
- fprintf(ofd, "%6s", header->table->col[j].name);
- break;
- case 'I':
- case 'U':
- fprintf(ofd, "%6s", header->table->col[j].name);
- break;
- case 'J':
- case 'V':
- fprintf(ofd, "%11s", header->table->col[j].name);
- break;
- case 'K':
- fprintf(ofd, "%20s", header->table->col[j].name);
- break;
- case 'E':
- fprintf(ofd, "%11s", header->table->col[j].name);
- break;
- case 'D':
- fprintf(ofd, "%17s", header->table->col[j].name);
- break;
- default:
- break;
- }
- }
- fprintf(ofd, "\n");
-
- for(j=0; j<header->table->tfields; j++){
- switch(header->table->col[j].type){
- case 'B':
- case 'L':
- fprintf(ofd, " -----");
- break;
- case 'I':
- case 'U':
- fprintf(ofd, " -----");
- break;
- case 'J':
- case 'V':
- fprintf(ofd, " ----------");
- break;
- case 'K':
- fprintf(ofd, " -------------------");
- break;
- case 'E':
- fprintf(ofd, " ----------");
- break;
- case 'D':
- fprintf(ofd, " ----------------");
- break;
- default:
- break;
- }
- }
- fprintf(ofd, "\n");
-
- /* set the total number of events or 'read til eof' */
- left = total;
-
- /* read all event records */
- while( left != 0 ){
- /* figure out how many to read this time */
- get = MIN(nev, left);
- /* read in a pile of events */
- got=gread(gio, ebuf, evsize, get);
- /* check for eof */
- if( got != get ){
- fprintf(stderr, "Warning: events ends at %d (expected %d)\n",
- total-left, total);
- /* we must be done */
- left = 0;
- }
- else{
- left -= got;
- }
- /* filter the events through the co-process */
- if( filter ){
- dofilt = FilterEvents(filter, ebuf, evsize, got, vbuf);
- }
- /* process each event in the pile */
- for(eptr=ebuf, i=0; i<got; i++, eptr += evsize){
- /* if its not a valid event, skip it */
- if( dofilt && (vbuf[i] == 0) )
- continue;
- /* else increment the total events */
- ototal++;
- /* process this event */
- for(j=0; j<header->table->tfields; j++){
- switch(header->table->col[j].type){
- case 'B':
- case 'L':
- ColumnLoad(eptr+header->table->col[j].offset,
- header->table->col[j].size, 1, convert, (char *)&bval);
- fprintf(ofd, "%6d", (int)bval);
- break;
- case 'I':
- ColumnLoad(eptr+header->table->col[j].offset,
- header->table->col[j].size, 1, convert, (char *)&sval);
- fprintf(ofd, "%6d", (int)sval);
- break;
- case 'U':
- ColumnLoad(eptr+header->table->col[j].offset,
- header->table->col[j].size, 1, convert, (char *)&usval);
- fprintf(ofd, "%6d", (int)usval);
- break;
- case 'J':
- ColumnLoad(eptr+header->table->col[j].offset,
- header->table->col[j].size, 1, convert, (char *)&ival);
- fprintf(ofd, "%11d", ival);
- break;
- case 'V':
- ColumnLoad(eptr+header->table->col[j].offset,
- header->table->col[j].size, 1, convert, (char *)&uival);
- fprintf(ofd, "%11d", uival);
- break;
- case 'K':
- ColumnLoad(eptr+header->table->col[j].offset,
- header->table->col[j].size, 1, convert, (char *)&lval);
- fprintf(ofd, "%20lld", lval);
- break;
- case 'E':
- ColumnLoad(eptr+header->table->col[j].offset,
- header->table->col[j].size, 1, convert, (char *)&fval);
- fprintf(ofd, "%11.2f", fval);
- break;
- case 'D':
- ColumnLoad(eptr+header->table->col[j].offset,
- header->table->col[j].size, 1, convert, (char *)&dval);
- fprintf(ofd, "%17.4f", dval);
- break;
- default:
- break;
- }
- }
- fprintf(ofd, "\n");
- }
- }
-
- /* free up allocated space */
- if( ebuf )
- xfree(ebuf);
- if( vbuf )
- xfree(vbuf);
-
- /* done with the filter process */
- if( filter )
- FilterClose(filter);
-
- /* final tally */
- fprintf(ofd, "\nTotal events: %d\n", ototal);
-
- /* that's good news */
- return(ototal);
-}
-
-#ifdef ANSI_FUNC
-int
-main (int argc, char **argv)
-#else
-main(argc, argv)
- int argc;
- char **argv;
-#endif
-{
- int c;
- int type;
- int x, y, n;
- int nmask;
- int x0, x1, y0, y1, block;
- int listev = 0;
- int dispim = 0;
- int dispfilt = 1;
- int doidx = 0;
- char *s;
- char *iname; /* input file name ptr */
- char fname[SZ_LINE]; /* input file name */
- char tail[SZ_LINE]; /* tail of file name */
- char tbuf[SZ_LINE]; /* ever-present temp buffer */
- char mode[SZ_LINE]; /* mode for FilterOpen */
- char evsect[SZ_LINE]; /* event section for image filters */
- long save_pos; /* save position in FITS file */
- GIO gio; /* input FITS file handle */
- FITSHead header; /* global fitsy header struct */
- Filter filter;
- FilterMask masks;
-
- /* we want the args in the same order in which they arrived, and
- gnu getopt sometimes changes things without this */
- putenv("POSIXLY_CORRECT=true");
-
- /* assume events */
- type = 'e';
-
- /* process switch arguments */
- while ((c = getopt(argc, argv, "d:efilxz")) != -1){
- switch(c){
- case 'd':
- dispim = 1;
- strcpy(evsect, optarg);
- if(sscanf(optarg, "%d %d %d %d %d", &x0, &x1, &y0, &y1, &block)!=5){
- fprintf(stderr, "-d requires x0, x1, y0, y1, block\n");
- exit(1);
- }
- break;
- case 'e':
- type = 'e';
- break;
- case 'f':
- dispfilt = 1;
- break;
- case 'i':
- type = 'i';
- break;
- case 'l':
- listev = 1;
- break;
- case 'x':
- doidx = 1;
- break;
- case 'z':
- putenv("FILTER_PAINT=true");
- break;
- }
- }
-
- if( type == 'e' ){
- strcpy(mode, "type=events");
- if( dispim ){
- snprintf(tbuf, SZ_LINE, ",evsect=\"%s\"", evsect);
- strcat(mode, tbuf);
- }
- }
- else{
- strcpy(mode, "type=image");
- }
-
-
- /* get file name or use a default */
- if( optind >= argc ){
- iname = "../funtest/test.ev[EVENTS]";
- }
- else{
- strncpy(fname, argv[optind], SZ_LINE);
- if( !strchr(fname, '[') )
- strncat(fname, "[EVENTS]", SZ_LINE);
- iname = fname;
- optind++;
- }
-
- /* if we do not list or display, we are in debug mode */
- if( !listev && !dispim && !dispfilt ){
- debug = 2;
- }
-
- /* open the binary table extension */
- if( (gio=ft_fitsheadopen(iname, &header, tail, SZ_LINE, "r")) == NULL ){
- fprintf(stderr, "ERROR: can't read FITS binary table: %s\n", iname);
- exit(1);
- }
- if( header == NULL ){
- fprintf(stderr, "ERROR: can't access FITS data: %s\n", iname);
- exit(1);
- }
-
- if( keyword(tail, "bincols", tbuf, SZ_LINE) ){
- snprintf(bincols, SZ_LINE, ",bincols=(%s)", tbuf);
- strcat(mode, bincols);
- }
- else{
- strcpy(bincols, ",bincols=(x,y)");
- strcat(mode, bincols);
- }
- if( debug )
- strcat(mode, ",debug=2");
- strcat(mode, ",lexonly=1");
- if( (s=getenv("FILTER_PAINT")) ){
- if( istrue(s) )
- strcat(mode, ",paint=true");
- else if( isfalse(s) )
- strcat(mode, ",paint=false");
- }
-
- while( 1 ){
- *tbuf = '\0';
- if( feof(stdin) )
- break;
- fgets(tbuf, SZ_LINE, stdin);
- if( *tbuf == 'q' )
- exit(0);
- if( *tbuf ){
- if( listev ){
- /* list out events */
- save_pos = gtell(gio);
- ListEvents(gio, stdout, header, tbuf, 1, mode);
- gseek(gio, save_pos, SEEK_SET);
- }
- if( dispim ){
- /* display image */
- if( *tbuf && (*tbuf != '\n') ){
- fprintf(stdout, "input string: %s", tbuf);
- filter = FilterOpen(header, tbuf, mode);
- if( !filter )
- fprintf(stderr, "Error in FilterOpen()\n");
- else if( filter == NOFILTER )
- fprintf(stderr, "No valid filter specified\n");
- else{
- nmask = FilterImage(filter, x0, x1, y0, y1, block, &masks, NULL);
- if( nmask ){
- /* loop through mask segments */
- y = 1;
- for(n=0; n<nmask; n++){
- /* process rows before the y row of this mask segment */
- for(; y<masks[n].y; y++){
- for(x=1; x<=(x1-x0+block)/block; x++)
- fprintf(stdout, "*");
- fprintf(stdout, "\n");
- }
- /* process each mask segment having the same y value */
- x = 1;
- while(1){
- /* process columns before the start column */
- for(; x<masks[n].xstart; x++)
- fprintf(stderr, ".");
- /* process columns in the mask */
- for(; x<=masks[n].xstop; x++)
- fprintf(stderr, "%d", masks[n].region);
- /* if we have another mask segment with the same y,
- we keep going */
- if( ((n+1)<nmask) && (masks[n+1].y==y) )
- n++;
- else
- break;
- }
- /* process the rest of the columns for this y row */
- for(; x<=(x1-x0+block)/block; x++)
- fprintf(stderr, ".");
- /* processed all mask segs in this y */
- fprintf(stderr, "\n");
- /* bump to next y row */
- y++;
- }
- /* process y rows after last row containing a mask segment */
- for(y=masks[nmask-1].y+1; y<=(y1-y0+block)/block; y++){
- for(x=1; x<=(x1-x0+block)/block; x++)
- fprintf(stdout, "*");
- fprintf(stdout, "\n");
- }
- }
- if( masks )
- xfree(masks);
- FilterClose(filter);
- }
- }
- }
- else{
- if( *tbuf && (*tbuf != '\n') ){
- fprintf(stdout, "input string: %s", tbuf);
- filter = FilterOpen(header, tbuf, mode);
- if( !filter )
- fprintf(stderr, "Error in FilterOpen()\n");
- else if( filter == NOFILTER )
- fprintf(stderr, "No valid filter specified\n");
- if( doidx ){
- if( (s = xstrdup(_FilterString()) ) ){
- fprintf(stdout, "index input: %s\n", s);
- idxinitparser(s);
- idxparse();
- idxendparser();
- xfree(s);
- }
- }
- if( dispfilt ){
- fprintf(stdout, "filter: %s\n", _FilterString());
- }
- FilterClose(filter);
- }
- }
- }
- }
- return(0);
-}
diff --git a/funtools/filter/tfilt.ex b/funtools/filter/tfilt.ex
deleted file mode 100644
index 0e54be2..0000000
--- a/funtools/filter/tfilt.ex
+++ /dev/null
@@ -1,24 +0,0 @@
-!foosub(pi, pichans, event,"this is a test", 'x')
-(pha*10)=='P'
-pha==phachans/2
-annulus(X,Y,503,512,30,80)
-(pow(x-400,2)+pow(y-400,2))<=16
-min(pi,pha)>1&&max(pi,pha)<3
-min(pi,pha)*14>x
-max(pi,pha)==(pi+1)
-(pi+pha)>2+log(pi)-pha
-(pi<3)&&(pi==pha)
-pi=3:4,(pha>1)
-pha=1,100<time
-pha=1,100||pi
-pha=1,100||pi=2
-pi=1,2&&pha>3
-pi>pha+1
-pha=1,3,5:7,pi=2,4,6:8&&time>100
-pha=1,3,5:7,pi=2,4,6:8,time<100
-pha=1,3,5:7
-pi=1,pha=2
-pi=1,pha==2
-pi=1,2==pha
-pha=1,3,5:7,pi=2:3
-pha=1,3,5:7,pi=2,4,6:8
diff --git a/funtools/filter/tl.c b/funtools/filter/tl.c
deleted file mode 100644
index a5aa346..0000000
--- a/funtools/filter/tl.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "word.h"
-#include "tl.h"
-
-#ifndef UNUSED
-#ifdef __GNUC__
-# define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
-#else
-# define UNUSED(x) UNUSED_ ## x
-#endif
-#endif
-
-/*
- * getfitsfloatcenter: funtools and cfitsio have a 0.5 pixel descrepancy
- * when converting floating point physical coords to image coords.
- * setting this environment variable makes funtools work like cfitsio
- */
-static double fitscenval=0.5;
-static int ceninited=0;
-#ifdef ANSI_FUNC
-static double getfitsfloatcenter(void)
-#else
-static double getfitsfloatcenter()
-#endif
-{
- char *s=NULL;
- if( !ceninited ){
- if( (s=getenv("FILTER_CFITSIO")) && istrue(s) ){
- fitscenval = 1.0;
- }
- ceninited = 1;
- }
- return fitscenval;
-}
-
-#ifdef ANSI_FUNC
-double
-tlp2i (double dp, double tlmin, double binsiz, int type)
-#else
-double tlp2i (dp, tlmin, binsiz, type)
- double dp;
- double tlmin;
- double binsiz;
- int type;
-#endif
-{
- double dval = getfitsfloatcenter();
- if( (binsiz == 1.0) || (binsiz <= 0.0) ){
- switch(type){
- case 'B':
- case 'I':
- case 'U':
- case 'J':
- case 'K':
- case 'V':
- default:
- return ((dp - tlmin) + 1.0);
- case 'E':
- case 'D':
- return ((dp - tlmin) + dval);
- }
- }
- else{
- switch(type){
- case 'B':
- case 'I':
- case 'U':
- case 'J':
- case 'K':
- case 'V':
- default:
- return ((dp - tlmin)/binsiz + 1.0);
- case 'E':
- case 'D':
- return ((dp - tlmin)/binsiz + dval);
- }
- }
-}
-
-#ifdef ANSI_FUNC
-int
-itlp2i (double dp, double tlmin, double binsiz, int UNUSED(type))
-#else
-int itlp2i (dp, tlmin, binsiz, type)
- double dp;
- double tlmin;
- double binsiz;
- int type;
-#endif
-{
- if( (binsiz == 1.0) || (binsiz <= 0.0) ){
- return (int)((dp - tlmin) + 1.0);
- }
- else{
- return (int)((dp - tlmin)/binsiz + 1.0);
- }
-}
-
-#ifdef ANSI_FUNC
-double
-tli2p (double di, double tlmin, double binsiz, int type)
-#else
-double tli2p (di, tlmin, binsiz, type)
- double di;
- double tlmin;
- double binsiz;
- int type;
-#endif
-{
- double dval = getfitsfloatcenter();
- if( (binsiz == 1.0) || (binsiz <= 0.0) ){
- switch(type){
- case 'B':
- case 'I':
- case 'U':
- case 'J':
- case 'K':
- case 'V':
- default:
- return ((di - 1.0) + tlmin);
- case 'E':
- case 'D':
- return ((di - dval) + tlmin);
- }
- }
- else{
- switch(type){
- case 'B':
- case 'I':
- case 'U':
- case 'J':
- case 'K':
- case 'V':
- default:
- return ((di - 1.0)*binsiz + tlmin);
- case 'E':
- case 'D':
- return ((di - dval)*binsiz + tlmin);
- }
- }
-}
-
-#ifdef ANSI_FUNC
-double
-tldim (double tlmin, double tlmax, double binsiz, int type)
-#else
-double tldim (tlmin, tlmax, binsiz, type)
- double tlmin;
- double tlmax;
- double binsiz;
- int type;
-#endif
-{
- if( (binsiz == 1.0) || (binsiz <= 0.0) ){
- switch(type){
- case 'B':
- case 'I':
- case 'U':
- case 'J':
- case 'K':
- case 'V':
- default:
- return ((tlmax-tlmin) + 1.0);
- case 'E':
- case 'D':
- return (tlmax-tlmin);
- }
- }
- else{
- switch(type){
- case 'B':
- case 'I':
- case 'U':
- case 'J':
- case 'K':
- case 'V':
- default:
- return ((tlmax-tlmin)/binsiz + 1.0);
- case 'E':
- case 'D':
- return ((tlmax-tlmin)/binsiz);
- }
- }
-}
-
diff --git a/funtools/filter/tl.h b/funtools/filter/tl.h
deleted file mode 100644
index 4e7dcfe..0000000
--- a/funtools/filter/tl.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory
- */
-
-/*
- *
- * tl.h -- declarations for tl parsing
- *
- */
-
-#ifndef __tl_h
-#define __tl_h
-
-#include "prsetup.h"
-
-_PRbeg
-
-double tlp2i _PRx((double dp, double tlmin, double binsiz, int type));
-int itlp2i _PRx((double dp, double tlmin, double binsiz, int type));
-double tli2p _PRx((double di, double tlmin, double binsiz, int type));
-double tldim _PRx((double tlmin, double tlmax, double binsiz, int type));
-
-_PRend
-
-#endif
diff --git a/funtools/filter/xalloc_c.h b/funtools/filter/xalloc_c.h
deleted file mode 100644
index a25dbc3..0000000
--- a/funtools/filter/xalloc_c.h
+++ /dev/null
@@ -1 +0,0 @@
-static char *XALLOC_C="\n/*\n * Copyright (c) 2004-2009 Smithsonian Astrophysical Observatory\n */\n\n/*\n *\n * xalloc -- safe memory allocation with error checking\n *\n */\n\n/* this module is compiled within a funtools filter and must not require\n the header files */\n#ifdef FILTER_PTYPE\n#define ANSI_FUNC 1\n#else\n#include <xalloc.h>\n#endif\n\n#define XALLOC_ERROR \"ERROR: can't allocate memory (xalloc)\\n\"\n\n#if XALLOC_SETJMP\n\nstatic jmp_buf *xalloc_envptr=NULL;\n\n#ifdef ANSI_FUNC\nvoid xalloc_savejmp(jmp_buf *env)\n#else\nvoid xalloc_savejmp(env)\n jmp_buf *env;\n#endif\n{\n xalloc_envptr = env;\n}\n#endif\n\n\n#ifdef ANSI_FUNC\nstatic void _xalloc_error(void)\n#else\nstatic void _xalloc_error()\n#endif\n{\n write(1, XALLOC_ERROR, strlen(XALLOC_ERROR));\n#if XALLOC_SETJMP\n if( xalloc_envptr )\n longjmp(*xalloc_envptr, XALLOC_SETJMP);\n else\n#endif\n exit(1);\n}\n\n#ifdef ANSI_FUNC\nvoid *xmalloc(size_t n)\n#else\nvoid *xmalloc(n)\n size_t n;\n#endif\n{\n void *p;\n \n if( !(p = (void *)malloc(n)) )\n _xalloc_error();\n return p;\n}\n\n#ifdef ANSI_FUNC\nvoid *xcalloc (size_t n, size_t s)\n#else\nvoid *xcalloc (n, s)\n size_t n, s;\n#endif\n{\n void *p;\n\n if( !(p = (void *)calloc(n, s)) )\n _xalloc_error();\n return p;\n}\n\n#ifdef ANSI_FUNC\nvoid *xrealloc (void *p, size_t n)\n#else\nvoid *xrealloc (p, n)\n void *p;\n size_t n;\n#endif\n{\n if( !p )\n return xmalloc(n);\n if( !(p = (void *)realloc(p, n)) )\n _xalloc_error();\n return p;\n}\n\n#ifdef ANSI_FUNC\nvoid xfree (void *p)\n#else\nvoid xfree (p)\n void *p;\n#endif\n{\n if( p )\n free(p);\n}\n\n#ifdef ANSI_FUNC\nchar *xstrdup (char *s)\n#else\nchar *xstrdup (s)\n char *s;\n#endif\n{\n if( s )\n return((char *)strcpy((char *)xmalloc((size_t)strlen(s)+1), s));\n else\n return NULL;\n}\n";